Encrypt/Decrypt Sql Server 2005 encrypted column in .Net
I am in need to encrypt/decrypt data that has been encrypted on the database (Sql Server 2005) level in the .Net code. RjindaelManaged with 256 bit key length and 128 bit block size is the equivalent of AES 256 algorithm, but I don't know how 开发者_JAVA技巧to go about matching Key and IV so that both Sql Server and .Net encryption methods would produce same results.
Has anyone come across this in the past?
Sql Server key is created with code similar to the one below:
create symmetric key SomeKeyName
with
algorithm = AES_256,
key_source = 'SomePassword',
identity_value = 'SomePassword'
encryption by certificate SomeCertificate
You can't. If is encrypted in SQL EncryptByKey function, then it must be decrypted using DecryptByKey. The format in which the encrypted data is stored is proprietary and is not public.
精彩评论