5
\$\begingroup\$

The PGP Word List is a set of 512 English words for verbally communicating strings of bytes, such as authentication codes or hashes. It is used in secure VoIP software as well as in some other important applications, such as the DNSSEC Root KSK Ceremonies held four times a year.

It consists of 256 two-syllable words and 256 three-syllable words. Bytes at even offsets become two-syllable words, while bytes at odd offsets become three-syllable words. This protects against transposition of adjacent words, repetition of a word, or omission of a word.

The two subsets are kept as alphabetical lists and numbered accordingly, so a null byte (hex 00) becomes "aardvark" at an even offset and "adroitness" at an odd offset. Likewise, the words for hex FF are "Zulu" and "Yucatan" respectively.


Write a complete program to encode a sequence of bytes (represented as pairs of hex digits) as a sequence of words from the PGP Word List.

Because the program is to be run on a secure, air-gapped computer, and USB drives are a security risk, the program should be as short as possible to facilitate manual entry. (The length of each program is measured in bytes, because if I were to use the complicated keystroke formula I came up with, this specification would be twice as long as it is now.)

Input format

The program must accept a string of hex digits as either a single line of input or a command-line argument. You may assume the following:

  • There are no spaces or other separators between hex digits.
  • The number of hex digits is between 2 and 128 inclusive.
  • The number of hex digits is even.
  • Digits A-F are either all lowercase or all uppercase (if the required letter case is documented).

Example input: 9030e74b

Output format

The program must print a corresponding line of words from the PGP Word List. Adjacent words must be separated by a single space. However, case of the letters within the words may differ from that shown in the PGP Word List.

Example output: peachy commando transit disable

Restrictions

The program must not rely on any external copy of the PGP Word List, including any data known to be largely derived from the list that may be present in a system file or library.

Test cases

A TSV file is provided. In each line, column 1 contains the input (as lowercase hex digits), and column 2 contains the corresponding output. More test cases may be added if necessary.

\$\endgroup\$
1
\$\begingroup\$

PHP – 3302 bytes

This solution uses a gzcompressed string of uppercase space-delimited PGP words, e.g. AARDVARK ABSURD ACCRUE...WOODLARK ZULU.

<?php $f='explode';$g='gzuncompress';$h='base64_decode';$a[]=$f(' ',$g($h('eNollVli5CAMRK/CVWSMbWJAhKU9zv0PMk/0R6jqsGgrySJt/0i7nWx9tt2J920GILPsLR4DmIn1OFL04BWEYzGn0LuTdGpiTfqwauFSzuqk+BgKh2tN/KuN2Pn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EQgKDzkJdQVlDrXKok4ZwoVn3Caw74Du4o/E5tq8e9OTZcRLc1P4R00XiYoNdkmHR2VvwsvRxSZZ0r5jBz+ERopSvhnnOoKktMJUR+sN7E/MWSFfiToIDtdISu6F/djNuohFIPChCNROMHQIHg61Pke7UwvvNkHWto4PPlkNROQwEhwFZc8MlhmCxyWpbXUHCBmvmSFcMXty0ekEHp1C0Uqb/QXlcRzBHO3N/ZQrN5pc8kyusRbyHa1YCWjfv7fyd1cZjVPTbDRV00ZNQyneIdGbFko7QtobuyZuNUFHlyRnPLaKuc+0UHL+xovKE6hM1HEikSdpMYl40wFknphuGqW+prwLSZNcO7MA6HQ5440ufYDuv25IG3Jr7X4TX2lgowQKjcJdqI673XmvR8oZeQ7IgC6oIjzDPiDkLj/8RYWm7XtfuvDA9BVmhiesERpcOMOa0IqvGigqNQVM+WsptMnCY8G+VxzW+nj6HvaVBMH6Gzz2Kq//tUhh5ougnLEeEOfgvd3Gb7v0nfpsuyOGjWQfJstQFoQQQD0UV1LGhOEdAMiVJuZd4l+tagZL3fBazZYVNZwRTK82x3CHPKBCPX9j7WtDwo1+7yN83S1IfY2J4QzhEqeGnWuP/Rw35/Q0Q0b1SWtM8Bm+UInr3K6IzgoMRqWITUrjeT7qLgBFZ6whCjpDBnkEsallfHFW/2CyjQh0CX050x3nQ3r02dWk1EvUI/V4RGuxuAd5Z2wWCYnf8lj861+ew7jZP65ll8Sp7SQQ8HZEi6XHLTn0rqhvAKAWhTy8p8SHsxljyc83N6BhUCnFNJa4d71aPAgh1uZy0yzmxH490Phfl6PT/JfOE+SGp7Bo6T8BwHcnAI=')));$f=1;foreach(str_split($argv[1],2)as$b)echo$a[$f^=1][hexdec($b)].' ';echo"\n";

Save as decode.php and run with argument in the command line, e.g.

$ php decode.php 9030e74b
PEACHY COMMANDO TRANSIT DISABLE

Because the specification mentioned ease of text entry, I guessed full 8-bit was a no-no and restricted to regular ASCII and base 64 for the encoding.

The PGP word lists on their own, no spaces, with one word running into the next, is 3919 characters long, so this solution represents a savings of 15.74%.

Another solution formatting the strings with mixed case AardvarkAbsurdAccrue...WoodlarkZulu and splitting based on the case, while retaining the delimiter, turns out to be longer at 3433 bytes, even though I'm removing 510 spaces from the PGP word list source!

<?php $f='preg_split';$g='/([A-Z])/';$h='gzuncompress';$i='base64_decode';foreach([$f($g,$h($i('eNodVdF246oO/TY7STNzejvNmLRd67zJWDGMAXFA1ON+/d30IUixQWhvbckDleWTyjbMtZVlsLY0HmzkYSn+ocPSgg6PR/BWB8e0DD4GrnUIq4QhBNmHIImHGGVI1nPSIefAQ1Ffdai1IZA6TnXQQHX4UrYjzSJpJLs9PIelOztyGCn9kZEp+rSOvASKeWR2/pNh6k5/R34UXLCMHB5UdeRSuWyjD8H3474iaECwP/iNQexGC8PuKsW6MTSePbZJnPthka06BBoLdvvqxgJswSfuztbyWLzdjh4Xdz4sVR5bmSltY1PFRe3rCy9PHIH45MiXALLgqHI5ObYIcXK+cjg52YAIJuf+qoCXSPUEfD2BAKdWb79NEYmnwJRwuAPYpWwnmQudJOIiyyfBUvQk+9yP9twX2ROctB2nIvtDRE+lWU942yIqscBWMHFqs7dnqm4WJH4G2lmCnpGpo7ScZa3Yey60JlYYn2jlcyfl0cK5K4HLuXxjOCPwzIRdLW2czi1L0vOOhIDzQtrXBXK5rGsXzMWvTmcK4ZIWQcm62S8pgIdLAa+Xainz5a9lXi4Hr50IWAUS90QdyRMOS9OnQGuWwLDacT6FQwvlJ7CgrTBs5M7YU0EkiU+lX8zpSl9Ija/sVy7X4HuFrqFZqXyVdYWYrxKWBzRwLRyB4dr8QuD5B0Hp+gNRbC/wDxSEj5/IHihgWlj5Z/rsKoSR8Mk/awCV/9A+oyOe+fhm+hk6ksfj2e/+OdBfSf8TS4GxQiIvXLy++JRkf4FYyos42reXVii8NKjiF8oDSfMvztoSDEKX9OubUYj5lbZ+4+usrfIrmlRoec3q7WuxdKNjoePGZN1xQyEqJb25o/r/Gt8CHU5w6Baayq2wDW1h2AcXr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7dAV1Vy3taXiaYa8MPqpTxld8Z3+egGHXDBwXX+AcNhAD9hwt/0A+xATOOPgTUUPvwlxbBP7R5JT9dIam0T58/4P/nKFNGQ+OnhBET6BMvyM9T+tmWIH/ZH/zGZH8rwFP6Dz6ZaRE=')),-1,3)]as$p){$t=[];for($i=0;$i<count($p);$i+=2)$t[]=$p[$i].$p[$i+1];$a[]=$t;}$f=1;foreach(str_split($argv[1],2)as$b)echo$a[$f^=1][hexdec($b)].' ';echo"\n";

Save as decode.php and run the same way:

$ php decode.php 9030e74b
Peachy Commando Transit Disable

As well, using aARDVARKaBSURDaCCRUE...wOODLARKzULU as the source text, the solution still comes out at 3433 bytes:

<?php $f='preg_split';$g='/([a-z])/';$h='gzuncompress';$i='base64_decode';foreach([$f($g,$h($i('eNodVdt227oO/DaIhEVWIMHNS1TlTbIdtycnjSs5yVr76/cwDyZgiQQxgwG0UrZPlKd1KC3b1ZjceDWBV5v9qa62SV1PJ/Gmro7Jrj4Il7LKqLKK6LyKRl5D0DUaz7GuKQmvufpS11IaAlXHsaxVqKzPlc1Gg2rcyEwnz2K7MyOHjeIP3ZiCj+PGViikjdn5J4YpM/3c+JRxgd1YTlTqxrlwnjYv4vtxXxBUEOwHfpuomcgy7Fw1G7dJ48Fjm4ahH1adikOgLWO3L27LwCY+cnemlrbszbT0uLjzZKjw1vJAcdparbioPT/j5ZkDEJ8d+SwgC06tnM+ODUKcnS8sZ6cTEMGk1F9l8BKonIGvJyBwSvHm22TVcBamiMMdwKx5OuuQ6awBFxk+K5ZczzoP/WjP3eoc4cRpOWedT6r1nJvxhLctoBIWtoCJcxu8uVBxgyLxC9AOKvWCTB1Fe9GxYO8l0xi5wvhII186Kacml64Ezpf8jeGCwAMTdrU4cby0pLFeZiQEnFeqfbWQy3Ucu2CufnR1IJFrtIqSdTNfo4CHawav12Io8fWnYbbXhcdOBGwFEvdCHckLDmurL0JjUmHY2nG+yFIzpRewUFtm2MCdsZeMSBpecr+Y442ekRrf2I+cb+J7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aBe8Jbiu7gkcCAuEF0qeKbrSzrW4XK7I7SUtypdndXCAR6p1INor5jLKOO7R7AE6/oHXNwmQZ3RXoYNHet2BG743rkCzDuofmF74XL8MO1e6kTJxffvU6Ti37L92X0otH3micJ4psN4ipDe0DEWg0KfOAlmLwhD9SMJlz/0BWFoA8w0bxtDx19BO8emMjc6QNzQRwgHB8g7WF4B5ATThomNHB1jzbxzlxMnxjm3p1PFADE4e7TAa1Vy2daXiaYdcMPqpTxld8ZP6egGHX9FwXX+Bf1hADdlwu/1y+xHjOOvgTUUPvylxbBv7R5Jb9dIam0b58/4P/3IGNGQ+O3hAET6BsvyM9T+t2WIP/YH/zGZP8qwFP6Dz1XnCI=')),-1,3)]as$p){$t=[];for($i=0;$i<count($p);$i+=2)$t[]=$p[$i].$p[$i+1];$a[]=$t;}$f=1;foreach(str_split($argv[1],2)as$b)echo$a[$f^=1][hexdec($b)].' ';echo"\n";

Sample:

$ php decode.php 9030e74b
pEACHY cOMMANDO tRANSIT dISABLE

What's likely going on here are inefficiencies in the compression algorithm arising from using mixed case. Good to know - you learn something every day...

\$\endgroup\$
  • \$\begingroup\$ Full 8-bit is OK; there is no rule limiting you to 7-bit ASCII. My system has a Base64 decoder, and for the sake of simplicity I decided on byte-based scoring (instead of my complicated keystroke formula). Also, I noticed that your submission adds a space after the last word, not just a linefeed. Though that is not what I was expecting, again, there's no rule against that. \$\endgroup\$ – PleaseStand Jan 20 '16 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.