|
Decrypts data previously encrypted with xp_desx_encrypt
algorithm.
Syntax
xp_desx_decrypt { encrypted_text , password,
key, variable1 OUTPUT [, variable2 OUTPUT , variable3 OUTPUT ...]
Arguments
encrypted_text
VARCHAR. Text previously encrypted with xp_desx_encrypt
function.
password
VARCHAR. Your hard password. Exactly the same that is used for
encryption.
key
VARCHAR. Initializing the key. Exactly the same that is used for encryption. It
must be exactly 8 chars.
variable1 OUTPUT [, variable2 OUTPUT , variable3 OUTPUT ...]
Variables to hold the decrypted information. The order of the variables
should be the same with the order of the variables given to the encryption function.
Remark
If you specify the wrong password the decryption will succeed but clear_text
will probably hold some garbage. You are not able to find out if the password was
wrong or correct.
Permissions
Execute permissions default to the public role.
Return Code Values
0 - success, or Error code
if failed.
Return Code Values
declare @encrypted varchar(8000)
declare @return_code
exec xp_desx_encrypt 'clear','MyPassword','12345678',@encrypted OUTPUT
exec @return_code = xp_desx_decrypt @encrypted ,'MyPassword','12345678',@encrypted OUTPUT
if @return_code != 0
begin
raiserror ('DESX encryption failed!',16,10)
end
|
|