Storeprocedure Encryption

Faraz Taha 1 Reputation point
2021-07-23T06:51:54.057+00:00

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.

Developer technologies Transact-SQL
SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2021-07-23T07:57:04.697+00:00

    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.

    0 comments No comments

  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2021-07-23T08:28:26.47+00:00

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.