• Hi Mike,

    I'm studying the tool kit and got a question of using password for the key. I have used different password for creating master and local keys but I found that whenever the password used for encrypt the data and decrypt the data is the same, the password for keys are meaningless. Like the example below, all the key materials and passwords are different for the master key and local key. But still, I can get the right encryption and decryption by that key as below.

    exec create_master_key 'PWMaster', 'pw1', 'pw2'

    exec create_local_key 'PWMaster', 'PWLocal', 'pw3'

    DECLARE @encry AS VARBINARY(128)

    DECLARE @decry AS VARCHAR(128)

    select @encry = dbo.fn_encrypt_aes(CAST('Data to be encrypt' AS VARBINARY), 'PWLocal', 'pw4', 128)

    select @decry = dbo.fn_decrypt_aes(@encry, 'PWLocal', 'pw4', 128)

    Print @encry

    Print @decry

    Have I made any stupid mess up of the concept? Can you please remind me? Thanks so much.

    Gary.