How to Resolve ORA-28232: invalid input length for obfuscation toolkit

  • by

ORA-28232

Developers tried to obfuscate data by DBMS_OBFUSCATION_TOOLKIT in a database with multi-byte character set and got this error.

ORA-28232: invalid input length for obfuscation toolkit
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT_FFI", line 59
ORA-06512: at "SYS.DBMS_OBFUSCATION_TOOLKIT", line 190
...

Since in multi-byte character set, such as AL32UTF8 or UTF8, each character may take 1 to 4 bytes. The input string may or may not be a multiple of 8 bytes.

Solution

We can change NLS_LENGTH_SEMANTICS from CHAR into BYTE temporarily or permanently like the following to work around ORA-28232.

SQL> alter system set nls_length_semantics=BYTE scope=both;

For RAC database:

SQL> alter system set nls_length_semantics=BYTE scope=both sid='*';

Leave a Reply

Your email address will not be published. Required fields are marked *