I have a lot of projects that will take ages to finish (some are in such poor shape that I tuck them away in private repositories, so no one can see my shame).  So sometimes it’s nice to just take a weekend and crank out something start to finish, even if it’s dumb and no one cares about it and fewer people want it.  Which brings us to the matter at hand.  There’s a relatively famous XKCD comic that argues that if you want a password that’s easy to remember, you should combine a random set of words together to create a nonsensical, but easily remembered phrase.

Panels from the comic Password Strength

So I created this dumb thing. It’s an R package which will create this sort of portmanteau password by randomly selecting words from random web scrapes of Wikipedia.  It basically works like this; you have a function password().  Its arguments are:

• pw.len; the number of words to use in the portmanteau password (in the XKCD example, the number is 4).  The default is 4.
• min.len; the minimum length of any given word in the portmanteau.  The default is 4.
• max.len; the maximum length of any given word in the portmanteau.  The default is 12.
• language; exactly what it looks like.  Default is “english”; others which are supported are french, german, italian, polish, portugese, russian, and spanish.  Each of these includes the “native character” spelling, assuming your terminal supports unicode.  So for example, “усский” is an acceptable option for “russian”.  I’ve been told that collection of symbols means “russian”, anyway.  If it doesn’t, blame the internet.
• num.scrapes; the number of different, random wikipedia pages to pull from.  Increasing this should increase the strength of the password, but it has a hard max of 5, because repeated use with more than that would be rude and is likely to get you ip banned from Wikipedia.
• ret.type; “separate” or “combined”.  Determines whether the returned password is, in the case of the former, a character vector with one entry per word (easier to read), or in the case of the latter, a collapsed, camel-case, portmanteau.  Default is “separate”.

So for example:

library(xkcdpw)

#[1] "United"  "Species" "Diamond" "Chloe"
#[1] "EarlyAccordingElectedPhysicians"

library(devtools)