dotnet thoughts 

a dotnet developer's technical blog

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.

No Responses to “Encryption-Decryption using stored procedure in SQL Server”

  1. 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 … :)

    Comment by sainath — November 15, 2008 @ 9:46 am

RSS feed for comments on this post. TrackBack URL

Leave a Response

*