Skip to content
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

Attempting to decrypt a nonsensical string causes an error #2

Closed
suprafly opened this issue Apr 22, 2016 · 2 comments
Closed

Attempting to decrypt a nonsensical string causes an error #2

suprafly opened this issue Apr 22, 2016 · 2 comments

Comments

@suprafly
Copy link

Example:
Cipher.decrypt("ddd")

Error
** (MatchError) no match of right hand side value: :error
lib/cipher.ex:36: Cipher.decrypt/1

on line 36 of lib/cipher.ex:
{:ok, decoded} = crypted |> URI.decode_www_form |> Base.decode64

Why does this matter?
Because there may be cases where you are attempting to decrypt something, say an encrypted token coming over an api endpoint, and it may have been injected by a hacker. Should fail gracefully with a sensible reason why.

@rubencaro
Copy link
Owner

Just released 1.0.1 including this.

Thanks!

@suprafly
Copy link
Author

Wow, that was fast. Thanks!

On Fri, Apr 22, 2016 at 11:45 AM, Rubén Caro [email protected]
wrote:

Just released 1.0.1 including this.

Thanks!


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#2 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants