Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBMS_CRYPTO package help needed :(

518258Apr 18 2007 — edited Apr 18 2007
Hello all,
I want to use Oracle's DBMS_CRYPTO package for decrypting some data.
I have one sample program as follows which is not working....the error is shown below.
--------------------------------
SQL> DECLARE
2 input_string VARCHAR2 (200) := 'Secret Message';
3 output_string VARCHAR2 (200);
4 encrypted_raw RAW (2000); -- stores encrypted binary text
5 decrypted_raw RAW (2000); -- stores decrypted binary text
6 num_key_bytes NUMBER := 256/8; -- key length 256 bits (32 bytes)
7 key_bytes_raw RAW (32); -- stores 256-bit encryption key
8 encryption_type PLS_INTEGER := -- total encryption type
9 DBMS_CRYPTO.ENCRYPT_AES256
10 + DBMS_CRYPTO.CHAIN_CBC
11 + DBMS_CRYPTO.PAD_PKCS5;
12 BEGIN
13 DBMS_OUTPUT.PUT_LINE ( 'Original string: ' || input_string);
14 key_bytes_raw := DBMS_CRYPTO.RANDOMBYTES (num_key_bytes);
15 encrypted_raw := DBMS_CRYPTO.ENCRYPT
16 (
17 src => UTL_I18N.STRING_TO_RAW (input_string, 'AL32UTF8'),
18 typ => encryption_type,
19 KEY => key_bytes_raw
20 );
21 decrypted_raw := DBMS_CRYPTO.DECRYPT
22 (
23 src => encrypted_raw,
24 typ => encryption_type,
25 KEY => key_bytes_raw
26 );
27 output_string := UTL_I18N.RAW_TO_CHAR (decrypted_raw, 'AL32UTF8');
28 DBMS_OUTPUT.PUT_LINE ('Decrypted string: ' || output_string);
29 END;
30 /
DBMS_CRYPTO.ENCRYPT_AES256
*
ERROR at line 9:
ORA-06550: line 9, column 2:
PLS-00201: identifier 'DBMS_CRYPTO' must be declared
ORA-06550: line 8, column 23:
PL/SQL: Item ignored
ORA-06550: line 14, column 21:
PLS-00201: identifier 'DBMS_CRYPTO' must be declared
ORA-06550: line 14, column 4:
PL/SQL: Statement ignored
ORA-06550: line 15, column 21:
PLS-00201: identifier 'DBMS_CRYPTO' must be declared
ORA-06550: line 15, column 4:
PL/SQL: Statement ignored
ORA-06550: line 21, column 18:
PLS-00201: identifier 'DBMS_CRYPTO' must be declared
ORA-06550: line 21, column 1:
PL/SQL: Statement ignored


Oracle version is
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production on linux server.

can anybody help me how to resolve this problem?
I mean isnt "DBMS_CRYPTO" Oracle's Standard package?

pls help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2007
Added on Apr 18 2007
4 comments
593 views