Encrypt and Dcrypt data

  • Hi i want to encrypt data and dcrypt the

    May i know the process i m using sqlserver 2000 standard edition ....

    Thankz in advance.

  • SQL 2000 has no built in encryption/decryption mechanisms.

    p.s. SQL 2000 posts should go in the SQL 2000 forums

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • It is possible in 2K5 as it has inbuilt encryption. Let me know if you need more details

    If you do not want to add a third party for 2k, the best way is to migrate rto 2k5 and then use the built in encrypt

  • Use BOL to learn how to use SQL 2005's built in encryption functions. If you are using SQL 2000 you need to do the encryption/decryption in the business layer. That is where I would do it anyway.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • SQL Server 2000 has no built-in encryption as already mentioned. However, there are 3rd party solutions such as xp_crypt. You can also get Michael Coles' toolkit[/url] from here at SQL Server Central.

    K. Brian Kelley
    @kbriankelley

  • SELECT ENCRYPT ('Test')-> when this select query is run on a database the value obtained is in an encrypted format.

    Hence, if you did mean that you what to enter a password in encryted format, so that no one else would be able to see it, then this method could help you 😛

    so when you are inserting a new password into the table field then use

    INSERT INTO tablename values('id',ENCRYPT('password'))

    and when you did try to retrieve the info back, you would get the password you stored ...

    hope this helps and this is what you want...;)

  • rinu philip (7/15/2008)


    SELECT ENCRYPT ('Test')-> when this select query is run on a database the value obtained is in an encrypted format.

    On which version of SQL? On SQL 2005, it throws an error.

    SELECT ENCRYPT ('Test')

    Msg 195, Level 15, State 10, Line 1

    'ENCRYPT' is not a recognized built-in function name.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I have tried it on sql 2000.:) and it worked..

  • rinu philip (7/15/2008)


    I have tried it on sql 2000.:) and it worked..

    I thnk that's an ODBC function, rather than native SQL. Can't find a confirmation though.

    Either way, there's no associated decrypt

    Ref:

    http://qa.sqlservercentral.com/articles/Security/encryptfunction/372/

    http://windowsitpro.com/article/articleid/14035/how-do-i-encrypt-fields-in-sql-server.html

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • hmm..you may be right, I actually used this command through VB, however when the users forgot their password we had to reset with a new one! there was no way to retrieve 😉

  • It's not a documented function and therefore unsupported. Given that I can't find any info about it, you probably couldn't show to an auditor it's algorithm or strength, meaning it likely wouldn't be found acceptable.

    K. Brian Kelley
    @kbriankelley

  • There was a way in SQL 2000 to perform an MD5, one way encryption of data, and ENCRYPT() works on my SS2K instance.

    However this cannot be decrypted. You can "compare" two encrypted values to see if they are equal, but you cannot retrieve the data.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply