July 19, 2007 09:19 PM

Decrypt SQL Server Objects

A simple T-SQL script unlocks encryption
Rating: (0)
SQL Server Magazine
InstantDoc ID #95728
When users create stored procedures, functions, and other SQL Server objects, the text body of those objects is immediately available to anyone who has sufficient (often minimal) permissions. You can see how easy it is to expose object content by creating a stored procedure and scripting its content in Query Analyzer, SQL Server Management Studio (SSMS), Windows PowerShell, or a third-party scripting tool. In many cases, developers and software vendors want to obscure the underlyi...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

The procedure works for procedure but with my instance (SQL2005 SP2) doesn't with views.
Everytime i receive the error
Syntax not correct near 'AS'

infante@gigasrl.it 8/11/2008 1:59:28 PM


I found a bug in the 2005 version: The line that reads

PRINT(SUBSTRING(@ContentOfDecryptedObject, 1 + 2000*@i, 2000*(@i + 1)))

should read

PRINT(SUBSTRING(@ContentOfDecryptedObject, 1 + 2000*@i, 2000))

because the third parameter to the subsctring is length not position

Michael8/13/2007 5:36:01 AM


Disregard the above, I fat fingered.

Peter7/25/2007 1:34:33 PM


The code does not work. It only returns Null when using the 2000 code on a 2000 machine.

Peter7/25/2007 1:34:11 PM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS