14 March 2007

Establishing Source Code Security With WRAP In Oracle

In Oracle you can wrap your source code, packages, functions e.g., with built-in wrap utility. Securing source code is an important responsibility for enterprise projects. It is possible to compile a wrapped package. It can not possible to see a wrapped source code with selecting all_source view or using dbms_metada built-in package.

Below i demonstrate how can wrap function with wrap utility:



create or replace function get_day( pid_Date in date ) return varchar2 is
begin

  ---For debug, conditional compilation
  $if $$debug = true $then
    dbms_output.put_line(
'INFO@get_day>Date is ' || pid_Date );
  $end
  ---

  return to_char(pid_Date, 'DAY');
end;
/

Call WRAP Utility:


C:\oraclexe\app\oracle\product\10.2.0\server\BIN>wrap iname=get_day.fnc
PL/SQL Wrapper: Release 10.2.0.1.0- Production on Pzt Oca 01 16:44:07 2007
Copyright (c) 1993, 2004, Oracle.  All rights reserved.
Processing get_day.fnc to get_day.plb
C:\oraclexe\app\oracle\product\10.2.0\server\BIN>



Content Of WRAPPED function is

create or replace function get_day wrapped
a000000
b1
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
8
d1 fb
S0SAZ1gHfv1nRx6IXc3IMDoPw0Ewg+lKNZmsZy8C2vjVGTg4lFGE6j4Jv3cCqwETsnti5tOQ
TtPOhrqM54t/KIt/uwoA6uDaYITTWVIus7q28C9WhgOCV9O7BJwVXHnuYUvBGhrUwPGmUok7
a4lrJXi0NW5JFt70hr18Qyl2e5btnC7DV6PojoPAVaS5ho5IavYgQN7bhr3wQvn+FzqbE7RW
YswPnikV5vf5wPZ9hTsLe2BOPf0KTiFp

/

No comments: