• After installing the extended procs, etc I ran into an issue passing encrypted data from one db server to another.  I wrote some simple SQL to show this.  If I run the below SQL on server A and then server B I get diferent values for the encrypted data.  So when I encrypt data on Server A and then attempt to decrypt on Server B, I get Null.

    As you can see, I bypassed the key tables and am passing the master and local keys directly.  Is there something else that the encryption code is using that would make encryption values unique for each server?

     

    Server A:

    0x424E750E96151DB65F6C6750A4ABA91A

    test

    Server B:

    0x19E7D34C42A2271F34BB69CFC2529173

    test

     

    DECLARE @encText VARBINARY(8000)

    DECLARE @plainText VARBINARY(8000)

    declare @Tmp varbinary(100)

    set @Tmp = convert(varbinary,'test')

    EXEC master.dbo.xp_encrypt_aes @Tmp,

     @encText OUTPUT,

     'pw12345',

     0x2BFD1CC6C094293DD6FD053809B68E3517BA255101BE5AA55DE3EBC501E7BFD1DBB59FE722263CB4699830871627570F1E73DD5FAA23A5BEC642218C109A524F,

     0xF2909C4FE472D92D1221747CAFE59D8BA078CEDC8AECB3BC3D83BBE7F595C585115D9CCEAC263C4B5884B5958EB82CBC813114E8A3192172F18D8540B268E00AB2A70BA9573708BD2419A26E2AA78159,

     256

    select @encText

    EXEC master.dbo.xp_decrypt_aes

     @encText,

     @plaintext OUTPUT,

     'pw12345',

     0x2BFD1CC6C094293DD6FD053809B68E3517BA255101BE5AA55DE3EBC501E7BFD1DBB59FE722263CB4699830871627570F1E73DD5FAA23A5BEC642218C109A524F,

     0xF2909C4FE472D92D1221747CAFE59D8BA078CEDC8AECB3BC3D83BBE7F595C585115D9CCEAC263C4B5884B5958EB82CBC813114E8A3192172F18D8540B268E00AB2A70BA9573708BD2419A26E2AA78159,

     256

    select convert(varchar,@plaintext)