Mike,
I have successdully registered all DLLs and try to run following sample code:
DECLARE @plain_text VARCHAR(500) -- Our plain text
DECLARE @enc_text VARCHAR(500) -- Our encrypted text
DECLARE @dec_text VARCHAR(500) -- Our decrypted text
DECLARE @key VARCHAR(500) -- Our encryption key
--SET @plain_text = 'Now is the time for all good men to come to the aid of their countrymen.'
set @plain_text='This is my test of encrypted message.'
EXEC master..xp_generatekey 448, @key OUTPUT
EXEC master..xp_blowfishencrypt @plain_text, @key, @enc_text OUTPUT
EXEC master..xp_blowfishdecrypt @enc_text, @key, @dec_text OUTPUT
PRINT 'Test 3: Longer String/Longer Key'
PRINT '--Plain Text: ''' + @plain_text + ''''
PRINT '--Key: ''' + @key + ''''
PRINT '--Encrypted Text: ''' + @enc_text + ''''
PRINT '--Decrypted Text: ''' + @dec_text + ''''
IF @plain_text = @dec_text
PRINT '--Result: PLAIN TEXT IS EQUAL TO DECRYPTED TEXT'
ELSE
PRINT '--Result: PLAIN TEXT IS NOT EQUAL TO DECRYPTED TEXT'
PRINT '-----------------------------------------'
The problem is that I always get the same Encrypted Text even though Key changes. Your commented code is working fine (both key and encrypted version change)
Am I doing something terribly wrong?
Thanks,
Igor