The keys for private-key algorithms should be arbitrary binary data.
Many systems err by asking the user to enter a password, and then
using the password as the key. This limits the space of possible
keys, as each key byte is constrained within the range of possible
ASCII characters, 32-127, instead of the whole 0-255 range possible
with ASCII. Unfortunately, it's difficult for humans to remember 16
or 32 hex digits.
One solution is to request a lengthy passphrase from the user, and
then run it through a hash function such as SHA or MD5. Another
solution is discussed in RFC 1751, "A Convention for Human-Readable
128-bit Keys", by Daniel L. McDonald. Binary keys are transformed
into a list of short English words that should be easier to remember.
For example, the hex key EB33F77EE73D4053 is transformed to "TIDE ITCH
SLOW REIN RULE MOT".
- key_to_english(key)
-
Accepts a string of arbitrary data key, and returns a string
containing uppercase English words separated by spaces. key's
length must be a multiple of 8.
- english_to_key(string)
-
Accepts string containing English words, and returns a string of
binary data representing the key. Words must be separated by
whitespace, and can be any mixture of uppercase and lowercase
characters. 6 words are required for 8 bytes of key data, so
the number of words in string must be a multiple of 6.