knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

Travis-CI Build Status Coverage Status CRAN RStudio mirror downloads

riceware :rice:

Diceware is a method to generate robust passphrases. The idea is simple, you roll a 6-faced dice 5 times. Each time you record the number it gives you, and you obtain a string of numbers that looks like 61353. diceware.com provides a list of 7776 words that corresponds to all the possible results of these 5 rolls. If you pick up a passphrase made up of 7 words (i.e., you roll the dice 7 x 5 = 35 times), there are 7776^7 = 1.719e+27 possibilities. At 1 trillion guesses a second, it would take an average of 27 million years to find the correct passphrase. Not bad.

This package provides a way to generate this passphrase automatically. If you need a quick passphrase you can just type generate_passphrase() to generate a 7-word passphrase.

By default, the package uses the sample function which relies on pseudorandom numbers. You can use true random numbers by using:

library(riceware)

```{.r, eval=FALSE} generate_passphrase(tokens = generate_token(n_words = 7, method = "random"))

or with pipes:

7 %>% generate_token(method = "random") %>% generate_passphrase

> Your passphrase is: Indies Dna Check C Foxy Aid Gimpy

> [1] "IndiesDnaCheckCFoxyAidGimpy"

With this approach, the tokens are generated from truly random numbers using the
[random.org](http://www.random.org) website (using the
[random package](http://cran.r-project.org/package=random), by
[Dirk Eddelbuettel](http://dirk.eddelbuettel.com/)). These numbers are converted
from atmospheric noise and are truly random. However, if you are really concerned
about security, this is not perfect as the numbers are transfered without any
form of encryption on the network. Rolling a physical dice is a more robust
approach. If you rolled your dice 15 times to generate 3 words, you generate
your passphrase like this:

```r
generate_passphrase(tokens = c("52126", "52215", "52222"))

Other languages

In addition of English, riceware provides wordlists in:

generate_passphrase(tokens = c("34454"), wordlist = wordlist_de,
                    title_case = TRUE, verbose = FALSE)
generate_passphrase(tokens = c("35622"), wordlist = wordlist_es,
                    title_case = TRUE, verbose = FALSE)
generate_passphrase(tokens = c("21631"), wordlist = wordlist_fr,
                    title_case = TRUE, verbose = FALSE)
generate_passphrase(tokens = c("32141"), wordlist = wordlist_it,
                    title_case = TRUE, verbose = FALSE)
generate_passphrase(tokens = c("44565"), wordlist = wordlist_jp,
                    title_case = TRUE, verbose = FALSE)
generate_passphrase(tokens = c("33343"), wordlist = wordlist_sv,
                    title_case = TRUE, verbose = FALSE)

installation

install.packages("devtools")
devtools::install_github("fmichonneau/riceware")
library(riceware)


fmichonneau/riceware documentation built on Feb. 9, 2021, 2:59 p.m.