Oracle Database 26ai will be available on generic Linux platforms in January and soon on AIX and Windows
Purpose
Encryption, decryption, hashing, random string and numeric value generation.
The file header states the following: "... contains basic cryptographic functions and procedures. To use correctly and securely, a general level of security expertise is assumed.
VARCHAR2 datatype is not supported. Cryptographic operations on this type should be prefaced with conversions to a uniform character set (AL32UTF8) and conversion to RAW type.
Prior to encryption, hashing or keyed hashing, CLOB datatype is converted to AL32UTF8. This allows cryptographic data to be transferred and understood between databases with different character sets,
across character set changes and between separate processes (for example, Java programs)."
Our expectation here at the library is that a "general level of security expertise" does not exist in the DBA community and recommend retaining the services of a consultant
with a proven track record.
No value has been specified for the cipher suite to be used
ORA-28233
Source data was previously encrypted
ORA-28234
DES: Specified key size too short. DES keys must be at least 8 bytes (64 bits).
AES: Specified key size is not supported. AES keys must be 128, 192, or 256 bits
ORA-28239
The encryption key has not been specified or contains a NULL value
First Available
10.1
Security Model
Owned by SYS with EXECUTE granted to CTXSYS, DBSNMP and GSMADMIN_INTERNAL
Decrypt crypt text data using stream or block cipher with user supplied key and optional iv
Overload 1
dbms_crypto.decrypt(
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL)
RETURN RAW;
See Encrypt Overload 1 demo
Overload 2
dbms_crypto.decrypt(
dst IN OUT NOCOPY BLOB,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
Overload 3
dbms_crypto.decrypt (
dst IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
GCM Mode
Overload 4
dbms_crypto.decrypt (
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag IN RAW)
RETURN RAW;
TBD
GCM Mode
Overload 5
dbms_crypto.decrypt (
dst IN OUT NOCOPY BLOB,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag IN RAW);
TBD
GCM Mode
Overload 6
dbms_crypto.decrypt (
dst IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag IN RAW);
Decrypt plain text data using stream or block cipher
Overload 1
dbms_crypto.decrypt_reuse(
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL)
RETURN RAW;
TBD
Overload 2
dbms_crypto.decrypt_reuse(
dst IN OUT NOCOPY BLOB,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
Overload 3
dbms_crypto.decrypt_reuse(
dst IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
GCM Mode
Overload 4
dbms_crypto.decrypt_reuse(
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT_NULL,
tag IN RAW);
TBD
GCM Mode
Overload 5
dbms_crypto.decrypt_reuse(
dst IN OUT NOCOPY BLOB,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT_NULL,
tag IN RAW);
TBD
GCM Mode
Overload 6
dbms_crypto.decrypt_reuse(
dst IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT_NULL,
tag IN RAW);
DECLARE
enc_val RAW(2000);
l_key RAW(2000);
l_key_len NUMBER := 128/8; -- convert bits to bytes
l_mod NUMBER := dbms_crypto.ENCRYPT_AES128+dbms_crypto.CHAIN_CBC+dbms_crypto.PAD_ZERO;
BEGIN
l_key := dbms_crypto.randombytes(l_key_len);
enc_val := dbms_crypto.encrypt(utl_i18n.string_to_raw('4114-0113-1518-7114', 'AL32UTF8'), l_mod, l_key);
dbms_output.put_line(enc_val);
END;
/
set serveroutput on
DECLARE
enc_val RAW(2000);
l_key RAW(2000);
l_key_len NUMBER := 128/8; -- convert bits to bytes
l_mod NUMBER := dbms_crypto.ENCRYPT_AES128 + dbms_crypto.CHAIN_CBC + dbms_crypto.PAD_ZERO;
BEGIN
l_key := dbms_crypto.randombytes(l_key_len);
enc_val := dbms_crypto.encrypt(utl_raw.cast_to_raw(CONVERT('Morgan','AL32UTF8')), l_mod, l_key);
dbms_output.put_line(enc_val);
END;
/
Overload 2
dbms_crypto.encrypt(
dst IN OUT NOCOPY BLOB,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
Overload 3
dbms_crypto.encrypt(
dst IN OUT NOCOPY BLOB,
src IN CLOB CHARACTER SET ANY_CS,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
GCM Mode
Overload 4
dbms_crypto.encrypt(
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag OUT RAW);
TBD
GCM Mode
Overload 5
dbms_crypto.encrypt(
dst IN OUT NOCOPY BLOB,
src IN BLOB,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag OUT RAW);
TBD
GCM Mode
Overload 6
dbms_crypto.encrypt(
dst IN OUT NOCOPY BLOB,
src IN CLOB CHARACTER SET ANY_CS,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag OUT RAW);
Encrypt plain text data using stream or block cipher
Overload 1
dbms_crypto.encrypt_reuse(
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL)
RETURN RAW;
TBD
Overload 2
dbms_crypto.encrypt_reuse(
dst IN OUT NOCOPY BLOB,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
Overload 3
dbms_crypto.encrypt_reuse(
dst IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL);
TBD
GCM Mode
Overload 4
dbms_crypto.encrypt_reuse(
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag OUT RAW)
RETURN RAW;
TBD
GCM Mode
Overload 5
dbms_crypto.encrypt_reuse(
dst IN OUT NOCOPY BLOB,
src IN BLOB,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag OUT RAW);
TBD
GCM Mode
Overload 6
dbms_crypto.encrypt_reuse(
dst IN OUT NOCOPY BLOB,
src IN CLOB CHARACTER SET ANY_CS,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL,
aad IN RAW DEFAULT NULL,
tag OUT RAW);