Skip to Main Content

LiveLabs & Workshops

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How can I decrypt in ODI procedure a file encrypted with Python Fernet Library

User_0BFBNNov 25 2020 — edited Nov 28 2020

I am facing this scenario in ODI 12c
I am going to receive one file encrypted (by fernet library on python) and the corresponding key for it (*.sha file).
I know ODI can run some python-fashioned commands using a user procedure, but I am not sure all the settings I need to put in place in procedure definition window and if there is additional configuration to run those Python commands. Actually the task command in my procedure is still in python (See below). But I think I should use Jython instead of Python commands. Any advice will be appreciated:

from cryptography.fernet import Fernet
fkey = open("llave.sha", 'rb')
key = fkey.read()
cipher = Fernet(key)
with open('#SIVALE_INT.NombreArchivoCatKonfioEnc','rb') as df:
encrypted_data = df.read()
decrypted_file = cipher.decrypt(encrypted_data)
with open('#SIVALE_INT.NombreArchivoCatKonfio','wb') as df:
df.write(decrypted_file)

Thanks in advance.

Antonio
Package.PNG (166 KB)User_Proc1.PNG (136.22 KB)User_Proc2.PNG (220.66 KB)

Comments

Post Details

Added on Nov 25 2020
1 comment
419 views