Simple and Terrifying Encryption Story(blog.elpassion.com)
blog.elpassion.com
Simple and Terrifying Encryption Story
https://blog.elpassion.com/simple-and-terrifying-encryption-story-c1f1d6707c07#.o021b04xm
4 comments
Here's the documentation: http://www.rubydoc.info/gems/aes/0.5.0
Reading through, it's NOT clear that `key` must be hexidecimal, but you can see why the gem's author didn't think to call it out:
The gem also provides a helper method for generating keys: AES.key (which outputs a random hexidecimal string). The developer probably never expected users to submit their own keys, despite the design of the gem making it easy to do.
Reading through, it's NOT clear that `key` must be hexidecimal, but you can see why the gem's author didn't think to call it out:
The gem also provides a helper method for generating keys: AES.key (which outputs a random hexidecimal string). The developer probably never expected users to submit their own keys, despite the design of the gem making it easy to do.
Who needs type systems, anyway? Or any datatypes but strings, for that matter!
subtitle: "Or why you can't skip writing unit tests."
Did the documentation specify anywhere that it expects hex values?
Even if it did it should still probably throw an error if handed a normal string. You should defs make a pull request and fix it.