decrypt_cbc()
Description
Given an encrypted string created using encrypt_cbc()
and a profile name, returns its decrypted cleartext.
function decrypt_cbc (inputString varbyte(16400), inputKeyname varchar(256)) returns varchar(8192) CHARACTER SET UNICODE
Example
The following example decrypts a credit card number. It is assumed that a profile has been set up in profiles.conf
with the name ccnum
and the encryption method aes_cbc_pad
.
# BTEQ -- Enter your SQL request or BTEQ command:
select thales.decrypt_cbc
('BE08C791A97E8FAC725DA39AFC071BD30A32C70C514E00B8D6D420501EF8B9D60F06537CE93’xb,'ccnum');
#select thales.decrypt_cbc
('BE08C791A97E8FAC725DA39AFC071BD30A32C70C514E00B8D6D420501EF8B9D60F06537CE93’xb,'ccnum');
*** Query completed. One row found. One column returned.
*** Total elapsed time was 1 second.
thales.decrypt_cbc
('BE08C791A97E8FAC725DA39AFC071BD30A32C70C514E00B8D6D420501EF8B9D60F06537CE93’xb,'ccnum')
-----------------------------------------------------------------------
1234-9876-5678-6543