|
Encrypts data with the given password by RC4 algorithm.
Syntax
xp_rc4_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_rc4_encrypt 'clear','MyPassword', @encrypted OUTPUT
exec xp_rc4_decrypt @encrypted ,'MyPassword', @encrypted OUTPUT
if @encrypted != 'clear' or @encrypted IS NULL
begin
raiserror ('RC4 encryption failed!',16,10)
end |
|