orn
Decrypting AEAD-GCM : which crypto packages should I use?
Hi everyone!
I have an AEAD-GCM encrypted token with the cipher text, init vector, and the tag. I also have a key which is base64 encoded.
I’ve tried using ExCrypto, Crypto, and tried to use Hairnet, and I wasn’t able to find resources to do it right.
I’m not sure which packages would work with AES-GCM 256 bit encryption and decryption.
I’ve checked out the earlier post on this forum which was about encryption. That uses functions from the crypto which have been deprecated since OTP 24.
Thank you!
Most Liked
cmkarlsson
The last entry in the linked post seems to describe how to do the same with the newer crypto functions. Unknown cipher when encrypting data - #18 by CafeRacer
In your case it seems like you have all data needed to use :crypto.crypto_one_time_aead
In general most crypto primitives can be found in the :crypto module. It is shipped with OTP and are a collection of functions that uses openssl underneath through a NIF. Most other crypto packages are wrappers around crypto or before erlang 22.0 to provide functionality crypto did not yet support.







