|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, March 27, 2013 3:22 PM
Points: 1,276,
Visits: 1,112
|
|
homebrew01 (4/5/2010)
Will BlowFish or TwoFish work with image data ?? I downloaded the latest SQL toolkit and Tried running TwoFish after modifying it to handle image data converted to varbinary(max). The data came back as NULL, instead of encrypted. Either I did something wrong (very likely), or there's some limitation in the DLL for length, or there's some other problem I don't understand. --modified fn_encrypt_twofish in the hopes it will work with bigger data CREATE FUNCTION [dbo].[fn_encrypt_twofish_max] (@plaintext VARBINARY(max), @localkeyname VARCHAR(128), @password VARCHAR(128), @keybits INT) RETURNS VARBINARY(max) AS BEGIN DECLARE @masterkey VARBINARY(64) DECLARE @localkey VARBINARY(80) SELECT @masterkey = m.[Key], @localkey = l.[Key] FROM dbo.Local_Key_Vault l, dbo.Master_Key_Vault m WHERE l.[name] = @localkeyname AND l.[master_key_name] = m.[name] DECLARE @enctext VARBINARY(max) EXEC dbo.xp_encrypt_twofish @plaintext, @enctext OUTPUT, @password, @masterkey, @localkey, @keybits RETURN @enctext END
and then ran -- Encrypt data UPDATE MyTable SET VoiceData = cast(master.dbo.fn_encrypt_twofish_max(VoiceData , 'Local Key 1', NULL, 32) AS VARBINARY(max))
Thoughts ? TIA
Hi HomeBrew,
This was written originally for SQL 2000, and the XP's would not accept BLOB data. You're limited to a max. of 8,000 bytes in most cases (I believe the Blowfish implementation maxxed out at 2,000 bytes). You're using SQL 2005 or 2008 (otherwise you wouldn't have access to varbinary(max)). If you're interested contact me offline and I'll send you an updated version of Blowfish/Twofish that uses CLR and doesn't have these same limitations.
Thanks Mike C
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, March 22, 2013 3:04 AM
Points: 2,
Visits: 177
|
|
Hi
We are currently migrating from SQL 2000 to SQL2008R2 64x and are unable to install the dll's - because the dlls were compiled for 32bit environments.
We use the AES encryption and base64 encoding functionality.
Does anyone have the 64bit version of the AES/base64 related dlls that they can post a link for please? i.e. 64 bit versions of the following:
xp_encrypt_aes.dll xp_decrypt_aes.dll xp_encode_base64.dll xp_decode_base64.dll
If not, does anyone have the source code so I can recompile myself?
Thanks
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, August 26, 2011 7:36 PM
Points: 1,
Visits: 2
|
|
| Thank you very much you are a genius!
|
|
|
|