decrypt

decrypt

Post by John B. Moor » Thu, 26 Dec 2002 13:16:15



I have inherted a database on MSSQL 7 and I have noticed
that a number of the stored procs are as follows..

exec decrypt(......)

and there is nothing "encrypted" characters..

Is there any way to undo this encryption.. It appears at
this point that the client does was not aware that this was
happening and have yet to uncover the original source..

John...

 
 
 

decrypt

Post by Mike Wad » Thu, 26 Dec 2002 17:30:18


SQL Server does not implement its own decryption procedures, therefore this
must be a call to custom encryption and decryption procedures.

First of all you need to look up the decrypt stored procedure and prey that
the former developer did not save it "WITH ENCRYPTION" (the SQL encription
methods).

If the decript stored procedure is not encrypted then it will be easy to
identify the encryption and decryption methods employed and this decrypt the
whole db.

If not..... then your only hope is to break the encryption or either SQL
Server or the custom encryption.   I believe there are tools that can
decrypt stored procedures around but it will no doubt be difficult to get
hold of them since they are generally hacker tools.   To try and break the
custom encryption, firstly you will need a little knowledge about the
relative expertise of the former developer (ie.  was he very knowlagable in
cryptography?)  If not, then chances are that the algorythm is a crude
single key encryptor or a simple mathematical character translator.  both
are relatively simple to crack based on probablility theory.    Another
posibility is that the encrption employs the windows dual key encription
techniques.  If this is the case then you will need to find the decryption
key.  As far as I am aware, to-date no algorythm has been devised for
cracking a dual key encryption method.

I hope this gives you a few pointers, sorry there is no easy solution.

Good luck



Quote:> I have inherted a database on MSSQL 7 and I have noticed
> that a number of the stored procs are as follows..

> exec decrypt(......)

> and there is nothing "encrypted" characters..

> Is there any way to undo this encryption.. It appears at
> this point that the client does was not aware that this was
> happening and have yet to uncover the original source..

> John...


 
 
 

decrypt

Post by Erland Sommarsko » Fri, 27 Dec 2002 08:18:42


[posted and mailed, please reply in news]


Quote:> I have inherted a database on MSSQL 7 and I have noticed
> that a number of the stored procs are as follows..

> exec decrypt(......)

> and there is nothing "encrypted" characters..

> Is there any way to undo this encryption.. It appears at
> this point that the client does was not aware that this was
> happening and have yet to uncover the original source..

You mean that when you try to script the procedure you get something
like:

   SET QUOTED_IDENTIFIER OFF
   GO
   SET ANSI_NULLS OFF
   GO

   exec(decrypt(0x6C89D9ED5...))
   GO
   SET QUOTED_IDENTIFIER OFF
   GO
   SET ANSI_NULLS ON
   GO

Right. This procedure was created WITH ENCRYPTION. The idea with
encryption is that you should not be able to decrypt it, because the
encryption was there to prevent people from looking at other's
intellectual property.

But, yes, the encryption for SQL7 has been cracked. No, I don't know the
details, nor where you can find them. All I know is that there is code
which can decrypt this.

The m*of the story is that a database is a very bad place to store
code in. You shold use a version-control system for that purpose. And
in the case you hire other people to write code that you are going to
own, you should of course require to get the source code.

--

I support PASS - the definitive global community for SQL Server
professionals - http://www.veryComputer.com/

 
 
 

decrypt

Post by Erland Sommarsko » Fri, 27 Dec 2002 08:20:19


[posted and mailed, please reply in news]


> SQL Server does not implement its own decryption procedures, therefore
> this must be a call to custom encryption and decryption procedures.

No decrypt() is a built-in function in SQL7 that only works with
EXEC if memory serves. It is of course not documented, but it permits
you to script an encrypted procedure and load it somewhere else. I
don't think this functionailty remains in SQL2000.

--

I support PASS - the definitive global community for SQL Server
professionals - http://www.sqlpass.org

 
 
 

1. Decrypt Store Procedure

I should add that there have been rumors about cracking the 6.x encryption.
I don't know where such a crack can be found, though.

--
Tibor Karaszi
MCDBA, MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB
Please reply to the newsgroup only, not by email.


2. ADO data control error. Need help!

3. How to decrypt dtsrun command

4. Show extended properties ???

5. Decrypt DTS Hexadecimal Text

6. LUXEMBOURG-245730--ORACLE-PL/SQL-ANALYSTE PROGRAMMEUR ORACLE PL/SQL

7. problem creating a decrypt package through jdbc

8. Sample Data

9. How can I decrypt and encrypted trigger??...

10. How to decrypt user defined function?

11. How to Decrypt

12. Decrypting PGP Encrypted data?

13. How to decrypt a stored procedures in sql server 2000