utl_i18n.string_to_raw and dbms_crypto.encrypt : dbms_crypto « System Packages « Oracle PL/SQL Tutorial






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>








31.5.dbms_crypto
31.5.1.dbms_crypto.randombytes
31.5.2.dbms_crypto.hash
31.5.3.dbms_crypto.hash_sh1
31.5.4.dbms_crypto.mac
31.5.5.utl_i18n.string_to_raw and dbms_crypto.encrypt
31.5.6.DBMS_CRYPTO.encrypt_aes128 + DBMS_CRYPTO.chain_cbc + DBMS_CRYPTO.pad_pkcs5
31.5.7.dbms_crypto.ENCRYPT_AES128