Library for generating secure passwords from within Emacs. Simple and intuitive; see Example
Linux, BSD, macOS, and other Unix-like systems only until I can find a way to fetch sufficiently random characters from Emacs for Windows (see Built-in pseudo-random number generator).
(pwdgen length with-chars &optional without-chars)
Call the pwdgen
function from Lisp or the Eshell to generate a secure password of length
characters using the characters with-chars
, optionally excluding the characters in without-chars
. You can use regex character alternative notation for with-chars
and without-chars
. Like so:
(pwdgen 32 "A-Za-z0-9") ; Generate a 32-character password with only alphanumeric characters
⇒ "6sud2B3eRTcGWnS8ttOBJaS0YfJyKVWm"
(pwdgen 16 "!-~" "A-Za-z") ; Generate a 16-character password using all printable ASCII characters EXCEPT letters
⇒ "!,*#':3_$~8;'0|]"
See the documentation of the pwdgen
function for more details.
If you use the amazing Eshell, pwdgen
acts like other command-line password generators:
~ $ pwdgen 32 A-Za-z0-9
MYHdBLc9P7l3GPRPMNnj2IoQJVB5T3k9
~ $ pwdgen 16 "!-~" A-Za-z
/1&]-%(/#"79@#[>