Reputation: 1038
I am just starting to work with native encryption in SQL Server, and I have observed something I am hoping someone here can shed some light on.
I'm using AES_256 encryption, and in reviewing the encrypted result, I have noticed that the same value in different rows will have a different encrypted result. Here is a sample where I have encrypted an nvarchar(50) with a value of xxx and I get the follow encrypted result:
xxx 0x008C6C289DE9BE42AA47EC9F2022DCC401000000657FCB75FD4C63F63249A0BCA716CB384E79B84E3D862EC41C6A4A491C64658A
xxx 0x008C6C289DE9BE42AA47EC9F2022DCC4010000004BE3C369FFD523110CAA3A957FC4A7820F779ADB8882A0A33A53DF480FE797A8 xxx 0x008C6C289DE9BE42AA47EC9F2022DCC40100000002288512DFB126BC6E17320217629365478B48691E62863B9A08E3772EFA7486 xxx 0x008C6C289DE9BE42AA47EC9F2022DCC40100000076223FB6D568E210D6D07AA9BFEDB991D46EF64187F2A31AEF96A5F61FE722A3 xxx 0x008C6C289DE9BE42AA47EC9F2022DCC401000000E90AFB7EBA5B445CCAD9E6CC94966DC66B86557F2CD5E3E1FB68F308FA5F2952
I've been searching around but have not found an answer yet. Anybody know why this occurs?
Thanks.
Upvotes: 1
Views: 1441
Reputation: 294407
Salting through initialization vector. Encrypting must result in different values for same clear text, otherwise it discloses information.
Upvotes: 3