0

Hello,

I work with another team (who work on another technology) to develop an application.

In that application, we encrypt and decrypt data.

The other team would like to use Fernet to encrypt and decrypt data.

I have no experience with encrypt and decrypt.

I understand we use an alogirthm (AES128, AES192, AES256) to generate the private key (generated with Fernet) and to encrypt data. I will decrypt data with the same private key and the same algorithm?

My question is to know if Salesforce can decrypt with Fernet?

4
  • Fernet is using AES128 in CBC mode with a SHA256 HMAC so Crypto class in Apex can handle this. Give it a shot!
    – identigral
    Commented Apr 8, 2022 at 17:28
  • Thank you for your response. To decrypt the value, I don't need to add the fernet library (I am not sure we can add a new library into Salesforce)? I only need to use the method Crypto.decryptWithManagedIV()?
    – Oupat
    Commented Apr 11, 2022 at 15:46
  • You can import a library if it's written in Apex (Salesforce's programming language), there are none for Fernet. The alternative is to implement the verification step in a Function and call it from your main code in Salesforce. Functions support Java, TypeScript and Node.JS. If you haven't worked with Apex and Salesforce, Function might be the way to go for you.
    – identigral
    Commented Apr 11, 2022 at 16:04
  • I know Salesforce and Apex but I didn't know Salesforce functions. It means to be a good solution, I will try it, thanks.
    – Oupat
    Commented Apr 11, 2022 at 16:57

0

You must log in to answer this question.

Browse other questions tagged .