Enabling Password Encryption

Set the EncryptPassword connection property, which specifies whether the password is transmitted in encrypted format to enable password encryption.

The password is sent over the wire only after a login is negotiated; the password is first encrypted and then sent, after the password encryption is enabled. The EncryptPassword values are:
  • 0 – use plain text password. This is the default value.

  • 1 – use encrypted password. If it is not supported, return an error message.

  • 2 – use encrypted password. If it is not supported, use plain text password.

Note: To use asymmetrical encryption, you require a server that supports this type of encryption, such as Adaptive Server 15.0.2. Asymmetrical encryption requires additional processing time and may cause a slight delay in login time.
Example

In this example, sapass is not sent over the wire until a login is negotiated and the password is encrypted and sent.

AseConnection.ConnectionString=
”Data Source=MANGO;" +
   "Port = 5000;" +
   "Database=pubs2;" +
   "UID=sa;" +
   "PWD=sapass;" +
   "EncryptPassword=1;”;