Create English phrases from hex numbers that are easier to recognize and remember.
0123456789abcdef are the symbols which are usually used to represent hexadecimal (base16) numbers.
ulkmhpvtwgnbcdyf is what pleonasm uses - 16 letters from the English alphabet.
a815 would be written as
The alphabet contains 10 more letters which are not used as symbols (
aeijoqrsxz). They are inserted between the symbols to form proper words. In this case, the string
answer loop will be created, which might be preferable to
The created words carry the same information as the hex number and can be decoded easily back to hex. Removing the non-symbol letters and white spaces from
answer loop yields
nwlp, which is just
a815 written with different symbols.
The dictionary that is used to create the phrases contains over 50,000 words. Given random input, words will rarely be repeated.
To form phrase-like word groups, a simple scheme is used: verb, adjective, noun, verb, adjective, noun, ...
For each word, the longest match is picked from the provided dictionary. Many thousand characters per second can be encoded.
The dictionary, which is needed for encoding, is not needed for decoding. Only the 16-letter alphabet (symbol represenation) has to be known. The following Python code forms a complete decoder:
alphabet = 'ulkmhpvtwgnbcdyf' target = '0123456789abcdef' def decode(words): # filter out redundant characters words = filter(lambda char: char in alphabet, words) # translate to hex for replacement, org in zip(alphabet, target): words = words.replace(replacement, org) return words