question

FarazTaha-2049 avatar image
0 Votes"
FarazTaha-2049 asked ErlandSommarskog answered

Storeprocedure Encryption

Hi All,
I want to do store procedure encryption with password, basically want to hide the logic behind the procedures...

  • With Encryption (can easily decrypted by db forge decryptor I tried my self).

  • Procedure Locking will not work as well if it will be on client premises. or any other dbAdmin thngs.

Is there any way around for Procedure encryption with password or any other type of decryption.

sql-server-generalsql-server-transact-sql
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OlafHelper-2800 avatar image
0 Votes"
OlafHelper-2800 answered

No, there is no other way then using SQL Server encryption as build-in function for T-SQL.

An option could be using .NET CLR assembly, but that means a lot of work and plain T-SQL is more performant.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered

If you want to hide the logic in the procedure, you need to avoid that users get permission to read the procedure code. To do this, you cannot permit installation at a customer site, but you need to host the procedure yourself, for instance in Azure SQL DB.

To be able to execute the stored procedure, SQL Server needs to read the code for the procedure. So if the procedure would be encrypted, SQL Server must be able to decrypt it. But if the decryption key is present on the machine, anyone with sufficient permission can access that key. So that is why the feature cannot be implemented.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.