Obfuscated source code for SQL routines and triggers

Db2 12 introduces a method for protecting the encapsulated logic in SQL stored procedures, SQL functions, and triggers. In obfuscated data definition statements for SQL procedures, SQL functions, and triggers, the SQL logic is rendered unreadable, enabling the delivery of SQL routines and triggers without sharing the intellectual property of the SQL PL logic.

The data definition statements for routines and triggers can execute in obfuscated form. In obfuscated statements, only the name of the routine or trigger, the parameters, and the WRAPPED keyword are readable. The rest of the statement is encoded in such a way that it is not readable but can be decoded by a database server that supports obfuscated statements.

You can use the WRAP built-in function to create the obfuscated form of the data definition statements for SQL procedures, SQL functions, routines, and triggers. The CREATE_WRAPPED stored procedure also supports the deployment of obfuscated routines and functions by calling the WRAP built-in function.

Important: The obfuscation algorithm is not strong encryption, and it is not meant for use in security contexts.