Performing Multi-Pass Encryption

Earlier in this chapter, in the "Encryption Algorithms" section, I mentioned that the DES standard had been enhanced so that content could pass through the process two

or three times, leading to the name Triple DES, or DES3. Oracle’s implementation of DES3 through the function DES3ENCRYPT uses the two-pass scheme by default. However, you can instruct the function to use three passes via a new parameter called which. The default value, 0, indicates only two passes, and 1 indicates three. Performing three passes, of course, provides stronger encryption.

To use the three-pass scheme, you must use a key of at least 24 bytes, instead of the 16-byte one we’ve been using up until now. I can change the original function as follows to allow the user to specify the two-pass or three-pass process.

 /* File on web: get_enc_val_4.sql */ CREATE OR REPLACE FUNCTION get_enc_val ( p_in_val IN VARCHAR2, ...

Get Oracle PL/SQL for DBAs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.