<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Explanation of WITH ENCRYPTION clause for Stored Procedure and User Defined Functions</title>
	<atom:link href="http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Giri</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-55892</link>
		<dc:creator>Giri</dc:creator>
		<pubDate>Tue, 15 Sep 2009 16:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-55892</guid>
		<description>how to protect table from viewing its data and columns in sql server 2005, we can encrypt SP&#039;s and UDF, what abt table, i read an article on this but its for data encryption in table, but i want to encrypt table columns itself, i want to restrict the user from seeing its design</description>
		<content:encoded><![CDATA[<p>how to protect table from viewing its data and columns in sql server 2005, we can encrypt SP&#8217;s and UDF, what abt table, i read an article on this but its for data encryption in table, but i want to encrypt table columns itself, i want to restrict the user from seeing its design</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elahi_Mohsen</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-47299</link>
		<dc:creator>Elahi_Mohsen</dc:creator>
		<pubDate>Tue, 24 Feb 2009 22:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-47299</guid>
		<description>Hai
can anyone tell me how to create a stored procedure with an encryption and password to decrypt it back again when ever requrired.</description>
		<content:encoded><![CDATA[<p>Hai<br />
can anyone tell me how to create a stored procedure with an encryption and password to decrypt it back again when ever requrired.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chaitu</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-44459</link>
		<dc:creator>chaitu</dc:creator>
		<pubDate>Mon, 01 Dec 2008 07:15:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-44459</guid>
		<description>Hai 
          can anyone tell me how to create a stored procedure with an encryption and password to decrypt it back again when ever requrired.</description>
		<content:encoded><![CDATA[<p>Hai<br />
          can anyone tell me how to create a stored procedure with an encryption and password to decrypt it back again when ever requrired.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-43244</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 25 Sep 2008 11:55:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-43244</guid>
		<description>Hi Vinay,

Yes, Use the code provided above (copyright prevents redistribution so you&#039;ll need to sign up and download the code yourself):

http://education.sqlfarms.com/education/ShowPost.aspx?PostID=783.

and wrap this up in a cursor or loop.  You can even call this using xp_cmdshell &#039;SQLCMD...&#039; via a batch file if you wanted to pass in other params (multiple db&#039;s, server\instance, etc). 

All the best,

Matt.</description>
		<content:encoded><![CDATA[<p>Hi Vinay,</p>
<p>Yes, Use the code provided above (copyright prevents redistribution so you&#8217;ll need to sign up and download the code yourself):</p>
<p><a href="http://education.sqlfarms.com/education/ShowPost.aspx?PostID=783" rel="nofollow">http://education.sqlfarms.com/education/ShowPost.aspx?PostID=783</a>.</p>
<p>and wrap this up in a cursor or loop.  You can even call this using xp_cmdshell &#8216;SQLCMD&#8230;&#8217; via a batch file if you wanted to pass in other params (multiple db&#8217;s, server\instance, etc). </p>
<p>All the best,</p>
<p>Matt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vinay</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-42766</link>
		<dc:creator>vinay</dc:creator>
		<pubDate>Sat, 13 Sep 2008 15:03:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-42766</guid>
		<description>Hi,

Is there anyway of encrypting more than 10 stored procedures at a time?????


Please suggest.......

Thanks in Advance</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Is there anyway of encrypting more than 10 stored procedures at a time?????</p>
<p>Please suggest&#8230;&#8230;.</p>
<p>Thanks in Advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhilash</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-41436</link>
		<dc:creator>Abhilash</dc:creator>
		<pubDate>Thu, 07 Aug 2008 10:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-41436</guid>
		<description>Hello,

There is a tool which can decrypt the encrypted stored procedure. Is there any way with which we can restrict decryption of stored procedures? In my situation the database would be in the client side and I would like to enrypt the Stored procedure. Please help.

Thanks,
Abhilash</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>There is a tool which can decrypt the encrypted stored procedure. Is there any way with which we can restrict decryption of stored procedures? In my situation the database would be in the client side and I would like to enrypt the Stored procedure. Please help.</p>
<p>Thanks,<br />
Abhilash</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Dimmick</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-38868</link>
		<dc:creator>Mike Dimmick</dc:creator>
		<pubDate>Thu, 29 May 2008 12:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-38868</guid>
		<description>In fact, due to a flaw in how SQL Server encrypts an altered procedure, decrypting the original procedure text is easy.

SQL Server uses the RC4 cipher algorithm to encrypt the procedure text. This algorithm generates a stream of key data (called the keystream) from a starting key, then encrypts the plaintext by using the XOR operation. The beauty of the XOR operation is that to reverse it, you simply XOR the ciphertext with the keystream.

Unfortunately, when you use ALTER PROCEDURE, SQL Server encrypts the new text using the same key as it did when encrypting the original text. This means it uses the same keystream. To recover the keystream when you know the ciphertext and the plaintext, you can simply XOR the ciphertext and plaintext together. You can then recover the original plaintext by XORing the recovered keystream with the original ciphertext.

You can find copies of scripts that do this in numerous places, for example at http://education.sqlfarms.com/education/ShowPost.aspx?PostID=783.

I&#039;m not sure how SQL Server decides what the encryption key should be - it may be as simple as deriving a key from the procedure&#039;s objectid.

SQL Server 2005&#039;s documentation describes the result as &#039;obfuscated text&#039; rather than &#039;encrypted&#039;.</description>
		<content:encoded><![CDATA[<p>In fact, due to a flaw in how SQL Server encrypts an altered procedure, decrypting the original procedure text is easy.</p>
<p>SQL Server uses the RC4 cipher algorithm to encrypt the procedure text. This algorithm generates a stream of key data (called the keystream) from a starting key, then encrypts the plaintext by using the XOR operation. The beauty of the XOR operation is that to reverse it, you simply XOR the ciphertext with the keystream.</p>
<p>Unfortunately, when you use ALTER PROCEDURE, SQL Server encrypts the new text using the same key as it did when encrypting the original text. This means it uses the same keystream. To recover the keystream when you know the ciphertext and the plaintext, you can simply XOR the ciphertext and plaintext together. You can then recover the original plaintext by XORing the recovered keystream with the original ciphertext.</p>
<p>You can find copies of scripts that do this in numerous places, for example at <a href="http://education.sqlfarms.com/education/ShowPost.aspx?PostID=783" rel="nofollow">http://education.sqlfarms.com/education/ShowPost.aspx?PostID=783</a>.</p>
<p>I&#8217;m not sure how SQL Server decides what the encryption key should be &#8211; it may be as simple as deriving a key from the procedure&#8217;s objectid.</p>
<p>SQL Server 2005&#8217;s documentation describes the result as &#8216;obfuscated text&#8217; rather than &#8216;encrypted&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EvilSoul</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-14806</link>
		<dc:creator>EvilSoul</dc:creator>
		<pubDate>Fri, 05 Oct 2007 05:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-14806</guid>
		<description>Well, in my opinion. Instead of encrypt ur stored with FULL and CLEAR code, you need have a &quot;key unlock&quot; column, and a &quot;indexed filter&quot; column. Use &quot;key column&quot; with random algorithms on &quot;indexed filter column&quot; when you do criteria thing.  Remember &quot;RANDOM&quot;.

Problem IS: how to genarate Key Col and Indx Col? Depend your decide.

Sorry about my bad English.</description>
		<content:encoded><![CDATA[<p>Well, in my opinion. Instead of encrypt ur stored with FULL and CLEAR code, you need have a &#8220;key unlock&#8221; column, and a &#8220;indexed filter&#8221; column. Use &#8220;key column&#8221; with random algorithms on &#8220;indexed filter column&#8221; when you do criteria thing.  Remember &#8220;RANDOM&#8221;.</p>
<p>Problem IS: how to genarate Key Col and Indx Col? Depend your decide.</p>
<p>Sorry about my bad English.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-14646</link>
		<dc:creator>pinaldave</dc:creator>
		<pubDate>Wed, 03 Oct 2007 00:33:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-14646</guid>
		<description>Hi EvilSoul,

Please explain what you are suggesting. I am interesting to learn.

Regards,
Pinal Dave ( http://www.SQLAuthority.com )</description>
		<content:encoded><![CDATA[<p>Hi EvilSoul,</p>
<p>Please explain what you are suggesting. I am interesting to learn.</p>
<p>Regards,<br />
Pinal Dave ( <a href="http://www.SQLAuthority.com" rel="nofollow">http://www.SQLAuthority.com</a> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EvilSoul</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-14626</link>
		<dc:creator>EvilSoul</dc:creator>
		<pubDate>Tue, 02 Oct 2007 15:04:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-14626</guid>
		<description>Answers
1) Use WITH ENCRYPTION while creating Stored Procedure or User Defined Function.
2) Sorry, unfortunately there is no simple way to decrypt the code. Hard way is too hard to even attempt.

------------------------------------------------

No2, I have a simple code for this, I&#039;m not sure about Micro$oft Security.

In fact, I&#039;ve spend alot of money for this buG.</description>
		<content:encoded><![CDATA[<p>Answers<br />
1) Use WITH ENCRYPTION while creating Stored Procedure or User Defined Function.<br />
2) Sorry, unfortunately there is no simple way to decrypt the code. Hard way is too hard to even attempt.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>No2, I have a simple code for this, I&#8217;m not sure about Micro$oft Security.</p>
<p>In fact, I&#8217;ve spend alot of money for this buG.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shobha</title>
		<link>http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-7005</link>
		<dc:creator>Shobha</dc:creator>
		<pubDate>Tue, 07 Aug 2007 11:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/07/01/sql-server-explanation-of-with-encryption-clause-for-stored-procedure-and-user-defined-functions/#comment-7005</guid>
		<description>Hi,
        I am working on SQL 2000 n 2005,Can you plz send me the major differences b/w them. And when will the cold fusion be applicable..Wat kind of scenarios</description>
		<content:encoded><![CDATA[<p>Hi,<br />
        I am working on SQL 2000 n 2005,Can you plz send me the major differences b/w them. And when will the cold fusion be applicable..Wat kind of scenarios</p>
]]></content:encoded>
	</item>
</channel>
</rss>
