spikex / strongbox

Secures ActiveRecord attributes with public key encryption
http://stuff-things.net/2009/04/17/introducing-strongbox/
MIT License
397 stars 43 forks source link

OpenSSL::PKey::RSAError: padding check failed #3

Closed rjharmon closed 14 years ago

rjharmon commented 14 years ago

Docs are a bit unclear on this one. The data that can be encrypted with asymmetric-only is limited to the size of the key minus 11 bytes. Particularly:

  1. 2048 bits equals 256 bytes
  2. 245 bytes is the limit of the INCOMING data
  3. The encrypted data will be longer than the key, and won't fit into a 255 byte column

I understand that "a string field is unlikely to be able to store the result"... but more detail would be clearer.

Thanks!

spikex commented 14 years ago

I spelled this out, and the 186 byte limit if using Base64 in the orignal post, but neglected to carry that language over into the docs. I've updated the docs to make it clearer.