DBMS_CRYPTO example
SQL> CONN SYS/SYS AS SYSDBA Connected. SQL> set serveroutput on SQL> SQL> set linesize 121 SQL> SQL> DECLARE l_credit_card_no VARCHAR2(19) := ‘1234-5678-9012-3456’; l_ccn_raw RAW(128) := utl_raw.cast_to_raw(l_credit_card_no); l_key RAW(128) := utl_raw.cast_to_raw(‘abcdefgh’); l_encrypted_raw RAW(2048); l_decrypted_raw RAW(2048); BEGIN dbms_output.put_line(‘Original : ‘ || l_credit_card_no); l_encrypted_raw := dbms_crypto.encrypt(l_ccn_raw, dbms_crypto.des_cbc_pkcs5, l_key); dbms_output.put_line(‘Encrypted : ‘ || RAWTOHEX(utl_raw.cast_to_raw(l_encrypted_raw))); l_decrypted_raw := dbms_crypto.decrypt(src => l_encrypted_raw, typ => dbms_crypto.des_cbc_pkcs5, key => […]