Comments (5)
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.
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.
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.
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.
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)
- Cloak.Ecto.Type does not conform to the Ecto.Type behavior HOT 3
- In multi-tenant setting HOT 1
- Should Ecto.Type implementations of `equal?/2` be constant time?
- Support blind indexes HOT 1
- (ArgumentError) invalid or unknown HOT 1
- Not possible to compile with Ecto 3.6.0 HOT 10
- Missing function `:crypto.block_encrypt/4 ` in Erlang 24 HOT 3
- Decrypt for postgresql's native encrypt function? HOT 1
- Remove insecure example from docs HOT 1
- Trouble loading the Cloak.Ecto.PBKDF2 library HOT 1
- Drop dependency on :pbkdf2
- Documentation: cloak.migrate.ecto mix task ignores labels and is order-dependent HOT 1
- Hashed, searchable columns HOT 5
- Create unique contraint for encrypted or hashed column
- Missing ETS table on Fly.io HOT 3
- Migrator doesn't handle plaintext arrays or maps with inner types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloak_ecto.