ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使用Oracle Wrap工具加密你的代码(转)

使用Oracle Wrap工具加密你的代码(转)

原创 Linux操作系统 作者:jcszjswkzhou 时间:2019-01-08 11:27:07 0 删除 编辑
Oracle提供Wrap工具可以用于加密你的Package等.
不过需要注意的是加密后的代码无法解密你需要保管好你的源代码

以下是个例子:

1.源代码

create or replace function get_rowid(l_rowid in varchar2)return varchar2isls_my_rowid varchar2(200); rowid_type number; object_number number; relative_fno number; block_number number; row_number number; begin dbms_rowid.rowid_info(l_rowid,rowid_type,object_number,relative_fno, block_number, row_number); ls_my_rowid := 'Object# is :'||to_char(object_number)||chr(10)|| 'Relative_fno is :'||to_char(relative_fno)||chr(10)|| 'Block number is :'||to_char(block_number)||chr(10)|| 'Row number is :'||to_char(row_number); return ls_my_rowid ;end; /



2.代码功能测试



[oracle@jumper tools]$ sqlplus scott/tigerSQL*Plus: Release 9.2.0.4.0 - Production on Mon Nov 15 21:56:36 2004Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.Connected to:Oracle9i Enterprise Edition Release 9.2.0.4.0 - ProductionWith the Partitioning optionJServer Release 9.2.0.4.0 - ProductionSQL> @f_get_rowidFunction created.SQL> select rowid from dept where deptno=10;ROWID------------------AAABiPAABAAAFRSAAASQL> select get_rowid('AAABiPAABAAAFRSAAA') from dual; GET_ROWID('AAABIPAABAAAFRSAAA')------------------------------------------------------------------Object# is :6287Relative_fno is :1Block number is :21586Row number is :0SQL> ![oracle@jumper tools]$ lsct.sql ddlt.sql f_get_rowid.sql getevent.sql

3.使用wrap加密及加密后的代码



[oracle@jumper tools]$ wrap iname=f_get_rowid.sql oname=f_get_rowid.plbPL/SQL Wrapper: Release 9.2.0.4.0- Production on Mon Nov 15 21:59:39 2004Copyright (c) Oracle Corporation 1993, 2001. All Rights Reserved.Processing f_get_rowid.sql to f_get_rowid.plb [oracle@jumper tools]$ cat f_get_rowid.plb create or replace function get_rowid wrapped 0abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd389200000140 172 :e:1FUNCTION:1GET_ROWID:1L_ROWID:1VARCHAR2:1RETURN:1LS_MY_ROWID:1200:1ROWID_TYPE:1NUMBER:1OBJECT_NUMBER:1RELATIVE_FNO:1BLOCK_NUMBER:1ROW_NUMBER:1DBMS_ROWID:1ROWID_INFO:1Object# is :::1||:1TO_CHAR:1CHR:110:1Relative_fno is :::1Block number is :::1Row number is :::0008320 a0 8d 8f a0 b0 3d b4:2 a0 2c 6a a3 a0 51 a5 1c81 b0 a3 a0 1c 81 b0 a3a0 1c 81 b0 a3 a0 1c 81b0 a3 a0 1c 81 b0 a3 a01c 81 b0 :2 a0 6b :6 a0 a5 57a0 6e 7e :2 a0 a5 b b4 2e7e a0 51 a5 b b4 2e 7e6e b4 2e 7e :2 a0 a5 b b42e 7e a0 51 a5 b b4 2e7e 6e b4 2e 7e :2 a0 a5 bb4 2e 7e a0 51 a5 b b42e 7e 6e b4 2e 7e :2 a0 a5b b4 2e d :2 a0 65 b7 a4b1 11 68 4f 1d 17 b5 8320 3 7 23 1f 1e 2b 1b30 34 38 3c 59 44 48 4b4c 54 43 75 64 68 70 408d 7c 80 88 63 a9 98 9ca4 60 c1 b0 b4 bc 97 ddcc d0 d8 94 c8 e4 e8 ebef f3 f7 fb ff 103 104 10910d 112 115 119 11d 11e 120 121126 129 12d 130 131 133 134 13913c 141 142 147 14a 14e 152 153155 156 15b 15e 162 165 166 168169 16e 171 176 177 17c 17f 183187 188 18a 18b 190 193 197 19a19b 19d 19e 1a3 1a6 1ab 1ac 1b11b4 1b8 1bc 1bd 1bf 1c0 1c5 1c91cd 1d1 1d5 1d7 1db 1dd 1e9 1ed1ef 1f0 1f9 8320 1 a 2 d :2 2 :2 1 8:3 1 e 17 16 :2 e :2 1 :3 d :2 1:3 10 :2 1 :3 f :2 1 :3 f :2 1 :3 d 12 :2 d 18 20 2b 39 47 55:3 2 11 24 26 2e :2 26 :2 11 3c3e 42 :2 3e :2 11 45 3 :2 11 1618 20 :2 18 :2 11 2d 2f 33 :2 2f:2 11 36 3 :2 11 16 18 20 :2 18:2 11 2d 2f 33 :2 2f :2 11 36 3:2 11 16 18 20 :2 18 :2 11 :2 2 92 :9 1 8340 :2 1 :5 2 :2 3:2 1 :7 5 :5 6 :5 7:5 8 :5 9 :5 a :b c:11 d e :2 d :5 e:2 d :5 e :2 d ef :2 d :5 f :2 d:5 f :2 d f 10:2 d :5 10 :3 d :3 11:2 b :7 1 1fb4:3 0 1 :3 0 2:a 0 7e 1 :7 05 :2 0 3 4:3 0 3 :7 0 54 :3 0 5 :3 04 :3 0 7 90 7e 2 a:2 0 b 60 09 4 :3 0 7:2 0 7 d f:6 0 12 10 07c 0 6 :6 0f 94 0 d9 :3 0 14 :7 017 15 0 7c0 8 :6 0 9:3 0 19 :7 0 1c1a 0 7c 0a :6 0 13 c80 11 9 :3 01e :7 0 21 1f0 7c 0 b:6 0 9 :3 0 23:7 0 26 24 07c 0 c :6 0e :3 0 9 :3 028 :7 0 2b 290 7c 0 d:6 0 f :3 0 2c2d 0 3 :3 08 :3 0 a :3 0b :3 0 c :3 0d :3 0 15 2e35 :2 0 7a 6:3 0 10 :4 0 11:2 0 12 :3 0 a:3 0 1c 3a 3c1e 39 3e :3 011 :2 0 13 :3 014 :2 0 21 4143 23 40 45:3 0 11 :2 0 15:4 0 26 47 49:3 0 11 :2 0 12:3 0 b :3 0 294c 4e 2b 4b50 :3 0 11 :2 013 :3 0 14 :2 02e 53 55 3052 57 :3 0 11:2 0 16 :4 0 3359 5b :3 0 11:2 0 12 :3 0 c:3 0 36 5e 6038 5d 62 :3 011 :2 0 13 :3 014 :2 0 3b 6567 3d 64 69:3 0 11 :2 0 17:4 0 40 6b 6d:3 0 11 :2 0 12:3 0 d :3 0 4370 72 45 6f74 :3 0 37 750 7a 5 :3 06 :3 0 78 :2 07a 48 7d :3 07d 4c 7d 7c7a 7b :6 0 7e:2 0 2 a 7d81 :3 0 80 7e82 :8 0 534:3 0 1 3 16 1 e 1c 1 13 118 1 1d 122 1 27 62f 30 31 3233 34 1 3b2 38 3d 142 2 3f 442 46 48 14d 2 4a 4f1 54 2 5156 2 58 5a1 5f 2 5c61 1 66 263 68 2 6a6c 1 71 26e 73 3 3676 79 6 1116 1b 20 252a 140 810114180 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 3 1 022 1 02 0 1c 1 013 1 027 1 018 1 01d 1 00/

4.测试加密后的代码



[oracle@jumper tools]$ exitexitSQL> drop function get_rowid;Function dropped.SQL> @f_get_rowid.plbFunction created.SQL> select get_rowid('AAABiPAABAAAFRSAAA') from dual;GET_ROWID('AAABIPAABAAAFRSAAA')-----------------------------------------------------------------Object# is :6287Relative_fno is :1Block number is :21586Row number is :0SQL>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10294527/viewspace-122326/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-08-29

  • 博文量
    3488
  • 访问量
    2621607