SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL 2000 DBA Toolkit Part 1


SQL 2000 DBA Toolkit Part 1

Author
Message
Mike C
Mike C
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6271 Visits: 1172
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
Quornstar
Quornstar
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 245
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
dimperatori
dimperatori
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 2
Thank you very much you are a genius!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search