Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify the sql file below, make the logic to use the Advanced Encryption Standard (AES) 256-bit Encryption Algorithm. Also modify the procedure to decrypt and
Modify the sql file below, make the logic to use the Advanced Encryption Standard (AES) 256-bit Encryption Algorithm.
Also modify the procedure to decrypt and print the Decrypted SSN value.
Use UTL_I18N.RAW_TO_CHAR to convert RAW to a VARCHAR2 string, so you can print it.
Can you help me with how exactly we are supposed to edit the file?
SET SERVEROUTPUT ON SET ECHO ON DECLARE ssn VARCHAR2(20) := '555 55 5555'; ssn_raw RAW (100) := UTL_RAW.cast_to_raw(ssn); num_key_bytes NUMBER := 128/8; key_bytes_raw RAW (16); encryption_type NUMBER := DBMS_CRYPTO.ENCRYPT_AES128 + DBMS_CRYPTO.CHAIN_CBC + DBMS_CRYPTO.PAD_PKCS5; encrypted_raw RAW (2000); BEGIN DBMS_OUTPUT.put_line('The Unencrypted SSN is: ' || ssn); key_bytes_raw := DBMS_CRYPTO.RANDOMBYTES (num_key_bytes); encrypted_raw := DBMS_CRYPTO.encrypt( src => ssn_raw, typ => encryption_type, key => key_bytes_raw); DBMS_OUTPUT.put_line('The Encrypted SSN is: ' || RAWTOHEX(UTL_RAW.cast_to_raw(encrypted_raw))); DBMS_OUTPUT.put_line('The Decrypted SSN is: '); END; /
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started