Oracle Wrap Utility

Oracle wrap is great utility to encrypt your code. Now what is the use of it. For ex.

  • If you want to stop misuse of your application.
  • To prevent business competitor to view you code.

Now let see how it works. For ex. You source code is in wrap_test.sql file. Now to wrap the file open command prompt and go to bin directory where oracle is installed. Now type the following command to wrap the file
wrap iname=<input file path>

You can also provide the output file name as
wrap iname=<input file path> oname=<output file name>

If output file name is not mentioned then the wrapped file will be created in the BIN directory itself as .plb file.

Example:-

wrap_test.sql

   1: CREATE OR REPLACE PROCEDURE WRAP_TEST AS 

   2: BEGIN 

   3:     DBMS_OUTPUT.PUT_LINE('Wrap test'); 

   4: END WRAP_TEST;

   5: /

Now let’s wrap the file using

wrap iname=c:\wrap\wrap_test.sql:\wrap\wrap_output.plb

The output of the wrap_output.plb will be like this

   1: CREATE OR REPLACE PROCEDURE WRAP_TEST wrapped

   2: a000000

   3: b2

   4: abcd

   5: abcd

   6: abcd

   7: abcd

   8: abcd

   9: abcd

  10: abcd

  11: abcd

  12: abcd

  13: abcd

  14: abcd

  15: abcd

  16: abcd

  17: abcd

  18: abcd

  19: 7

  20: 50 85

  21: PoUhHFlQcv41YBQpQeympJ9Dfgowg5nnm7+fMr2ywFznKMB04yhSssvMuHSLwMAy/tKGBvVS

  22: m7JK/iiyveeysx0GMCyuJOqygaVR2+EC8XcG0zIu9tHqJB9GK/Y5pl8zb8k=

  23: /

You can use the wrap code using normal import/export utility. And it is platform independent. But it’s upward compatible (Ex:- code wrapped in Oracle 8i will work 9i but not vice-verse).

Warning : Think twice before you do the wrap. You can’t un-wrap the wrapped code. So take the backup before you go ahead.

Note:- This wrap utility only wrap oracle related codes for ex:- function, procedure, package etc. It can not wrap any other format or flat file.

Oracle documentation for wrap utility is here.

Advertisements

Published by

Anirban

I am software engineer by profession. Sometimes i post some topics about technology and some other topics which i find out interesting. My hobbies include watching movies,music, reading books(both technical and story books(fiction only)).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s