all groups > sql server programming > september 2007 >
You're in the

sql server programming

group:

Encrypty views, SP and Functions


Encrypty views, SP and Functions JCP
9/3/2007 11:44:01 PM
sql server programming:
I would like drop and re.re-create the views, sp and functions encrypted.
Is there any sp or function to do this?
Thanks
jcp

--
Re: Encrypty views, SP and Functions Erland Sommarskog
9/4/2007 12:00:00 AM
JCP (JCP@discussions.microsoft.com) writes:
[quoted text, click to view]

Beware that encryption is this context is not real encryption, only
obfustication. Anyone who is dead set to retrieve your code will so so.
If you want to protect your intellectual property, you need to get a license
agreement.

Since you consider doing this step, I assume that you have your code under
version control. If you only keep your code in the database - which is very
bad practice - and then change them to sau WITH ENCRYPTION, you will not
be able to retrieve the code, with less than researching the methods to
crack the obfustication that I discussed above.

Also keep in mind that when your procedures are encrypted, you will
experience a loss in functionality when using Profiler, and you will
not be able to view execution plans (the latter applies to SQL 2005 only).


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
RE: Encrypty views, SP and Functions ML
9/4/2007 12:42:00 AM
You'd have to add the encryption option to each script and execute it -
presuming the objects are not currently encrypted. Either way, you do keep
the scripts somewhere safe (i.e. off the server)? In the latter case you can
always edit the scripts using a text editor.


ML

---
Matija Lah, SQL Server MVP
Re: Encrypty views, SP and Functions JCP
9/4/2007 5:04:02 AM
What is it the best method to protect intellectual property?
Buying license? Buying license, nobody can access the script? Can i always
access the script?
Do you know any site that explain about protection and licenses?

Thanks.

--
Jose


[quoted text, click to view]
RE: Encrypty views, SP and Functions JCP
9/4/2007 5:06:02 AM
one by one, I know to encrypt.
I'm refering, creating a sp that drop and re-create all objects encrypted.
Is it possible?
--
Jose


[quoted text, click to view]
RE: Encrypty views, SP and Functions ML
9/4/2007 5:16:13 AM
There is no system procedure that I know of that would allow you to drop all
existing encryptable objects and re-create them using the WITH ENCRYPTION
option. You'd have to create one yourself.

On the other hand, as Erland suggested in his post, the built-in encryption
method isn't unbreakable. You should protect your intellectual property with
a contract between your and your customer(s). For this you should be familiar
with the intellectual property laws valid in your country and the countries
of your customers. In other words: hire a lawyer with appropriate expertise.


ML

---
Matija Lah, SQL Server MVP
Re: Encrypty views, SP and Functions Erland Sommarskog
9/4/2007 10:30:34 PM
JCP (JCP@discussions.microsoft.com) writes:
[quoted text, click to view]

A license is an agreement that the customer is supposed to follow.

You can add various technical tweaks to your application in order to
enforce the license, but without a license, there is nothing your
customer can break.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button