我正在尝试在 SQL Server 2012 中加密然后解密文本。我期待第三次打印能够给我回复customer_abc
:
DECLARE
@var_customer VARCHAR(25),
@var_password VARBINARY(8000)
SET @var_customer = 'customer_abc'
SET @var_password = EncryptByPassPhrase('secret', @var_customer )
print @var_customer
print @var_password
print DecryptByPassPhrase('secret', @var_password )
结果:
customer_abc
0x01000000398F9A0D3FE98D29E8F56D6B1908EA87C08706786319DD1BBB3F150FFC5B7F3C
0x637573746F6D65725F616263