ENCRYPT_AES

Returns a value that is the result of encrypting data-string using the AES encryption algorithm. The password used for decryption is either the password-string value or the encryption password value (assigned by the SET ENCRYPTION PASSWORD statement).

Example

Assume that table EMP1 has a social security column called SSN. This example uses the ENCRYPTION PASSWORD value to hold the encryption password.

  SET ENCRYPTION PASSWORD = 'Ben123'

  INSERT INTO EMP1 (SSN) VALUES ENCRYPT_AES( '289-46-8832' )