DESDecrypt Procedure

The purpose of the DESDecrypt procedure is to generate the decrypted form of the input data. An example of the DESDecrypt procedure appears at the end of this chapter.

Parameters

Table 30-3 and Table 30-4 list the parameters for the DESDecrypt syntax, their modes, types, and descriptions.

Table 30-3 DESDecrypt parameters for raw data

Parameter Name

Mode

Type

Description

input

IN

RAW

Data to be decrypted

key

IN

RAW

Decryption key

decrypted_data

OUT

RAW

Decrypted data

Table 30-4 DESDecrypt parameters for string data

Parameter Name

Mode

Type

Description

input_string

IN

VARCHAR2

String to be decrypted

key_string

IN

VARCHAR2

Decryption key string

decrypted_string

OUT

VARCHAR2

Decrypted string

If the input data or key given to the PL/SQL DESDecrypt function is empty, then Oracle raises ORA error 28231 "Invalid input to Obfuscation toolkit".

If the input data given to the DESDecrypt function is not a multiple of 8 bytes, Oracle raises ORA error 28232 "Invalid input size for Obfuscation toolkit".

If the key length is missing or is less than 8 bytes, then the procedure raises the error ORA-28234 "Key length too short." Note that if larger keys are used, extra bytes are ignored. So a 9-byte key will not generate an exception.

Note:

ORA-28233 is not applicable to the DESDecrypt function.

Restrictions

The DES key length for encryption is fixed at 64 bits (of which 56 bits are used); you cannot alter this key length.

Note:

The key length limitation is a requirement of U.S. regulations governing the export of cryptographic products.

Example

A sample PL/SQL program follows. Segments of the code are numbered and contain narrative text explaining portions of the code.