ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
Purpose
Messaging Gateway Cryptography Utilities. Based on subprogram names this package is likely deprecated.
Note that this package does not have dependencies on
DBMS_OBFUSCATION_TOOLKIT and DBMS_OBFUSCATION_TOOLKIT_FFI but some of the
demos below generate exceptions because these objects are desupported in
database version 21c.
AUTHID
DEFINER
Dependencies
DBMS_CRYPTO
MGW$_GATEWAY
UTL_I18N
DBMS_MGWADM
MGWI_ADMIN
UTL_RAW
DBMS_SYS_ERROR
MGWI_MSGLINK
Documented
No
First Available
Not known
Security Model
Owned by SYS with EXECUTE granted to the MGW_AGENT_ROLE role.
Source
{ORACLE_HOME}/rdbms/admin/mgwicry.plb
SQL> @?/mgw/admin/mgwicry.plb
SP2-0808: Package created with compilation warnings
Grant succeeded.
SQL> sho err
Errors for PACKAGE MGWI_CRYPTO:
LINE/COL ERROR
------------------------------------------------------------------------
1/1 PLW-05018: unit MGWI_CRYPTO omitted optional AUTHID clause;
default value DEFINER used
12/37 PLW-06010: keyword "KEY" used as a defined name
18/37 PLW-06010: keyword "KEY" used as a defined name
27/5 PLW-06010: keyword "KEY" used as a defined name
36/5 PLW-06010: keyword "KEY" used as a defined name
SQL> @?/mgw/admin/mgwicryb.plb
SP2-0810: Package Body created with compilation warnings
SQL> sho err
Errors for PACKAGE BODY MGWI_CRYPTO:
LINE/COL ERROR
------------------------------------------------------------------------
105/37 PLW-06010: keyword "KEY" used as a defined name
135/37 PLW-06010: keyword "KEY" used as a defined name
219/5 PLW-06010: keyword "KEY" used as a defined name
278/5 PLW-06010: keyword "KEY" used as a defined name
mgwi_crypto.decrypt_str_10g(src IN VARCHAR2) RETURN VARCHAR2;
SELECT mgwi_crypto.decrypt_str_10g('Pass123')
FROM dual;
SELECT mgwi_crypto.decrypt_str_10g('Pass123')
*
ERROR at line 1:
ORA-28232: invalid input length for obfuscation toolkit
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT_FFI", line 84
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT", line 255
ORA-06512: at "SYS.MGWI_CRYPTO", line 283
ORA-06512: at "SYS.MGWI_CRYPTO", line 260
mgwi_crypto.decrypt_str_11g(src IN RAW) RETURN VARCHAR2;
SELECT mgwi_crypto.decrypt_str_11g(utl_raw.cast_to_raw('Password123'))
FROM dual;
SELECT mgwi_crypto.decrypt_str_11g(utl_raw.cast_to_raw('Password123'))
*
ERROR at line 1:
ORA-28817: PL/SQL function returned an error.
ORA-06512: at "SYS.DBMS_CRYPTO_FFI", line 67
ORA-06512: at "SYS.DBMS_CRYPTO", line 44
ORA-06512: at "SYS.MGWI_CRYPTO", line 140
ORA-06512: at "SYS.MGWI_CRYPTO", line 124
mgwi_crypto.migenc_10g_to_11g(encdata IN VARCHAR2) RETURN RAW;
SELECT mgwi_crypto.migenc_10g_to_11g('Pass123')
FROM dual;
SELECT mgwi_crypto.migenc_10g_to_11g('Pass123')
*
ERROR at line 1:
ORA-28232: invalid input length for obfuscation toolkit
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT_FFI", line 84
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT", line 255
ORA-06512: at "SYS.MGWI_CRYPTO", line 283
ORA-06512: at "SYS.MGWI_CRYPTO", line 260
ORA-06512: at "SYS.MGWI_CRYPTO", line 58
mgwi_crypto.migenc_11g_to_10g(encdata IN RAW) RETURN VARCHAR2;
SELECT mgwi_crypto.migenc_11g_to_10g('777F1B89C492A55FC4C0C9B6FA146BA9')
FROM dual;
ERROR:
ORA-29275: partial multibyte character
SELECT mgwi_crypto.migenc_11g_to_10g(utl_raw.cast_to_raw('Password123'))
FROM dual;
SELECT mgwi_crypto.migenc_11g_to_10g(utl_raw.cast_to_raw('Password123'))
*
ERROR at line 1:
ORA-28817: PL/SQL function returned an error.
ORA-06512: at "SYS.DBMS_CRYPTO_FFI", line 67
ORA-06512: at "SYS.DBMS_CRYPTO", line 44
ORA-06512: at "SYS.MGWI_CRYPTO", line 140
ORA-06512: at "SYS.MGWI_CRYPTO", line 124
ORA-06512: at "SYS.MGWI_CRYPTO", line 79