passphrase 0.0.1 → 0.0.2
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.
- data/README.rdoc +9 -5
- data/VERSION +1 -1
- data/lib/passphrase/options.rb +2 -2
- data/lib/passphrase/random.rb +2 -1
- data/lib/passphrase/version.rb +1 -1
- metadata +11 -7
data/README.rdoc
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
= passphrase
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
Trying to come up with a good passphrase when creating an SSH public key pair
|
4
|
+
or when signing up for an online service is a pain. Typical password generators
|
5
|
+
yield a string of random characters which is secure but is hard to type. The
|
6
|
+
{Diceware method}[http://world.std.com/~reinhold/diceware.html] constructs a
|
7
|
+
passphrase made up of more-or-less recognizable words. This makes it easier to
|
8
|
+
type, while still being reasonably secure. Passphrase is a command line tool
|
9
|
+
written in Ruby for generating a passphrase using the Diceware method.
|
5
10
|
|
6
11
|
The act of rolling dice is simulated by requesting random numbers from
|
7
12
|
{www.random.org}[http://www.random.org]. If a network error occurs or a request
|
8
|
-
fails, the program gracefully degenerates to using
|
9
|
-
which is based on the Mersenne Twister algorithm.
|
13
|
+
fails, the program gracefully degenerates to using SecureRandom::random_number.
|
10
14
|
|
11
15
|
Words in the generated passphrase are selected from either the Diceware list or
|
12
16
|
the alternate list edited by Alan Beale, referred to as the _Beale_ list. The
|
@@ -18,7 +22,7 @@ code as compressed, base64 encoded strings. No external files are referenced.
|
|
18
22
|
The command line interface is simple. You have the option to specify the number
|
19
23
|
of words in the generated passphrase within the range of 3 to 10. The default
|
20
24
|
is 5. One _odd_ character is automatically mixed into one of the words
|
21
|
-
comprising the passphrase. You can
|
25
|
+
comprising the passphrase. You can omit mixing if desired.
|
22
26
|
|
23
27
|
Usage: passphrase [options]
|
24
28
|
Options:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/passphrase/options.rb
CHANGED
@@ -37,7 +37,7 @@ module Passphrase
|
|
37
37
|
exit
|
38
38
|
end
|
39
39
|
opts.on_tail("-v", "--version", "Show version") do
|
40
|
-
puts "#{$PROGRAM_NAME}, version #{Passphrase::Version::STRING}"
|
40
|
+
puts "#{File.basename($PROGRAM_NAME)}, version #{Passphrase::Version::STRING}"
|
41
41
|
exit
|
42
42
|
end
|
43
43
|
|
@@ -52,7 +52,7 @@ module Passphrase
|
|
52
52
|
|
53
53
|
def validate
|
54
54
|
unless NUM_WORDS_RANGE.include?(@num_words)
|
55
|
-
STDERR.puts "Number of words out of range: allowed #{
|
55
|
+
STDERR.puts "Number of words out of range: allowed #{NUM_WORDS_RANGE.to_s}: specified #{@num_words}"
|
56
56
|
exit(1)
|
57
57
|
end
|
58
58
|
end
|
data/lib/passphrase/random.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'net/http'
|
4
|
+
require 'securerandom'
|
4
5
|
|
5
6
|
module Passphrase
|
6
7
|
class Random
|
@@ -33,7 +34,7 @@ module Passphrase
|
|
33
34
|
max = @max - @min + 1
|
34
35
|
offset = @min
|
35
36
|
@num.times do
|
36
|
-
@rand_array << (
|
37
|
+
@rand_array << (SecureRandom.random_number(max) + offset)
|
37
38
|
end
|
38
39
|
@via_random_org = false
|
39
40
|
end
|
data/lib/passphrase/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: passphrase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Edmund Sumbar
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-01-
|
13
|
+
date: 2011-01-22 00:00:00 -07:00
|
14
14
|
default_executable: passphrase
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -38,13 +38,17 @@ dependencies:
|
|
38
38
|
description: |+
|
39
39
|
= passphrase
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
Trying to come up with a good passphrase when creating an SSH public key pair
|
42
|
+
or when signing up for an online service is a pain. Typical password generators
|
43
|
+
yield a string of random characters which is secure but is hard to type. The
|
44
|
+
{Diceware method}[http://world.std.com/~reinhold/diceware.html] constructs a
|
45
|
+
passphrase made up of more-or-less recognizable words. This makes it easier to
|
46
|
+
type, while still being reasonably secure. Passphrase is a command line tool
|
47
|
+
written in Ruby for generating a passphrase using the Diceware method.
|
43
48
|
|
44
49
|
The act of rolling dice is simulated by requesting random numbers from
|
45
50
|
{www.random.org}[http://www.random.org]. If a network error occurs or a request
|
46
|
-
fails, the program gracefully degenerates to using
|
47
|
-
which is based on the Mersenne Twister algorithm.
|
51
|
+
fails, the program gracefully degenerates to using SecureRandom::random_number.
|
48
52
|
|
49
53
|
Words in the generated passphrase are selected from either the Diceware list or
|
50
54
|
the alternate list edited by Alan Beale, referred to as the _Beale_ list. The
|
@@ -56,7 +60,7 @@ description: |+
|
|
56
60
|
The command line interface is simple. You have the option to specify the number
|
57
61
|
of words in the generated passphrase within the range of 3 to 10. The default
|
58
62
|
is 5. One _odd_ character is automatically mixed into one of the words
|
59
|
-
comprising the passphrase. You can
|
63
|
+
comprising the passphrase. You can omit mixing if desired.
|
60
64
|
|
61
65
|
Usage: passphrase [options]
|
62
66
|
Options:
|