SQL> create or replace function get_enc_val
2 (
3 p_in_val in varchar2,
4 p_key in varchar2
5 )
6 return varchar2
7 is
8 l_enc_val raw(4000);
9 begin
10 l_enc_val := dbms_crypto.encrypt
11 (
12 src => utl_i18n.string_to_raw (p_in_val, 'AL32UTF8'),
13 key => utl_i18n.string_to_raw (p_key, 'AL32UTF8'),
14 typ => dbms_crypto.encrypt_aes128 +
15 dbms_crypto.chain_cbc +
16 dbms_crypto.pad_pkcs5
17 );
18 return l_enc_val;
19 end;
20 /
SQL>
SQL>
|