Tuesday, April 9, 2013

Wraping (encrypting) a PL/SQL code

Wrapping oracle PL/SQL Code with the wrap Utility:

The wrap utility processes an input SQL file and obfuscates only the PL/SQL units in the file,
such as a package specification, package body, function, procedure, type specification, or type body.

It does not obfuscate PL/SQL content in anonymous blocks or triggers or non-PL/SQL code.
To run the wrap utility, enter the wrap command at your operating system prompt using the following syntax:
         wrap iname=input_file [oname=output_file]
Do not use any spaces around the equal signs.
Example:

1.      Write a procedure abc(), in a file abc.sql (do not compile it in database) and save it in C:\
create procedure abc is
begin
dbms_output.put_line('Hello World');
end abc;
2.      First generate the wrapped code for this sql file using the following command.
     wrap iname=C:\abc.sql
You will get the following message:

      PL/SQL Wrapper: Release 9.0.1.3.1- Production on Sat Jun 04 12:59:59  2011
Copyright (c) Oracle Corporation 1993, 2001.  All Rights Reserved.
Processing C:\abc.sql to abc.plb


3.      The wrapped file code abc.plb is created in the same directory (C:\abc.sql). It will look like this


C:\oracle11\product\11.2.0\dbhome_1\BIN\wrap.exe iname=C:\temp\XX\xx_proc_new.sql

No comments:

Post a Comment