欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

oracle加密procedure的方法

程序员文章站 2022-06-16 15:05:58
对于oracle object的方式 一、利用wrap加密 如下是一个测试的procedure: [oracle@orclrac1:/home/oracle]$cat sp_test.sql cre...

对于oracle object的方式

一、利用wrap加密

如下是一个测试的procedure:

[oracle@orclrac1:/home/oracle]$cat sp_test.sql

create or replace procedure leo(i in number)

as

begin

dbms_output.put_line('input parameter: '||to_char(i));

end;

如下是加密过程:

[oracle@orclrac1:/home/oracle]$wrap iname=sp_test.sql oname=sp_test_jm.sql

pl/sql wrapper: release 11.2.0.1.0- 64bit production on wed nov 08 14:06:58 2017

copyright (c) 1993, 2009, oracle. all rights reserved.

processing sp_test.sql to sp_test_jm.sql

如下是加密完成之后的显示内容:

[oracle@orclrac1:/home/oracle]$cat sp_test_jm.sql

create or replace procedure leo wrapped

a000000

354

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

7

6b ae

elucok2tpht0oy+wjvsukea9+fuwg5nnm7+fmr2ywfyfodexpcol0l6lmyeywlilxqbadisg

wmay/tkgbgmm+x9jmo8wtvdiqvavampk/gjsxz1pckfvfmlmflpw8kcuyqfiwglpzca9cnc/

m7h0jav3d6clbscbx/vxdka1unzi

/

对存储过程做编译,并可顺利执行:

[oracle@orclrac1:/home/oracle]$sqlplus zq/oracle

sql*plus: release 11.2.0.1.0 production on wed nov 8 14:07:03 2017

copyright (c) 1982, 2009, oracle. all rights reserved.

connected to:

oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production

with the partitioning, real application clusters, automatic storage management, olap,

data mining and real application testing options

sql> @sp_test_jm.sql

procedure created.

sql> set serveroutput on;

sql> exec leo(100);

input parameter: 100

pl/sql procedure successfully completed.

查看oracle的数据字典中的显示:

sql> select name,text from user_source where type='procedure' and name='leo';

name

----

text

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

leo

procedure leo wrapped

a000000

354

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

abcd

7

6b ae

elucok2tpht0oy+wjvsukea9+fuwg5nnm7+fmr2ywfyfodexpcol0l6lmyeywlilxqbadisg

wmay/tkgbgmm+x9jmo8wtvdiqvavampk/gjsxz1pckfvfmlmflpw8kcuyqfiwglpzca9cnc/

m7h0jav3d6clbscbx/vxdka1unzi