EncryptText SQL FUNCTION

The EncryptText() function takes two (2) arguments and returns base 64 string. If any of the parameters are null or empty a null is returned. The first argument is the value which will be encrypted using AES 256 with second argument serving as the key. To descrypt already encrypted value use the decryptText() function, the secret key will be required to descrypt. The secret key is case sensitive. The key is not stored in the database and discarded as soon as encryption or decryption finishes.

Syntax EncryptText ( String to Process , Secret Key)

/* Following code returns : ppsxZD8gsn03/LvyMz2rMg== */
SELECT EncryptText('Hello World', 'SecretKey');
    

It is very useful to store password or other confidential information without encrypting the entire database file.