3

I am looking into ways to encrypt mySQL stored procedure source code when installed in clients local environment.

I did lot of research on this topic and had no luck except for one promising reply from gazzang.com

Here is the reply from gazzang. Let me know if someone has already tried this out.

We should be able to encrypt the table where store procs and functions are stored - mysql.proc Thus os users won't be able to read the contents of the sp or functions. I can't remember which internal table views are stored in but the same some apply to them. I am not sure we could come up with a solution to encrypt the routines internal to mysql. Other databases that do this really implement "obfuscation" internally - I think PostgreSQL does that for example.

Ali
  • 31
  • 3
  • 1
    @Pekka: your dupe suggestion is sql-server, this is MySQL. I don't think the syntax, parameters and inner workings are the same (especially for stuff like stored procs). – Konerak May 02 '11 at 14:29
  • @Konerak you're right - my mistake. – Pekka May 02 '11 at 14:35
  • A better one:[Can stored procedure in MySql 5.0.x be encrypted?](http://stackoverflow.com/q/501122) – Pekka May 02 '11 at 14:35
  • possible duplicate of [Can stored procedure in MySql 5.0.x be encrypted?](http://stackoverflow.com/questions/501122/can-stored-procedure-in-mysql-5-0-x-be-encrypted) – Vladislav Rastrusny May 02 '11 at 15:10
  • see also: http://stackoverflow.com/questions/83419/stored-procedures-a-no-go-in-the-php-mysql-world – markus May 02 '11 at 15:12

1 Answers1

1

You cannot encrypt stored procedures in a really useful way, because MySQL server will have to decrypt it anyway when it reads stored procedure from it's tables. If you encrypt the table file, your customer will login as root and make dump on mysql.proc table using native MySQL statements. If you change root password, they will always have a way to start MySQL with --skip-grant-tables switch to overcome that.

Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
  • Is there any other means of encrypting mySql stored procedures in current version? – Ali May 02 '11 at 18:47