Hi Friends,
I Want To Encrypt My Stored Prodcedure For Security Purpose
How I Can Encrypt My SP
Plz Help Me...
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anuja PawarPosted Jan 25, 2012, 8:23 AM
sagar BhosalePosted Jan 25, 2012, 6:26 AM
Anuja PawarPosted Jan 24, 2012, 5:34 AM
Inorder to encrypt the text of stored procedures containing sensitive information, Sql Server provides WITH ENCRYPTION to encrypt the Stored Procedure.
CREATE procedure [dbo].[SP_GET_Employee_Details_encrypt]
WITH ENCRYPTION AS
SELECT EMP_id,First_name,Last_name,Email_id
from Employee
Order by Email_id
Once the stored procedure has been created WITH ENCRYPTION, attempts to view the stored procedure returns a message specifying that the text is encrypted:
EXEC sp_helptext SP_GET_Employee_Details_encrypt
The text for object 'SP_GET_Employee_Details_encrypt' is encrypted.
One note of caution. Save the original text of the stored procedure before encrypting it, as there is no straightforward way to decode the encrypted text. One hack is to attach a debugger to the server process and retrieve the decrypted procedure from memory at runtime.
Refer this for more information
http://www.mssqltips.com/sqlservertip/1046/decrypting-sql-server-database-objects/
Jignesh TrivediPosted Jan 23, 2012, 10:53 PM
When you create SP @ that time use "With Encription" keyword.
CREATE PROCEDURE dbo.test
WITH ENCRYPTION
AS
BEGIN
SELECT* from mydatatable
END
hope this help.
to decript sp please refer.
http://msdynamicstips.com/2008/12/24/decrypt-sql-2005-stored-procedures-functions-views-and-triggers/
Satyapriya NayakPosted Jan 23, 2012, 1:35 PM
Please refer the below links
http://www.codeproject.com/Articles/38583/How-Do-I-Protect-My-Stored-Procedure-Code
http://www.codeproject.com/Tips/239100/Encrypting-all-the-Stored-Procedures-of-a-Database
Thanks