Oracle MGWI_CRYPTO
Version 21c

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
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
Subprograms
 
DECRYPT_10G
Undocumented mgwi_crypto.decrypt_10g(
src IN VARCHAR2,
key IN VARCHAR2)
RETURN VARCHAR2;
TBD
 
DECRYPT_11G
Undocumented mgwi_crypto.decrypt_11g(
src IN RAW,
key IN RAW)
RETURN RAW;
TBD
 
DECRYPT_STR_10G
Undocumented 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
 
DECRYPT_STR_11G
Undocumented 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
 
ENCRYPT_10G
Undocumented mgwi_crypto.encrypt_10g(
src IN VARCHAR2,
key IN VARCHAR2)
RETURN VARCHAR2;
TBD
 
ENCRYPT_11G
Undocumented mgwi_crypto.encrypt_11g(
src IN RAW,
key IN RAW)
RETURN RAW;
TBD
 
ENCRYPT_STR_10G
Undocumented mgwi_crypto.encrypt_str_10g(src IN VARCHAR2) RETURN VARCHAR2;
SELECT mgwi_crypto.encrypt_str_10g('N0wAy1n0r0u$')
FROM dual;

ERROR:
ORA-29275: partial multibyte character


SELECT mgwi_crypto.encrypt_str_10g('N0wAy1n0r0ut')
FROM dual;

MGWI_CRYPTO.ENCRYPT_STR_10G('N0WAY1N0R0UT')
--------------------------------------------
┐6n┐1d┐┐┐┐↑U^1
 
ENCRYPT_STR_11G
Undocumented mgwi_crypto.encrypt_str_11g(src IN VARCHAR2) RETURN RAW;
SELECT mgwi_crypto.encrypt_str_11g('N0wAy1n0r0u$')
FROM dual;

MGWI_CRYPTO.ENCRYPT_STR_11G('N0WAY1N0R0U$')
--------------------------------------------
777F1B89C492A55FC4C0C9B6FA146BA9
 
MIGENC_10G_TO_11G
Undocumented 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
 
MIGENC_110G_TO_10G
Undocumented 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

Related Topics
Built-in Functions
Built-in Packages
Database Security
MGWI_ADMIN
MGWI_CONST
MGWI_REG
What's New In 19c
What's New In 20c-21c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2021 Daniel A. Morgan All Rights Reserved
  DBSecWorx