DBA > Job Interview Questions > DERBY Java Database FAQs

How to specify an Alternate Encryption Algorithm

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

How to specify an Alternate Encryption Algorithm?

Derby supports the following encryption algorithms:

* DES (the default)
* DESede (also known as triple DES)
* Any encryption algorithm that fulfills the following requirements:
o it is symmetric
o it is a block cipher, with a block size of 8 bytes
o it uses the NoPadding padding scheme
o its secret key can be represented as an arbitrary byte array
o it requires exactly one initialization parameter, an initialization vector of type javax.crypto.spec.IvParameterSpec
o it can use javax.crypto.spec.SecretKeySpec to represent its key

For example, the algorithm Blowfish implemented in the Sun JCE package fulfills these requirements.

By Java convention, an encryption algorithm is specified like this:

algorithmName/feedbackMode/padding

The only feedback modes allowed are:
* CBC
* CFB
* ECB
* OCB

By default, Derby uses the DES algorithm of DES/CBC/NoPadding.

Specify an alternate encryption algorithm when you create a database with the encryptionAlgorithm=algorithm attribute. If the algorithm you specify is not supported by the provider you have specified, Derby throws an exception.

(Continued on next question...)

Other Job Interview Questions