Encryption-Decryption using stored procedure in SQL Server

For more security we may require to use Encryption-Decryption of data. Here is some code, which can be used for Encryption-Decryption in SQL Server.

CREATE PROCEDURE usp_Encryption_Decryption
@DataText VARCHAR(100)
AS
declare @encryptedstuff VARCHAR(100)
declare @decryptedstuff VARCHAR(100)

SET @encryptedstuff = EncryptByPassPhrase(‘LED_PWD-2007′, @DataText)
SELECT @encryptedstuff
SET @decryptedstuff = DecryptByPassPhrase(‘LED_PWD-2007′, @encryptedstuff)
SELECT @decryptedstuff

No related content found.

This entry was posted in SQL Server. Bookmark the permalink.

0 Responses to Encryption-Decryption using stored procedure in SQL Server

  1. sainath says:

    hi
    i hv used this script
    but tell me how effective is this??

    i hv seen capicom which is again used for encryption and decryption so which is more powerful.
    But i was unable to use capicom. do u know hw to use that in SQL stored procedure ??

    thnx for the post … :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>