Code Monkey home page Code Monkey logo

Comments (5)

woylie avatar woylie commented on August 20, 2024

We have the same error after upgrading from Cloak 1.1.0 and OTP 23 to Cloak 1.2.0 and OTP 24. The Elixir version remained unchanged on 1.12.2 during the update.

from cloak_ecto.

woylie avatar woylie commented on August 20, 2024

Here's a stack trace:

ErlangError: Erlang error: {:badarg, {'aead.c', 90}, 'Unknown cipher'}
  Module "crypto", in :crypto.aead_cipher/7
  File "lib/cloak/ciphers/aes_gcm.ex", line 65, in Cloak.Ciphers.AES.GCM.decrypt/2
  File "lib/cloak_ecto/type.ex", line 64, in CircleApp.Ecto.EncryptedBinary.load/1
  File "lib/ecto/type.ex", line 894, in Ecto.Type.process_loaders/3
  File "lib/ecto/repo/queryable.ex", line 406, in Ecto.Repo.Queryable.struct_load!/6
  File "lib/ecto/repo/queryable.ex", line 238, in anonymous fn/5 in Ecto.Repo.Queryable.preprocessor/3
  File "lib/enum.ex", line 1582, in Enum."-map/2-lists^map/1-0-"/2
  File "lib/ecto/repo/queryable.ex", line 229, in Ecto.Repo.Queryable.execute/4

from cloak_ecto.

woylie avatar woylie commented on August 20, 2024

I noticed that this error can occur if a key with an invalid length is used. I wonder whether the new :crypto functions have stricter validation for the key that is passed as an argument, or maybe it has to do with the retired cipher names that didn't specify the key size. This error occurred only in prod for us, but not on stage or locally, which might point to a key with a wrong length being configured for prod.

from cloak_ecto.

woylie avatar woylie commented on August 20, 2024

Solved in our case by rotating the key on cloak_ecto 1.1.1 / OTP 23 and upgrading to 1.2.0 / OTP 24 after that.

from cloak_ecto.

danielberkompas avatar danielberkompas commented on August 20, 2024

It sounds like the invalid key length was likely the problem. If anyone else encounters this feel free to comment and I'll reopen for more investigation.

from cloak_ecto.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.