[erlang-questions] question regarding symmetric encryption with crypto library
Tue Apr 28 02:29:04 CEST 2009
Ok. Bruce Schneier's "Applied Cryptography" to the rescue. The
solution is to always pad the plain text (even when it's an encrypt-
able length and use the last byte to store the number of bytes added.
No problem, really, but it would sure be nice if someone would add a
wrapper to the crypto library so everyone didn't have to re-invent
this particular wheel :-).
On Apr 27, 4:49 pm, Larry White <> wrote:
> In the past the encryption libraries I've used have accepted an arbitrary
> string as plain text input. The des implementation in crypto (and the
> algorithm itself) seems to require that the the input text be some multiple
> of 8 bytes long. I can pad the input string with something to make it n*8
> bytes long, but then when I decrypt the string, I have no way of knowing if
> the returned value was padded and by how much.
> This seems like a problem many people must have solved. What's the right
> way to do this here?
> thanks much for your help.
> erlang-questions mailing list
More information about the erlang-questions