Is DBMS_CRYPTO.DECRYPT with salt possible?

885 Views Asked by At

Is there a way to set the salt in pl/sql when using DBMS_CRYPTO?

My code looks like:

--PBEWithMD5AndTripleDES -> Origin Encryption algorithm
encryption_type    PLS_INTEGER := SYS.DBMS_CRYPTO.DES3_CBC_PKCS5 + DBMS_CRYPTO.HASH_MD5;
saltInput RAW(2000); -- needed to parse value for decryption process
digestInput RAW(2000); -- needed to parse value for decryption process
password RAW(2000); -- Password (Raw) AL32UTF8 converted


rawOutput := SYS.DBMS_CRYPTO.DECRYPT
(
     src => digestInput,
     typ => encryption_type,
     key => password
     -- add salt here for the decryption like it was originally made
);

I need to add the salt which was randomly created when encrypting and attached to the front of the encrypted value.

I am able to get this salt, but I am not able to tell DBMS_CRYPTO to use the salt for it's encryption and decryption algorithm.

0

There are 0 best solutions below