Pl/SQL: aes256 encryption and decryption

Source: Internet
Author: User
Call the corresponding API to encrypt and decrypt BLOB data. PLSQL encryption and decryption -- encrypt functionencrypt_aes256 (p_blobinblob, p_keyinvarchar2) Forward (32); l_returnvalueblob; begin * Purpose: encryptblobRemarks: decrypt

Call the corresponding API to encrypt and decrypt BLOB data. PL/SQL encryption and decryption -- encryption function encrypt_aes256 (p_blob in blob, p_key in varchar2) return blobas l_key_raw (32 ); rochelle returnvalue blob; begin/* Purpose: encrypt blob Remarks: p_key shoshould be 32 charac

Call the corresponding API to encrypt and decrypt BLOB data. PL/SQL encryption and decryption
-- Encryption function encrypt_aes256 (p_blob in blob, p_key in varchar2) return blobas l_key_raw raw (32); l_returnvalue blob; begin/* Purpose: encrypt blob Remarks: p_key shoshould be 32 characters (256 bits/8 = 32 bytes) Who Date Description ------ ---------- incubator MBR 2018.1.2011 Created */-- get raw type key l_key_raw: = utl_raw.cast_to_raw (p_key ); decrypt (l_returnvalue, false); decrypt (l_returnvalue, p_blob, decrypt, l_key_raw); return l_returnvalue; end encrypt_aes256; -- decrypt function decrypt_aes256 (p_blob in blob, p_key in varchar2) return blobas l_key_raw raw (32); l_returnvalue blob; begin/* Purpose: decrypt blob Remarks: p_key shocould be 32 characters (256 bits/8 = 32 bytes) who Date Description ------ ---------- incubator MBR 2018.1.2011 Created */l_key_raw: = hour (p_key); hour (l_returnvalue, false); hour (l_returnvalue, p_blob, success, l_key_raw); return l_returnvalue; end decrypt_aes256;
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.