ex_crypto icon indicating copy to clipboard operation
ex_crypto copied to clipboard

using anything but aes_256 as the key fails

Open zacksiri opened this issue 6 years ago • 3 comments

I'm trying to do basic AES encryption on some text

{:ok, aes_128_key} = ExCrypto.generate_aes_key(:aes_128, :bytes)
{:ok, {_iv, cipher_text}} = ExCrypto.encrypt(aes_128_key, "hi")

and I'm getting this error

** (MatchError) no match of right hand side value: %ErlangError{original: :notsup}
    (ex_crypto) lib/ex_crypto.ex:28: ExCrypto.normalize_error/3

If I use aes_256 everything works.

zacksiri avatar Mar 02 '18 10:03 zacksiri

I've encountered the same problem recently. Have you had any luck in figuring out the cause, @zacksiri?

milica-nerlovic avatar Oct 25 '18 10:10 milica-nerlovic

I think that's an error that bubbled up from the underlying crypto library. What sort of environment are you running in?

ntrepid8 avatar Oct 25 '18 14:10 ntrepid8

Yes, 👍 I also found some note about this in the Erlang crypto docs.

Ubuntu 14.04.5 LTS OpenSSL 1.1.1 Erlang/OTP 21 Elixir 1.7.3

milica-nerlovic avatar Oct 26 '18 07:10 milica-nerlovic