Oracle provides the Wrap tool to encrypt stored procedures, and in 10g this operation can already be done in the database.
Oracle's DBMS_DDL adds a wrap function that allows you to return the encrypted process:
Sql> Select Dbms_ddl.wrap (' CREATE PROCEDURE p_wrap as begin null; end; ') from dual;
Dbms_ddl. WRAP (' Createprocedurep_wrapasbeginnull; End; ')
--------------------------------------------------------------------------------------
CREATE PROCEDURE P_wrap Wrapped
a000000
354
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
7
25 59
fpr2lh8mltoznfowf5kmdcuxdiywg5nnm7+fmr2ywfww45aw8lzpuhqrumay/tjepzmbcc0r
uihhlcmmprnznsm=
With this feature, the user does not need to execute the Wrap tool for the command line alone, and the encryption of the stored procedure can be done in the database.
Oracle also has a more convenient capability to create an encrypted procedure directly from an unencrypted stored procedure:
sql> exec dbms_ddl.create_wrapped (' CREATE PROCEDURE p_wrap as begin null; end; ')
Pl/sql procedure successfully completed.
Sql> Select text from user_source where name = ' P_wrap ' ORDER by 1;
TEXT
------------------------------------------------------------------------------------
Procedure P_wrap Wrapped
a000000
354
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
Abcd
7
25 59
fpr2lh8mltoznfowf5kmdcuxdiywg5nnm7+fmr2ywfww45aw8lzpuhqrumay/tjepzmbcc0r
uihhlcmmprnznsm=
For stored procedures that are longer than 32767, the create_wrapped process also overloads two other methods, where the user can cut a stored procedure into a 256 or 32767 string, stored in an index table, and the interface is dbms_sql. Varchar2s and Dbms_sql. VARCHAR2A.
Using create_wrapped makes it easier to create confidential stored procedures.