我正在玩Asymmetric Encryption and Decryption,但我不明白當我嘗試解密值時得到的結果。DECRYPTBYASYMKEY()未返回預期值
爲什麼會這樣:
CREATE ASYMMETRIC KEY myasymkey
WITH ALGORITHM = RSA_2048
ENCRYPTION BY PASSWORD = '123pass!';
GO
SELECT DECRYPTBYASYMKEY(ASYMKEY_ID('myasymkey'),
EncryptByAsymKey(AsymKey_ID('myasymkey'), 'Greg'),
N'123pass!');
GO
農產品0x47726567
?我期待它是Greg
。
更新:我是啞巴,0x47726567
是Greg
從varbinary
轉換時。