DBMS_CRYPTO.RANDOMBYTES Generating Values Double The Expected Length

(Doc ID 1351654.1)

Last updated on AUGUST 24, 2011

Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.2.0.1 - Release: 10.2 to 11.2
Information in this document applies to any platform.

Symptoms

When the dbms_crypto.randombytes package is used to generate a random sequence of bytes the returned result appears to be double the length specified.

For example,


SQL> select lengthb(dbms_crypto.randombytes(128)) from dual;

LENGTHB(DBMS_CRYPTO.RANDOMBYTES(128))
-------------------------------------
256

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms