passphrase 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +5 -1
- data/CHANGELOG.md +5 -1
- data/README.md +85 -74
- data/lib/passphrase/default.rb +4 -4
- data/lib/passphrase/version.rb +1 -1
- data/spec/passphrase/passphrase_spec.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6839c4a93fcaa7b8ab1b15bcc1e5008f00167dde
|
4
|
+
data.tar.gz: 155d75784ec0a430721e6d9521c1e33eff210e12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df27ed521cffb79b6c04ce4267d7c4162dcb71ea64448794bf240217bb3b1ae586805dab230c86733a86ffc48dc00d00c667354fba298001bb98a672e5046a64
|
7
|
+
data.tar.gz: fd8a89985fce259dfd1041fbb5da86af009af52ed66370aaaab8e2ea2512d53bb6556ba9f057c881f9313a86e2957ebf3e15378240d89a4ebadf31a27795d63a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,5 @@
|
|
1
|
-
|
1
|
+
-K�Im:���XQ����
|
2
|
+
G �8ڢN��N�f���0�j~�KX��]mK��^�k��Q
|
3
|
+
�|�a?�(��pe�30�g�4
|
4
|
+
s����ިu���6�O�����yE3p
|
5
|
+
ɸ��$�Ϥ�N^45��Tb�Y��w\W#�\LbK
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
All notable changes to this project will be documented in this file. This
|
3
3
|
project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
-
##
|
5
|
+
## Version 1.2.1 - 2015-04-19
|
6
|
+
### Changed
|
7
|
+
- Updated documentation in the README file.
|
8
|
+
|
9
|
+
## Version 1.2.0 - 2015-04-17
|
6
10
|
### Added
|
7
11
|
- List available languages.
|
8
12
|
- Added option `--languages|-l` to select a subset of languages.
|
data/README.md
CHANGED
@@ -2,26 +2,23 @@
|
|
2
2
|
Use Passphrase to generate a passphrase for SSH or GPG keys. For example, on
|
3
3
|
the command-line, run
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
```
|
5
|
+
$ passphrase --num-words=4
|
6
|
+
dokusi uolgo allunga totalisa
|
7
|
+
|
9
8
|
or programmatically,
|
10
9
|
|
11
|
-
|
10
|
+
~~~ruby
|
12
11
|
require "passphrase"
|
13
12
|
p = Passphrase::Passphrase.new(number_of_words: 4)
|
14
13
|
passphrase = p.passphrase
|
15
|
-
|
14
|
+
~~~
|
16
15
|
|
17
16
|
Passphrase also has the capability to generate passwords (indirectly).
|
18
17
|
|
19
18
|
## Installation
|
20
19
|
The Passphrase command-line tool and library can be installed with
|
21
20
|
|
22
|
-
|
23
|
-
$ gem install passphrase
|
24
|
-
```
|
21
|
+
$ gem install passphrase
|
25
22
|
|
26
23
|
However, because the gem is cryptographically signed to prevent tampering, the
|
27
24
|
preferred installation command should include the `--trust-policy` security
|
@@ -29,15 +26,11 @@ option, which causes the gem to be verified before being installed. To invoke
|
|
29
26
|
this option, you must first add my public key `esumbar.pem` to your list of
|
30
27
|
trusted certificates, as follows.
|
31
28
|
|
32
|
-
|
33
|
-
$ gem cert --add <(curl -Ls https://raw.githubusercontent.com/esumbar/passphrase/master/certs/esumbar.pem)
|
34
|
-
```
|
29
|
+
$ gem cert --add <(curl -Ls https://raw.githubusercontent.com/esumbar/passphrase/master/certs/esumbar.pem)
|
35
30
|
|
36
31
|
Finally, specify the appropriate security level when installing.
|
37
32
|
|
38
|
-
|
39
|
-
$ gem install passphrase --trust-policy MediumSecurity
|
40
|
-
```
|
33
|
+
$ gem install passphrase --trust-policy MediumSecurity
|
41
34
|
|
42
35
|
Using `MediumSecurity` rather than `HighSecurity` omits dependent gems that
|
43
36
|
are not signed from the verification process. Passphrase depends on the
|
@@ -46,50 +39,71 @@ unsigned gem `sqlite3`.
|
|
46
39
|
## Basic usage
|
47
40
|
### Command-line tool
|
48
41
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
$
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
$
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
$
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
$
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
$
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
42
|
+
$ passphrase --help
|
43
|
+
Usage: passphrase [options]
|
44
|
+
-l, --languages=LANG1,... Specify languages to use, none for a listing
|
45
|
+
(default: --languages=all)
|
46
|
+
-n, --num-words=NUM Number of words in passphrase 3..10
|
47
|
+
(default: --num-words=5)
|
48
|
+
-p, --[no-]passwordize Add one cap, one num, and one special char
|
49
|
+
(default: --no-passwordize)
|
50
|
+
-r, --[no-]random-org Use RANDOM.ORG to generate random numbers
|
51
|
+
(default: --no-random-org)
|
52
|
+
-h, --help Show this message
|
53
|
+
-v, --version Show version
|
54
|
+
|
55
|
+
$ # generate a passphrase using default settings
|
56
|
+
$ passphrase
|
57
|
+
sinmak termyne ismus affidavo recur
|
58
|
+
|
59
|
+
$ # generate a four-word passphrase
|
60
|
+
$ passphrase -n4
|
61
|
+
apaisado vermouth seemag ebelik
|
62
|
+
|
63
|
+
$ # generate a passphrase using only English and Spanish words
|
64
|
+
$ passphrase --languages=english,spanish
|
65
|
+
fumada hearsay murcio phosphor azufroso
|
66
|
+
|
67
|
+
$ # generate a three-word Polish passphrase and password
|
68
|
+
$ passphrase -lp -n3 -p
|
69
|
+
podejrza zmalala wypadkow
|
70
|
+
8odej=za_Xmalala_wypadkow
|
71
|
+
|
72
|
+
$ # list the available languages
|
73
|
+
$ passphrase -l
|
74
|
+
afrikaans
|
75
|
+
croatian
|
76
|
+
czech
|
77
|
+
diceware
|
78
|
+
english
|
79
|
+
finnish
|
80
|
+
french
|
81
|
+
italian
|
82
|
+
japanese
|
83
|
+
latin
|
84
|
+
norwegian
|
85
|
+
polish
|
86
|
+
spanish
|
87
|
+
swedish
|
88
|
+
turkish
|
89
89
|
|
90
90
|
### Ruby library
|
91
|
+
Initialize a Passphrase object with
|
92
|
+
|
93
|
+
~~~ruby
|
94
|
+
Passphrase::Passphrase.new(options={})
|
95
|
+
~~~
|
96
|
+
|
97
|
+
The following options are accepted.
|
98
|
+
|
99
|
+
* `:languages` - array of languages from which to select words
|
100
|
+
(default: `["all"]`)
|
101
|
+
* `:number_of_words` - number of words to select (default: `5`)
|
102
|
+
* `:use_random_org` - source random numbers from RANDOM.ORG (default: `false`)
|
103
|
+
|
104
|
+
For example,
|
91
105
|
|
92
|
-
|
106
|
+
~~~ruby
|
93
107
|
require "passphrase"
|
94
108
|
|
95
109
|
# generate a passphrase with default options
|
@@ -110,8 +124,8 @@ Passphrase::Passphrase.new(number_of_words: 6) do |p|
|
|
110
124
|
passphrase_array.map! { |array_element| p.generate.passphrase }
|
111
125
|
end
|
112
126
|
|
113
|
-
# generate a passphrase using only French and Italian words
|
114
|
-
options = {
|
127
|
+
# generate a four-word passphrase using only French and Italian words
|
128
|
+
options = { languages: %w( fr italian ), number_of_words: 4 }
|
115
129
|
p = Passphrase::Passphrase.new(options)
|
116
130
|
passphrase = p.passphrase
|
117
131
|
|
@@ -119,7 +133,7 @@ passphrase = p.passphrase
|
|
119
133
|
p = Passphrase::Passphrase.new(number_of_words: 3)
|
120
134
|
passphrase = p.passphrase
|
121
135
|
password = passphrase.to_password
|
122
|
-
|
136
|
+
~~~
|
123
137
|
|
124
138
|
## Background
|
125
139
|
### Diceware Method
|
@@ -186,10 +200,9 @@ network access, it is susceptible to network problems, and is also slower.
|
|
186
200
|
|
187
201
|
### Subset of languages
|
188
202
|
By default, Passphrase randomly selects words from the collection of available
|
189
|
-
languages. If desired, the selection can be
|
190
|
-
|
191
|
-
|
192
|
-
two letters of a language name, just enough to avoid ambiguity.
|
203
|
+
languages. If desired, the selection can be restricted to a subset. This can
|
204
|
+
be done on the command-line and in code by supplying a list of language names.
|
205
|
+
The names can be abbreviated to the first letter (or two, to avoid ambiguity).
|
193
206
|
|
194
207
|
### Passwords
|
195
208
|
A typical passphrase will not satisfy password policies that require the use
|
@@ -214,17 +227,15 @@ compliment of 7776 entries.
|
|
214
227
|
To run the command-line tool within the repository directory, try `ruby -Ilib
|
215
228
|
bin/passphrase`. You can also experiment with the library in irb. For example,
|
216
229
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
=> {:passphrase=>"obstrua lamparos orgy forerez deduce", ... }
|
227
|
-
```
|
230
|
+
$ irb -Ilib -rpassphrase
|
231
|
+
>> p = Passphrase::Passphrase.new(number_of_words: 3)
|
232
|
+
=> {:passphrase=>"jazzy vannier viscount", :number_of_words=>3, ... }
|
233
|
+
>> p.passphrase
|
234
|
+
=> "jazzy vannier viscount"
|
235
|
+
>> p.passphrase.to_password
|
236
|
+
=> "jazz{_2annier_vBscount"
|
237
|
+
>> p = Passphrase::Passphrase.new(languages: ["e", "fr"])
|
238
|
+
=> {:passphrase=>"obstrua lamparos orgy forerez deduce", ... }
|
228
239
|
|
229
240
|
Run the tests with `rake spec`.
|
230
241
|
|
data/lib/passphrase/default.rb
CHANGED
@@ -4,8 +4,8 @@ module Passphrase
|
|
4
4
|
# specified for a passphrase on the command-line.
|
5
5
|
class Default
|
6
6
|
class << self
|
7
|
-
# @return [Hash] the default options
|
8
|
-
#
|
7
|
+
# @return [Hash] the default options used to instantiate a {Passphrase}
|
8
|
+
# object
|
9
9
|
attr_reader :options
|
10
10
|
# @return [Range] an arbitrary range specifying the allowable number of
|
11
11
|
# words in a passphrase, referenced by the {CLI.parse} method
|
@@ -15,8 +15,8 @@ module Passphrase
|
|
15
15
|
@options = {
|
16
16
|
languages: ["all"],
|
17
17
|
number_of_words: 5,
|
18
|
-
passwordize:
|
19
|
-
use_random_org:
|
18
|
+
passwordize: false, # only relevant in {CLI.parse}
|
19
|
+
use_random_org: false
|
20
20
|
}
|
21
21
|
@number_range = (3..10)
|
22
22
|
end
|
data/lib/passphrase/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passphrase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Sumbar
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
aoKZhUfRmAZDUgzW4PMtMxO34fQDbDYevBzMcxmkHNDs87ROMOuPLWJGLcKpgGwJ
|
31
31
|
TxzUtBfb7E+Qa/wyo0Ws7A==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-04-
|
33
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: sqlite3
|
metadata.gz.sig
CHANGED
Binary file
|