Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
# pgp-words.py
# Copyright (C) 2015 Joe Ruether jrruethe@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
conv = {
'00': 'adroitness', '01': 'absurd',
'02': 'accrue', '03': 'acme',
'04': 'adrift', '05': 'adult',
'06': 'afflict', '07': 'ahead',
'08': 'aimless', '09': 'algol',
'0a': 'allow', '0b': 'alone',
'0c': 'ammo', '0d': 'ancient',
'0e': 'apple', '0f': 'artist',
'10': 'assume', '11': 'athens',
'12': 'atlas', '13': 'aztec',
'14': 'baboon', '15': 'backfield',
'16': 'backward', '17': 'banjo',
'18': 'beaming', '19': 'bedlamp',
'1a': 'beehive', '1b': 'beeswax',
'1c': 'befriend', '1d': 'belfast',
'1e': 'berserk', '1f': 'billiard',
'20': 'bison', '21': 'blackjack',
'22': 'blockade', '23': 'blowtorch',
'24': 'bluebird', '25': 'bombast',
'26': 'bookshelf', '27': 'brackish',
'28': 'breadline', '29': 'breakup',
'2a': 'brickyard', '2b': 'briefcase',
'2c': 'burbank', '2d': 'button',
'2e': 'buzzard', '2f': 'cement',
'30': 'chairlift', '31': 'chatter',
'32': 'checkup', '33': 'chisel',
'34': 'choking', '35': 'chopper',
'36': 'christmas', '37': 'clamshell',
'38': 'classic', '39': 'classroom',
'3a': 'cleanup', '3b': 'clockwork',
'3c': 'cobra', '3d': 'commence',
'3e': 'concert', '3f': 'cowbell',
'40': 'crackdown', '41': 'cranky',
'42': 'crowfoot', '43': 'crucial',
'44': 'crumpled', '45': 'crusade',
'46': 'cubic', '47': 'dashboard',
'48': 'deadbolt', '49': 'deckhand',
'4a': 'dogsled', '4b': 'dragnet',
'4c': 'drainage', '4d': 'dreadful',
'4e': 'drifter', '4f': 'dropper',
'50': 'drumbeat', '51': 'drunken',
'52': 'dupont', '53': 'dwelling',
'54': 'eating', '55': 'edict',
'56': 'egghead', '57': 'eightball',
'58': 'endorse', '59': 'endow',
'5a': 'enlist', '5b': 'erase',
'5c': 'escape', '5d': 'exceed',
'5e': 'eyeglass', '5f': 'eyetooth',
'60': 'facial', '61': 'fallout',
'62': 'flagpole', '63': 'flatfoot',
'64': 'flytrap', '65': 'fracture',
'66': 'framework', '67': 'freedom',
'68': 'frighten', '69': 'gazelle',
'6a': 'geiger', '6b': 'glitter',
'6c': 'glucose', '6d': 'goggles',
'6e': 'goldfish', '6f': 'gremlin',
'70': 'guidance', '71': 'hamlet',
'72': 'highchair', '73': 'hockey',
'74': 'indoors', '75': 'indulge',
'76': 'inverse', '77': 'involve',
'78': 'island', '79': 'jawbone',
'7a': 'keyboard', '7b': 'kickoff',
'7c': 'kiwi', '7d': 'klaxon',
'7e': 'locale', '7f': 'lockup',
'80': 'merit', '81': 'minnow',
'82': 'miser', '83': 'mohawk',
'84': 'mural', '85': 'music',
'86': 'necklace', '87': 'neptune',
'88': 'newborn', '89': 'nightbird',
'8a': 'oakland', '8b': 'obtuse',
'8c': 'offload', '8d': 'optic',
'8e': 'orca', '8f': 'payday',
'90': 'peachy', '91': 'pheasant',
'92': 'physique', '93': 'playhouse',
'94': 'pluto', '95': 'preclude',
'96': 'prefer', '97': 'preshrunk',
'98': 'printer', '99': 'prowler',
'9a': 'pupil', '9b': 'puppy',
'9c': 'python', '9d': 'quadrant',
'9e': 'quiver', '9f': 'quota',
'a0': 'ragtime', 'a1': 'ratchet',
'a2': 'rebirth', 'a3': 'reform',
'a4': 'regain', 'a5': 'reindeer',
'a6': 'rematch', 'a7': 'repay',
'a8': 'retouch', 'a9': 'revenge',
'aa': 'reward', 'ab': 'rhythm',
'ac': 'ribcage', 'ad': 'ringbolt',
'ae': 'robust', 'af': 'rocker',
'b0': 'ruffled', 'b1': 'sailboat',
'b2': 'sawdust', 'b3': 'scallion',
'b4': 'scenic', 'b5': 'scorecard',
'b6': 'scotland', 'b7': 'seabird',
'b8': 'select', 'b9': 'sentence',
'ba': 'shadow', 'bb': 'shamrock',
'bc': 'showgirl', 'bd': 'skullcap',
'be': 'skydive', 'bf': 'slingshot',
'c0': 'slowdown', 'c1': 'snapline',
'c2': 'snapshot', 'c3': 'snowcap',
'c4': 'snowslide', 'c5': 'solo',
'c6': 'southward', 'c7': 'soybean',
'c8': 'spaniel', 'c9': 'spearhead',
'ca': 'spellbind', 'cb': 'spheroid',
'cc': 'spigot', 'cd': 'spindle',
'ce': 'spyglass', 'cf': 'stagehand',
'd0': 'stagnate', 'd1': 'stairway',
'd2': 'standard', 'd3': 'stapler',
'd4': 'steamship', 'd5': 'sterling',
'd6': 'stockman', 'd7': 'stopwatch',
'd8': 'stormy', 'd9': 'sugar',
'da': 'surmount', 'db': 'suspense',
'dc': 'sweatband', 'dd': 'swelter',
'de': 'tactics', 'df': 'talon',
'e0': 'tapeworm', 'e1': 'tempest',
'e2': 'tiger', 'e3': 'tissue',
'e4': 'tonic', 'e5': 'topmost',
'e6': 'tracker', 'e7': 'transit',
'e8': 'trauma', 'e9': 'treadmill',
'ea': 'trojan', 'eb': 'trouble',
'ec': 'tumor', 'ed': 'tunnel',
'ee': 'tycoon', 'ef': 'uncut',
'f0': 'unearth', 'f1': 'unwind',
'f2': 'uproot', 'f3': 'upset',
'f4': 'upshot', 'f5': 'vapor',
'f6': 'village', 'f7': 'virus',
'f8': 'vulcan', 'f9': 'waffle',
'fa': 'wallet', 'fb': 'watchword',
'fc': 'wayside', 'fd': 'willow',
'fe': 'woodlark', 'ff': 'zulu',
}
if len(sys.argv) == 2:
fingerprint = sys.argv[1].lower().replace(' ', '')
segments = [fingerprint[i:i+2] for i in range(0, len(fingerprint), 2)]
for c,i in enumerate(segments):
print(conv[i], end=" ")
else:
words = sys.argv[1:]
for i in words:
print(list(conv.keys())[list(conv.values()).index(i)], end="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment