All Packages Class Hierarchy This Package Previous Next Index
Developers create an encryption class which implements this interface. InstantDB associates a TableEncrypt object with a Table. When reading or writing to disk, InstantDB invokes the associated methods on the TableEncrypt object to encrypt or decrypt each row of the table.
A TableEncrypt object is associated with a table using the method: jdbc.idbConnection.setTableEncryption (String tableName, TableEncrypt encrypter).
Indexes are created using the clear text values of columns. Therefore, you should not create indexes on columns which you wish to remain confidential.
public abstract void Encrypt(String tableName, byte rowBuffer[], int rowNumber, int colOffsets[])
tableName
- The name of the table
being encrypted. A single TableEncrypt object can be
associated with multiple tables. This parameter allows
the implementation to vary the encryption process
for each table.
rowBuffer
- The actual row of data
to be encrypted. The encryption algorithm must
guarantee that the data does not increase in size as
a result of the encryption process. On return from
this method, rowBuffer should contain encrypted data.
Room for cipher padding can be achieved by creating dummy CHAR columns of sufficient size either after individually encrypted columns, or by including a single dummy CHAR column at the end of a row if the whole row is to be encrypted.
rowNumber
- This parameter allows
implementations to vary their encryption algorithm
depending on the physical row number in the table.
colOffsets
- An array specifying
the offsets of each column in rowBuffer. This allows
applications to encrypt individual columns and so
increase the speed of the encryption process.
The control column: $$control, which is present in every InstantDB table is included in both rowBuffer and in colOffsets. InstantDB ensures that this column is NOT encrypted on disk.
public abstract void Decrypt(String tableName, byte rowBuffer[], int rowNumber, int colOffsets[])
tableName
- The name of the table
being encrypted. A single TableEncrypt object can be
associated with multiple tables. This parameter allows
the implementation to vary the decryption process
for each table.
rowBuffer
- The actual row of data
to be decrypted. On return from this method, rowBuffer
should contain decrypted data.
rowNumber
- This parameter allows
implementations to vary their decryption algorithm
depending on the physical row number in the table.
colOffsets
- An array specifying
the offsets of each column in rowBuffer. The control
column: $$control, which is present in every
InstantDB table is included in both the rowBuffer
and colOffsets.
All Packages Class Hierarchy This Package Previous Next Index