|
Encrypts data with given password by Triple DES algorithm with 168
bit key.
Syntax
xp_des3_encrypt { variable1 [, variable2 , variable3
...] , password, encrypted_text OUTPUT }
Arguments
variable1 [, variable2 , variable3 ...]
Variables which need to be encrypted
password
VARCHAR.Secure password
encrypted_text
VARCHAR or VARBINARY. Variable to hold the output.
Permissions
Execute permissions default to the public role.
Return Code Values
0 - success, or Error code if failed.
encrypted_text IS NOT NULL (success) or IS NULL (failure)
Example
declare @encrypted varchar(8000)
exec xp_des3_encrypt 'clear','MyPassword', @encrypted OUTPUT
exec xp_des3_decrypt @encrypted ,'MyPassword', @encrypted OUTPUT
if @encrypted != 'clear' or @encrypted IS NULL
begin
raiserror ('des3 encryption failed!',16,10)
end |
|