Table of Contents Previous Next


4 EDB*Wrap : 4.1 Using EDB*Wrap to Obfuscate Source Code

EDB*Wrap is a command line utility; it accepts a single input source file, obfuscates the contents and returns a single output file. When you invoke the edbwrap utility, you must provide the name of the file that contains the source code to obfuscate. You may also specify the name of the file where edbwrap will write the obfuscated form of the code. edbwrap offers three different command-line styles. The first style is compatible with Oracle's wrap utility:
edbwrap iname=input_file [oname=output_file]
The iname=input_file argument specifies the name of the input file; if input_file does not contain an extension, edbwrap will search for a file named input_file.sql
The oname=output_file argument (which is optional) specifies the name of the output file; if output_file does not contain an extension, edbwrap will append .plb to the name.
If you do not specify an output file name, edbwrap writes to a file whose name is derived from the input file name: edbwrap strips the suffix (typically .sql) from the input file name and adds .plb.
edbwrap offers two other command-line styles that may feel more familiar:
edbwrap --iname input_file [--oname output_file]
edbwrap -i input_file [-o output_file]
Once edbwrap has produced a file that contains obfuscated code, you typically feed that file into the PostgreSQL server using a client application such as edb-psql. The server executes the obfuscated code line by line and stores the source code for SPL and PL/pgSQL programs in wrapped form.
First, create the source code for the list_emp procedure (in plaintext form):
You can import the list_emp procedure with a client application such as edb-psql:
When you use pg_dump to back up a database, wrapped programs remain obfuscated in the archive file.
CREATE [OR REPLACE] TYPE type_name AS OBJECT
CREATE [OR REPLACE] TYPE type_name UNDER type_name

4 EDB*Wrap : 4.1 Using EDB*Wrap to Obfuscate Source Code

Table of Contents Previous Next