ibsenphrase 0.1.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 +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +73 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/data/wordlists/originaler.txt +18330 -0
- data/data/wordlists/test +3 -0
- data/data/wordlists/words +8504 -0
- data/ibsenphrase.gemspec +41 -0
- data/lib/ibsenphrase/generator.rb +55 -0
- data/lib/ibsenphrase/random.rb +12 -0
- data/lib/ibsenphrase/version.rb +3 -0
- data/lib/ibsenphrase/wordlist.rb +38 -0
- data/lib/ibsenphrase.rb +12 -0
- data/util/make-words.rb +19 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cda6f764c81a8b33cfe972e8b765cbbd853c6c3d
|
4
|
+
data.tar.gz: 88136512cf92f5c30f8e56a4ba6b8182d951a7bb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2ddc026f50d78e9929eadd7dab1ed33d4fe84bb4e675c86be2599cef04084ddd6a68b849e258c4279a79168c95ae651af87524f17e3f530d6b4d8d418412c332
|
7
|
+
data.tar.gz: 16934d046fb742081730231f6da957b1aee595f0263c38e988c92c7f1d00d4348695b4b4d403ef10446d2bba9197c0b21711f473e2cd0240a38a12a26e28cdc8
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Sigve Indregard
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Ibsenphrase
|
2
|
+
|
3
|
+
Passphrases consisting of several words chained together are popular. They are easier to remember and harder to crack. But generating them in your mind is not a good idea – humans have no random number generator, and will inevitably pick passphrases with a non-random sequence.
|
4
|
+
|
5
|
+
The most popular method of creating such passphrases is Diceware, a wordlist of 7776 (that is 6^5) english words, numbered with five digits between 1 and 6, making it easy to pick random words by throwing a die five times.
|
6
|
+
|
7
|
+
But sometimes, the passphrase needs to be made programmatically. This generator uses a wordlist compiled from the original plays by Henrik Ibsen. The wordlist is comprised of more than 8500 words, which is more than the original Diceware wordlist. The words are not pruned for length, so there are many hard and long words in the list.
|
8
|
+
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'ibsenphrase'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install ibsenphrase
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
Ibsenphrase is a library for other programs. First, load it:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'ibsenphrase'
|
32
|
+
```
|
33
|
+
|
34
|
+
And then it can be used:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
Ibsenphrase::Generator.passphrase
|
38
|
+
|
39
|
+
# The returned string will obviously vary, but will have this format
|
40
|
+
# => "genstande svundne vogt skibsdækket silkesejlet stilladserne snygt"
|
41
|
+
```
|
42
|
+
|
43
|
+
You can change the number of words from the default of 7 by passing an integer:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
Ibsenphrase::Generator.passphrase(3)
|
47
|
+
# => "skrifter strækker hverdagsmennesker"
|
48
|
+
```
|
49
|
+
|
50
|
+
You can also get capitalized passphrase strings instead of spaced-out:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
Ibsenphrase::Generator.passphrase(5, separation: :capitalize)
|
54
|
+
# => "LånegodsFængsletMenneskeneFlødGram"
|
55
|
+
```
|
56
|
+
|
57
|
+
For anyone who knows that your password scheme is an Ibsenphrase, the complexity of cracking it is _solely_ the number of words chosen. A passphrase length of 3 gives "only" about 600 000 000 000 possibilities, which is within reach for anyone interested in cracking it. A length of 5 gives about 45 * 10^18 possibilities, which would be very, very time-consuming to crack.
|
58
|
+
|
59
|
+
## Development
|
60
|
+
|
61
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
62
|
+
|
63
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
64
|
+
|
65
|
+
## Contributing
|
66
|
+
|
67
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sigvei/ibsenphrase.
|
68
|
+
|
69
|
+
|
70
|
+
## License
|
71
|
+
|
72
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
73
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "ibsenphrase"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|