Home

DBMS_OBFUSCATION_TOOLKIT package is removed

Description

    Starting with Oracle Database 21c, the DBMS_OBFUSCATION_TOOLKIT package is completely removed. Any references to this package will result in compilation or runtime errors.

    This package was deprecated in earlier versions and has been replaced by the more secure and feature-rich DBMS_CRYPTO package.

    To ensure forward compatibility and improved security, update all legacy code to use DBMS_CRYPTO for encryption and decryption operations.

Key Benefits

  • Compatibility: Ensures your code runs on Oracle 21c and future versions where DBMS_OBFUSCATION_TOOLKIT is no longer available.
  • Security: Improves cryptographic strength by replacing obsolete algorithms with those supported by DBMS_CRYPTO.
  • Maintainability: Aligns your application with modern, documented Oracle encryption standards.

 

Non-compliant Code Example

DECLARE
  encrypted_val VARCHAR2(200);
BEGIN
  encrypted_val := DBMS_OBFUSCATION_TOOLKIT.DESENCRYPT(     --Non compliant code (DBMS_OBFUSCATION_TOOLKIT package is removed)
                     input_string => 'MySecretData',
                     key_string   => 'mykey123');
  DBMS_OUTPUT.PUT_LINE(encrypted_val);
END;

Compliant Code Example

DECLARE
  encrypted_val RAW(2000);
BEGIN
  encrypted_val := DBMS_CRYPTO.ENCRYPT(                             --Compliant code 
                     src => UTL_I18N.STRING_TO_RAW('MySecretData', 'AL32UTF8'),
                     typ => DBMS_CRYPTO.ENCRYPT_DES + DBMS_CRYPTO.CHAIN_CBC + DBMS_CRYPTO.PAD_PKCS5,
                     key => UTL_I18N.STRING_TO_RAW('mykey123', 'AL32UTF8'));
  DBMS_OUTPUT.PUT_LINE(RAWTOHEX(encrypted_val));
END;
Visual Expert 2025
 VEPLSQLRULE209