Title: | A Diceware Passphrase Implementation |
---|---|
Description: | The Diceware method can be used to generate strong passphrases. In short, you roll a 6-faced dice 5 times in a row, the number obtained is matched against a dictionary of easily remembered words. By combining together 7 words thus generated, you obtain a password that is relatively easy to remember, but would take several millions years (on average) for a powerful computer to guess. |
Authors: | Francois Michonneau [aut, cre], Arnold G. Reinhold [cph] |
Maintainer: | Francois Michonneau <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.6 |
Built: | 2024-11-05 02:56:11 UTC |
Source: | https://github.com/fmichonneau/riceware |
Checks the validity of the token.
check_token(token)
check_token(token)
token |
a character vector of length 1 representing the outcomes of 5 rolls of a dice. |
The token is a 5-digit number representing the outcomes of 5 rolls
of a 6-faced dice. The function returns TRUE
if the
token
is correctly formatted and FALSE
otherwise.
TRUE
if correctly formatted, FALSE
otherwise.
Francois Michonneau
Generates a passphrase.
generate_passphrase(tokens = generate_token(7), verbose = TRUE, ...)
generate_passphrase(tokens = generate_token(7), verbose = TRUE, ...)
tokens |
a vector of character representing the tokens to be
used to generate the passphrase. By default, 7 are randomly
generated using |
verbose |
if |
... |
additional parameters to be passed to |
Given a wordlist and a number of words, this function generates a
passphrase. You can control the wordlist you choose and whether
the passphrase uses title case by providing additional arguments
that will be passed to match_token
.
a character string representing the passphrase
Francois Michonneau
generate_passphrase(tokens = generate_token(7, "pseudorandom"), verbose = FALSE)
generate_passphrase(tokens = generate_token(7, "pseudorandom"), verbose = FALSE)
Generates the tokens.
generate_token(n_words, method = c("pseudorandom", "random"))
generate_token(n_words, method = c("pseudorandom", "random"))
n_words |
The number of tokens to generate. |
method |
The method used to draw the random numbers. See below for more details. |
This function generates as many tokens as needed to create the passphrase. Currently, two methods can be used to generate the random tokens.
The simplest and the default (pseudorandom
) uses the
function sample
to simulate the dice rolls. Numbers
generated this way are not truly random but are a decent
approximation.
The other option (random
) uses the random
package
that gets truly random numbers by converting atmospheric noise
into numbers. The main issue is that someone could monitor your
network and intercept the numbers that are being used. If you are
concerned about this, use a physical dice.
Note that if you want to use the random
method, you will
need an internet connection. The service that provides these
random numbers (http://www.random.org) has daily quotas,
don't go too crazy (if you need to, you can purchase additional
bits, see http://www.random.org/quota).
A character vector representing the generated tokens.
Francois Michonneau
http://www.random.org the website that generates the true random numbers, and the random package from Dirk Eddelbuettel.
Retrieves the word corresponding to a given token.
match_token(token, wordlist = riceware::wordlist_en, title_case = TRUE)
match_token(token, wordlist = riceware::wordlist_en, title_case = TRUE)
token |
A correctly formatted token |
wordlist |
A |
title_case |
If |
Given a token and a list of words, this function returns the word matching the supplied token.
A character vector of length 1 representing the word corresponding to the token.
Francois Michonneau
The German Diceware word list as provided at http://world.std.com/~reinhold/diceware_german.txt. This list is provided by Benjamin Tenne under the terms of the GNU General Public License.
wordlist_de
wordlist_de
A data.frame
with 2 columns: token
a 5-digit
number representing the results of 5 rolls of a dice, word
the Diceware word corresponding to the dice rolls.
The English Diceware word list as provided at http://world.std.com/~reinhold/diceware.wordlist.asc. To the extent that a word list is protected by copyright, A G Reinhold licenses its rights to the English Diceware Wordlist under the Creative Commons CC-BY 3.0 license. Diceware is a trademark of Arnold G. Reinhold.
wordlist_en
wordlist_en
A data.frame
with 2 columns: token
a 5-digit
number representing the results of 5 rolls of a dice, word
the Diceware word corresponding to the dice rolls.
The Spanish Diceware word list as provided at http://world.std.com/~reinhold/diceware_espanol/DW-Espanol-1.txt. This list is provided by Manuel Palao, CISM, CISA ([email protected]) under the terms of the GNU General Public License.
wordlist_es
wordlist_es
A data.frame
with 2 columns: token
a 5-digit
number representing the results of 5 rolls of a dice, word
the Diceware word corresponding to the dice rolls.
The French Diceware list as provided at http://weber.fi.eu.org/software/diceware/src/francais.wordlist.asc. This list is provided by Matthieu Weber, no licensing information is provided.
wordlist_fr
wordlist_fr
A data.frame
with 2 columns: token
a 5-digit
number representing the results of 5 rolls of a dice, word
the Diceware word corresponding to the dice rolls.
The Italian Diceware list as provided at http://www.taringamberini.com/download/diceware_it_IT/word_list_diceware_in_italiano.txt. This list is provided by Tarin Gamberini under a GNU General Public License.
wordlist_it
wordlist_it
A data.frame
with 2 columns: token
a 5-digit
number representing the results of 5 rolls of a dice, word
the Diceware word corresponding to the dice rolls.
The Japanese Diceware list as provided at http://s3.amazonaws.com/dotclue.org/diceware_jp.txt translated by Hiroshi Yuki, and provided in Romaji by J Greely. No license information provided.
wordlist_jp
wordlist_jp
A data.frame
with 2 columns: token
a 5-digit
number representing the results of 5 rolls of a dice, word
the Diceware word corresponding to the dice rolls.
The Swedish Diceware list as provided at http://x42.com/diceware/diceware-sv.txt provided by by Magnus Bodin. No license information provided.
wordlist_sv
wordlist_sv
A data.frame
with 2 columns: token
a 5-digit
number representing the results of 5 rolls of a dice, word
the Diceware word corresponding to the dice rolls.