-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Diceware passwords are easier to remember and communicate : https://github.com/holizz/diceware/ via https://firstlook.org/theintercept/2015/03/26/passphrases-can-memorize-attackers-cant-guess/ We could improve the entropy per character by removing numbers and symbols from the wordlist, and randomly adding them as delimiters instead.
- Loading branch information
Showing
7 changed files
with
15,688 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package diceware | ||
|
||
import ( | ||
"io" | ||
"math/big" | ||
"crypto/rand" | ||
"strings" | ||
) | ||
|
||
func DicewareWords(r io.Reader, delim string, count int) string { | ||
l := big.NewInt(int64( len(diceware_words) )); | ||
words := []string{} | ||
for i := 0; i < count; i++ { | ||
j,err := rand.Int(r,l) | ||
if err != nil { | ||
panic("error reading from rand: " + err.Error()) | ||
} | ||
words = append(words, diceware_words[j.Int64()]) | ||
} | ||
return strings.Join(words, delim) | ||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"crypto/rand" | ||
"github.com/agl/pond/diceware" | ||
) | ||
|
||
func main() { | ||
fmt.Println(diceware.DicewareWords(rand.Reader," ",6)) | ||
} | ||
|
Oops, something went wrong.