orn
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!
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
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_aeadIn general most crypto primitives can be found in the
:cryptomodule. 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.orn
You’re right. That does have the newer crypto functions.
I do have all the data. I went step by step to figure out why it’s failing for me, and it looks like this time it’s the data I have.
It’s that I have Base64 encoded strings separated by a
:, and when I decode the string and pass it to the function, I get an error value returned.I tried decrypting the data encrypted in the same call. When I passed the variables as is, it decrypted and gave me the result. When I base64 encoded just the cipher tag and decoded it again just before passing it to the decrypt function, it returns error.
gregvaughn
Have you verified the base64 padding option? I’ve had similar problems before where the encoded value was padded, but the decryptor expected unpadded (or vice versa).