-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decrypting a phoney value breaks when testing #3
Comments
That's something else I think. See: iex(1)> Cipher.decrypt("random")
{:error, "Could not decode crypted string 'random'"}
iex(2)> Cipher.decrypt("nonsense")
** (ArgumentError) argument error
(crypto) :crypto.aes_cbc_crypt("1c538c5bcef14695", "testieivphrasefo", <<158, 137, 236, 122, 123, 30>>, false)
(cipher) lib/cipher.ex:39: Cipher.decrypt/1 I'm on it now. |
Just released 1.0.2 including this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A simple test:
Returns this error:
I suspect that during testing, the helper functions to retrieve the :keyphrase and :ivphrase are not working correctly: https://github.com/rubencaro/cipher/blob/master/lib/cipher/helpers.ex
You can see this by extracting the definition and trying it in a test. When I add this line to my test:
IO.inspect Application.get_env(Mix.Project.get!.project[:app], :keyphrase, nil)
...the outut is: nil
The text was updated successfully, but these errors were encountered: