SQL> declare
2 l_key varchar2(2000) := '1234567890123456';
3 l_in_val varchar2(2000) := 'ConfidentialData';
4 l_mod number := dbms_crypto.ENCRYPT_AES128
5 + dbms_crypto.CHAIN_CBC
6 + dbms_crypto.PAD_PKCS5;
7 l_enc raw (2000);
8 begin
9 l_enc := dbms_crypto.encrypt
10 (
11 UTL_I18N.STRING_TO_RAW (l_in_val, 'AL32UTF8'),
12 l_mod,
13 UTL_I18N.STRING_TO_RAW (l_key, 'AL32UTF8')
14 );
15 dbms_output.put_line ('Encrypted='||l_enc);
16 end;
17 /
SQL>