encrypt_string()
Note
The encrypt_cbc()
, encrypt_fpe()
, and encrypt_ff1()
UDFs are recommended. Use of encrypt_string()
is not recommended.
Description
Given a cleartext string in Latin characters and a key, returns its encrypted equivalent.
function encrypt_string (inputString varchar(16384), inputKeyname varchar(256)) returns varbyte(16400)
The input string must adhere to BTEQ requirements, such as escaping special characters. For example, if the input string contains an apostrophe, use a double apostrophe: 'It''s a beautiful day'
.
Note
The initialization vector (IV) for encrypt_string()
is taken from the file /etc/vormetric/vormetric_local_crypto_server.conf
.
Example
BTEQ -- Enter your SQL request or BTEQ command:
# select thales.encrypt_string('clear text', 'KEY1');
# select thales.encrypt_string('clear text', 'KEY1');
*** Query completed. One row found. One column returned.
*** Total elapsed time was 2 seconds.
thales.encrypt_string('clear text','KEY1')
-------------------------------------------------------------------
97E7BCEB7D8EA55A59BC83BD44609B0A