Enabling extended password encryption for the jConnect for JDBC Driver

This section describes how to enable extended password encryption for the jConnect for JDBC Driver.


Using the ENCRYPT_PASSWORD connection property,

The ENCRYPT_PASSWORD connection property specifies whether the password is transmitted in encrypted format. In ESD #8, this same property is used to enable asymmetric key encryption. When password encryption is enabled and the server supports asymmetric key encryption, this format is used instead of the symmetric key encryption.

Set the ENCRYPT_PASSWORD connection property to true to enable password encryption. The default value is false.

NoteIf the server is configured to require clients to use an encrypted password, entering a plain text password will cause login to fail.


Enabling login retry with a clear text password

Server login fails when the ENCRYPT_PASSWORD property is set to true, and the server does not support password encryption. If you want to use a clear text password for servers that do not support password encryption, set the RETRY_WITH_NO_ENCRYPTION connection property to true.

When both ENCRYPT_PASSWORD and RETRY_WITH_NO_ENCRYPTION properties are set to true, jConnect first logs in using the encrypted password. If login fails, jConnect logs in using the clear text password.


Setting up the Java Cryptography Extension (JCE) provider

The new asymmetric password encryption mechanism uses RSA encryption algorithms to encrypt the password being transmitted. In order to perform this RSA encryption, configure your JRE with a suitable Java Cryptography Extension (JCE) provider. The configured JCE provider should be capable of supporting the “RSA/NONE/OAEPWithSHA1AndMGF1Padding” transformation.

The Sun JCE provider included with Sun JREs may not be capable of handling the “RSA/NONE/OAEPWithSHA1AndMGF1Padding” transformation. In order to use the extended password encryption feature in this case, you need to configure an external JCE provider that includes support for this transformation. If the JCE is not capable of handling the required transformation, you will receive an error message at login.

You can use the JCE_PROVIDER_CLASS connection property to specify the JCE provider. There are a number of commercial and open source JCE providers that you can choose from. For example, the “Bouncy Castle Crypto APIs for Java” is a popular open source Java JCE provider. If you choose not to specify the JCE_PROVIDER_CLASS property, jConnect will attempt to use any bundled JCE.

To specify a JCE provider:

If jConnect is unable to use the JCE provider specified, it will attempt to use the JCE providers configured in the JRE security profile. If no other JCE providers are configured or configured providers do not support the required transformation and password encryption is enabled, the connection will fail.

NoteThe JCE provider you specify must support the “RSA/NONE/OAEPWithSHA1AndMGF1Padding” transformation.