Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««45678

SQL 2000 DBA Toolkit Part 1 Expand / Collapse
Author
Message
Posted Monday, August 09, 2010 3:25 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, April 14, 2014 4:18 PM
Points: 1,276, Visits: 1,132
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
Post #966276
Posted Monday, July 18, 2011 3:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 13, 2014 8:03 AM
Points: 2, Visits: 202
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


Post #1143263
Posted Friday, August 26, 2011 7:37 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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!
Post #1166519
« Prev Topic | Next Topic »

Add to briefcase «««45678

Permissions Expand / Collapse