pgp-word-list 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +15 -0
- data/lib/pgp-word-list.rb +170 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e62da070f173ea7f9491b6c1536f12505a9ff96b
|
4
|
+
data.tar.gz: 5111a78c879d715e0ae3e88b1c531840403cc9e3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 823870a511b1c922c77660ae5b60a64aa5b5d81ba6f3db3f26678a3af2253aeba4ef744edcec211f41f0a52c6d557ecb89d68e3b723eccad99d02f5256b778b3
|
7
|
+
data.tar.gz: 09a00ff45cbcdfc63685828454dfd161799de83d650b62b6d48e15d31269b4ff3e115a3fa21a722821310270473bb2235863ff700be07ed795c8f86a5ace158a
|
data/README.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# pgp-word-list
|
2
|
+
|
3
|
+
Convert hex strings to PGP word lists and vice-versa.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
````
|
8
|
+
require 'pgp-word-list'
|
9
|
+
|
10
|
+
> 'D1D4 64C0 04F0 0FB5 C9A4 C8D8 E433 E7FB 7FF5 6256'.to_pgp_words
|
11
|
+
=> "stairway souvenir flytrap recipe adrift upcoming artist positive spearhead Pandora spaniel stupendous tonic concurrent transit Wichita lockup visitor flagpole escapade"
|
12
|
+
|
13
|
+
> "stairway souvenir flytrap recipe adrift upcoming artist positive spearhead Pandora spaniel stupendous tonic concurrent transit Wichita lockup visitor flagpole escapade".to_pgp_hex
|
14
|
+
=> "D1D464C004F00FB5C9A4C8D8E433E7FB7FF56256"
|
15
|
+
````
|
@@ -0,0 +1,170 @@
|
|
1
|
+
class String
|
2
|
+
def to_pgp_words
|
3
|
+
self.upcase.gsub(/[^A-F0-9]/,'').scan(/../).to_pgp_words.join(' ')
|
4
|
+
end
|
5
|
+
|
6
|
+
def to_pgp_hex
|
7
|
+
self.downcase.gsub(/[^a-z\ ]/,'').split().map(&:strip).to_pgp_hex.join('')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Array
|
12
|
+
def to_pgp_words
|
13
|
+
words = []
|
14
|
+
self.each_with_index do |hex, i|
|
15
|
+
words << PGPWordList.hex_to_word(hex, i)
|
16
|
+
end
|
17
|
+
return words
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_pgp_hex
|
21
|
+
hex = []
|
22
|
+
self.each do |word|
|
23
|
+
hex << PGPWordList.word_to_hex(word)
|
24
|
+
end
|
25
|
+
return hex
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class PGPWordList
|
30
|
+
def self.hex_to_word(hex, position)
|
31
|
+
word_list[hex][position%2]
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.word_to_hex(word)
|
35
|
+
word_list.select{|hex, words| words.map(&:downcase).include? word.downcase}.keys[0]
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.word_list
|
39
|
+
{
|
40
|
+
'00' => ['aardvark', 'adroitness'], '01' => ['absurd', 'adviser'],
|
41
|
+
'02' => ['accrue', 'aftermath'], '03' => ['acme', 'aggregate'],
|
42
|
+
'04' => ['adrift', 'alkali'], '05' => ['adult', 'almighty'],
|
43
|
+
'06' => ['afflict', 'amulet'], '07' => ['ahead', 'amusement'],
|
44
|
+
'08' => ['aimless', 'antenna'], '09' => ['Algol', 'applicant'],
|
45
|
+
'0A' => ['allow', 'Apollo'], '0B' => ['alone', 'armistice'],
|
46
|
+
'0C' => ['ammo', 'article'], '0D' => ['ancient', 'asteroid'],
|
47
|
+
'0E' => ['apple', 'Atlantic'], '0F' => ['artist', 'atmosphere'],
|
48
|
+
'10' => ['assume', 'autopsy'], '11' => ['Athens', 'Babylon'],
|
49
|
+
'12' => ['atlas', 'backwater'], '13' => ['Aztec', 'barbecue'],
|
50
|
+
'14' => ['baboon', 'belowground'], '15' => ['backfield', 'bifocals'],
|
51
|
+
'16' => ['backward', 'bodyguard'], '17' => ['banjo', 'bookseller'],
|
52
|
+
'18' => ['beaming', 'borderline'], '19' => ['bedlamp', 'bottomless'],
|
53
|
+
'1A' => ['beehive', 'Bradbury'], '1B' => ['beeswax', 'bravado'],
|
54
|
+
'1C' => ['befriend', 'Brazilian'], '1D' => ['Belfast', 'breakaway'],
|
55
|
+
'1E' => ['berserk', 'Burlington'], '1F' => ['billiard', 'businessman'],
|
56
|
+
'20' => ['bison', 'butterfat'], '21' => ['blackjack', 'Camelot'],
|
57
|
+
'22' => ['blockade', 'candidate'], '23' => ['blowtorch', 'cannonball'],
|
58
|
+
'24' => ['bluebird', 'Capricorn'], '25' => ['bombast', 'caravan'],
|
59
|
+
'26' => ['bookshelf', 'caretaker'], '27' => ['brackish', 'celebrate'],
|
60
|
+
'28' => ['breadline', 'cellulose'], '29' => ['breakup', 'certify'],
|
61
|
+
'2A' => ['brickyard', 'chambermaid'], '2B' => ['briefcase', 'Cherokee'],
|
62
|
+
'2C' => ['Burbank', 'Chicago'], '2D' => ['button', 'clergyman'],
|
63
|
+
'2E' => ['buzzard', 'coherence'], '2F' => ['cement', 'combustion'],
|
64
|
+
'30' => ['chairlift', 'commando'], '31' => ['chatter', 'company'],
|
65
|
+
'32' => ['checkup', 'component'], '33' => ['chisel', 'concurrent'],
|
66
|
+
'34' => ['choking', 'confidence'], '35' => ['chopper', 'conformist'],
|
67
|
+
'36' => ['Christmas', 'congregate'], '37' => ['clamshell', 'consensus'],
|
68
|
+
'38' => ['classic', 'consulting'], '39' => ['classroom', 'corporate'],
|
69
|
+
'3A' => ['cleanup', 'corrosion'], '3B' => ['clockwork', 'councilman'],
|
70
|
+
'3C' => ['cobra', 'crossover'], '3D' => ['commence', 'crucifix'],
|
71
|
+
'3E' => ['concert', 'cumbersome'], '3F' => ['cowbell', 'customer'],
|
72
|
+
'40' => ['crackdown', 'Dakota'], '41' => ['cranky', 'decadence'],
|
73
|
+
'42' => ['crowfoot', 'December'], '43' => ['crucial', 'decimal'],
|
74
|
+
'44' => ['crumpled', 'designing'], '45' => ['crusade', 'detector'],
|
75
|
+
'46' => ['cubic', 'detergent'], '47' => ['dashboard', 'determine'],
|
76
|
+
'48' => ['deadbolt', 'dictator'], '49' => ['deckhand', 'dinosaur'],
|
77
|
+
'4A' => ['dogsled', 'direction'], '4B' => ['dragnet', 'disable'],
|
78
|
+
'4C' => ['drainage', 'disbelief'], '4D' => ['dreadful', 'disruptive'],
|
79
|
+
'4E' => ['drifter', 'distortion'], '4F' => ['dropper', 'document'],
|
80
|
+
'50' => ['drumbeat', 'embezzle'], '51' => ['drunken', 'enchanting'],
|
81
|
+
'52' => ['Dupont', 'enrollment'], '53' => ['dwelling', 'enterprise'],
|
82
|
+
'54' => ['eating', 'equation'], '55' => ['edict', 'equipment'],
|
83
|
+
'56' => ['egghead', 'escapade'], '57' => ['eightball', 'Eskimo'],
|
84
|
+
'58' => ['endorse', 'everyday'], '59' => ['endow', 'examine'],
|
85
|
+
'5A' => ['enlist', 'existence'], '5B' => ['erase', 'exodus'],
|
86
|
+
'5C' => ['escape', 'fascinate'], '5D' => ['exceed', 'filament'],
|
87
|
+
'5E' => ['eyeglass', 'finicky'], '5F' => ['eyetooth', 'forever'],
|
88
|
+
'60' => ['facial', 'fortitude'], '61' => ['fallout', 'frequency'],
|
89
|
+
'62' => ['flagpole', 'gadgetry'], '63' => ['flatfoot', 'Galveston'],
|
90
|
+
'64' => ['flytrap', 'getaway'], '65' => ['fracture', 'glossary'],
|
91
|
+
'66' => ['framework', 'gossamer'], '67' => ['freedom', 'graduate'],
|
92
|
+
'68' => ['frighten', 'gravity'], '69' => ['gazelle', 'guitarist'],
|
93
|
+
'6A' => ['Geiger', 'hamburger'], '6B' => ['glitter', 'Hamilton'],
|
94
|
+
'6C' => ['glucose', 'handiwork'], '6D' => ['goggles', 'hazardous'],
|
95
|
+
'6E' => ['goldfish', 'headwaters'], '6F' => ['gremlin', 'hemisphere'],
|
96
|
+
'70' => ['guidance', 'hesitate'], '71' => ['hamlet', 'hideaway'],
|
97
|
+
'72' => ['highchair', 'holiness'], '73' => ['hockey', 'hurricane'],
|
98
|
+
'74' => ['indoors', 'hydraulic'], '75' => ['indulge', 'impartial'],
|
99
|
+
'76' => ['inverse', 'impetus'], '77' => ['involve', 'inception'],
|
100
|
+
'78' => ['island', 'indigo'], '79' => ['jawbone', 'inertia'],
|
101
|
+
'7A' => ['keyboard', 'infancy'], '7B' => ['kickoff', 'inferno'],
|
102
|
+
'7C' => ['kiwi', 'informant'], '7D' => ['klaxon', 'insincere'],
|
103
|
+
'7E' => ['locale', 'insurgent'], '7F' => ['lockup', 'integrate'],
|
104
|
+
'80' => ['merit', 'intention'], '81' => ['minnow', 'inventive'],
|
105
|
+
'82' => ['miser', 'Istanbul'], '83' => ['Mohawk', 'Jamaica'],
|
106
|
+
'84' => ['mural', 'Jupiter'], '85' => ['music', 'leprosy'],
|
107
|
+
'86' => ['necklace', 'letterhead'], '87' => ['Neptune', 'liberty'],
|
108
|
+
'88' => ['newborn', 'maritime'], '89' => ['nightbird', 'matchmaker'],
|
109
|
+
'8A' => ['Oakland', 'maverick'], '8B' => ['obtuse', 'Medusa'],
|
110
|
+
'8C' => ['offload', 'megaton'], '8D' => ['optic', 'microscope'],
|
111
|
+
'8E' => ['orca', 'microwave'], '8F' => ['payday', 'midsummer'],
|
112
|
+
'90' => ['peachy', 'millionaire'], '91' => ['pheasant', 'miracle'],
|
113
|
+
'92' => ['physique', 'misnomer'], '93' => ['playhouse', 'molasses'],
|
114
|
+
'94' => ['Pluto', 'molecule'], '95' => ['preclude', 'Montana'],
|
115
|
+
'96' => ['prefer', 'monument'], '97' => ['preshrunk', 'mosquito'],
|
116
|
+
'98' => ['printer', 'narrative'], '99' => ['prowler', 'nebula'],
|
117
|
+
'9A' => ['pupil', 'newsletter'], '9B' => ['puppy', 'Norwegian'],
|
118
|
+
'9C' => ['python', 'October'], '9D' => ['quadrant', 'Ohio'],
|
119
|
+
'9E' => ['quiver', 'onlooker'], '9F' => ['quota', 'opulent'],
|
120
|
+
'A0' => ['ragtime', 'Orlando'], 'A1' => ['ratchet', 'outfielder'],
|
121
|
+
'A2' => ['rebirth', 'Pacific'], 'A3' => ['reform', 'pandemic'],
|
122
|
+
'A4' => ['regain', 'Pandora'], 'A5' => ['reindeer', 'paperweight'],
|
123
|
+
'A6' => ['rematch', 'paragon'], 'A7' => ['repay', 'paragraph'],
|
124
|
+
'A8' => ['retouch', 'paramount'], 'A9' => ['revenge', 'passenger'],
|
125
|
+
'AA' => ['reward', 'pedigree'], 'AB' => ['rhythm', 'Pegasus'],
|
126
|
+
'AC' => ['ribcage', 'penetrate'], 'AD' => ['ringbolt', 'perceptive'],
|
127
|
+
'AE' => ['robust', 'performance'], 'AF' => ['rocker', 'pharmacy'],
|
128
|
+
'B0' => ['ruffled', 'phonetic'], 'B1' => ['sailboat', 'photograph'],
|
129
|
+
'B2' => ['sawdust', 'pioneer'], 'B3' => ['scallion', 'pocketful'],
|
130
|
+
'B4' => ['scenic', 'politeness'], 'B5' => ['scorecard', 'positive'],
|
131
|
+
'B6' => ['Scotland', 'potato'], 'B7' => ['seabird', 'processor'],
|
132
|
+
'B8' => ['select', 'provincial'], 'B9' => ['sentence', 'proximate'],
|
133
|
+
'BA' => ['shadow', 'puberty'], 'BB' => ['shamrock', 'publisher'],
|
134
|
+
'BC' => ['showgirl', 'pyramid'], 'BD' => ['skullcap', 'quantity'],
|
135
|
+
'BE' => ['skydive', 'racketeer'], 'BF' => ['slingshot', 'rebellion'],
|
136
|
+
'C0' => ['slowdown', 'recipe'], 'C1' => ['snapline', 'recover'],
|
137
|
+
'C2' => ['snapshot', 'repellent'], 'C3' => ['snowcap', 'replica'],
|
138
|
+
'C4' => ['snowslide', 'reproduce'], 'C5' => ['solo', 'resistor'],
|
139
|
+
'C6' => ['southward', 'responsive'], 'C7' => ['soybean', 'retraction'],
|
140
|
+
'C8' => ['spaniel', 'retrieval'], 'C9' => ['spearhead', 'retrospect'],
|
141
|
+
'CA' => ['spellbind', 'revenue'], 'CB' => ['spheroid', 'revival'],
|
142
|
+
'CC' => ['spigot', 'revolver'], 'CD' => ['spindle', 'sandalwood'],
|
143
|
+
'CE' => ['spyglass', 'sardonic'], 'CF' => ['stagehand', 'Saturday'],
|
144
|
+
'D0' => ['stagnate', 'savagery'], 'D1' => ['stairway', 'scavenger'],
|
145
|
+
'D2' => ['standard', 'sensation'], 'D3' => ['stapler', 'sociable'],
|
146
|
+
'D4' => ['steamship', 'souvenir'], 'D5' => ['sterling', 'specialist'],
|
147
|
+
'D6' => ['stockman', 'speculate'], 'D7' => ['stopwatch', 'stethoscope'],
|
148
|
+
'D8' => ['stormy', 'stupendous'], 'D9' => ['sugar', 'supportive'],
|
149
|
+
'DA' => ['surmount', 'surrender'], 'DB' => ['suspense', 'suspicious'],
|
150
|
+
'DC' => ['sweatband', 'sympathy'], 'DD' => ['swelter', 'tambourine'],
|
151
|
+
'DE' => ['tactics', 'telephone'], 'DF' => ['talon', 'therapist'],
|
152
|
+
'E0' => ['tapeworm', 'tobacco'], 'E1' => ['tempest', 'tolerance'],
|
153
|
+
'E2' => ['tiger', 'tomorrow'], 'E3' => ['tissue', 'torpedo'],
|
154
|
+
'E4' => ['tonic', 'tradition'], 'E5' => ['topmost', 'travesty'],
|
155
|
+
'E6' => ['tracker', 'trombonist'], 'E7' => ['transit', 'truncated'],
|
156
|
+
'E8' => ['trauma', 'typewriter'], 'E9' => ['treadmill', 'ultimate'],
|
157
|
+
'EA' => ['Trojan', 'undaunted'], 'EB' => ['trouble', 'underfoot'],
|
158
|
+
'EC' => ['tumor', 'unicorn'], 'ED' => ['tunnel', 'unify'],
|
159
|
+
'EE' => ['tycoon', 'universe'], 'EF' => ['uncut', 'unravel'],
|
160
|
+
'F0' => ['unearth', 'upcoming'], 'F1' => ['unwind', 'vacancy'],
|
161
|
+
'F2' => ['uproot', 'vagabond'], 'F3' => ['upset', 'vertigo'],
|
162
|
+
'F4' => ['upshot', 'Virginia'], 'F5' => ['vapor', 'visitor'],
|
163
|
+
'F6' => ['village', 'vocalist'], 'F7' => ['virus', 'voyager'],
|
164
|
+
'F8' => ['Vulcan', 'warranty'], 'F9' => ['waffle', 'Waterloo'],
|
165
|
+
'FA' => ['wallet', 'whimsical'], 'FB' => ['watchword', 'Wichita'],
|
166
|
+
'FC' => ['wayside', 'Wilmington'], 'FD' => ['willow', 'Wyoming'],
|
167
|
+
'FE' => ['woodlark', 'yesteryear'], 'FF' => ['Zulu', 'Yucatan']
|
168
|
+
}
|
169
|
+
end
|
170
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pgp-word-list
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Warren Guy
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: PGP word list gem
|
14
|
+
email: warren@guy.net.au
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- README.md
|
20
|
+
- lib/pgp-word-list.rb
|
21
|
+
homepage: https://github.com/warrenguy/ruby-pgp-word-list
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.2.2
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: PGP word list gem
|
45
|
+
test_files: []
|