Reputation: 201
Im trying to use DBMS_CRYPTO. From SYSTEM write:
DECLARE
l_key VARCHAR2 (2000) := '1234567890123456';
l_in_val VARCHAR2 (2000) := 'Confidential Data';
l_mod NUMBER
:= DBMS_CRYPTO.encrypt_aes128
+ DBMS_CRYPTO.chain_cbc
+ DBMS_CRYPTO.pad_pkcs5;
l_enc RAW (2000);
BEGIN
l_enc :=
DBMS_CRYPTO.encrypt (utl_i18n.string_to_raw (l_in_val, 'AL32UTF8'),
l_mod,
utl_i18n.string_to_raw (l_key, 'AL32UTF8')
);
DBMS_OUTPUT.put_line ('Encrypted=' || l_enc);
END;
Answer:
Error report -
ORA-06550: string 5, столбец 17:
PLS-00201: identifier 'DBMS_CRYPTO' must be declared
Look at select * from dba_objects where object_name = 'DBMS_CRYPTO';
answer:
I was trying to create user and give him priveleges grant execute on sys.dbms_crypto to VICE_SYS;
answer:
Error starting at line : 1 in command -
grant execute on sys.dbms_crypto to VICE_SYS
Error report -
ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
What should I do?
Upvotes: 1
Views: 2103
Reputation: 125
SQL> grant execute on sys.dbms_crypto to testuser;
Grant succeeded.
SQL> connect testuser/testuser Connected. SQL> set serveroutput on
SQL> DECLARE
l_key VARCHAR2 (2000) := '1234567890123456';
l_in_val VARCHAR2 (2000) := 'Confidential Data';
l_mod NUMBER
:= DBMS_CRYPTO.encrypt_aes128
+ DBMS_CRYPTO.chain_cbc
+ DBMS_CRYPTO.pad_pkcs5;
l_enc RAW (2000);
BEGIN
l_enc :=
DBMS_CRYPTO.encrypt (utl_i18n.string_to_raw (l_in_val, 'AL32UTF8'),
l_mod,
utl_i18n.string_to_raw (l_key, 'AL32UTF8')
);
DBMS_OUTPUT.put_line ('Encrypted=' || l_enc); END; 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 /
Encrypted=32617FCF7AB54676BEBE201360DD2C83A07A34084D30A92A9FF1F6B774240A35
Upvotes: 1