Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-diceware Reference Manual, version 1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 12:13:30 2020 GMT+0.
• Introduction | What cl-diceware is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
This is a Common Lisp implementation of the Diceware passphrase generation algorithm.
You can find a description of the algorithm at http://diceware.com
MIT license in LICENSE, and at the bottom of source files.
It's a lot more effort to get cryptographically secure random numbers in Windows, so I didn't bother.
Pretty standard lisp package. System definition in cl-diceware.asd.
Tested in Clozure Common Lisp (CCL) and Steel Bank Common Lisp (SBCL).
The "diceware" file is a bash script to print passphrases in a shell.
;; Run in CCL (assuming "ccl" will start the lisp).
./diceware [<count>]
;; Run in SBCL
LISP=sbcl ./diceware [<count>]
;; Run in other lisp
LISP=whatever LISP_OPTIONS="--noprint options" ./diceware [<count>]
<count> defaults to 5. Non-integer , e.g. "-h" or "--help", prints help.
;; Use /dev/random instead of the default of /dev/urandom
;; (Or set CL_DICEWARE_REAL_RANDOM=t in your shell init file)
CL_DICEWARE_REAL_RANDOM=t ./diceware [<count>]
All functions and variables below are exported from the cl-diceware package. Random bytes are fetched from /dev/random, except on Windows, where it uses cl:random.
with-/dev/random (&optional stream) &body body
A macro to bind an (unsigned-byte 8) stream to STREAM around the execution of BODY. Wrap calls to the RANDOM-xxx functions with this to prevent multiple opening and closing of /dev/random.
random-byte
Returns a random integer between 0 and 255 (inclusive).
random-integer limit
Returns a random integer >= 0 and < limit. Same as cl:random, but better randomness.
random-word
Returns a random word from the Diceware word list.
random-words count
Returns a list of COUNT random words from the Diceware word list.
random-words-string count
Returns a string containing COUNT random words, separated by spaces.
*real-random-p*
Variable controls whether to use /dev/random or /dev/urandom for random numbers. If true and not :USE-FEATURES, will use /dev/random, otherwise /dev/urandom. If EQ to :USE-FEATURES, will use /dev/random only if :CL-DICEWARE-REAL-RANDOM-P is in *FEATURES*. cl-diceware.asd pushes :CL-DICEWARE-REAL-RANDOM-P onto *FEATURES* if the CL_DICEWARE_REAL_RANDOM environment variable is non-blank.
Default: use /dev/urandom
Bill St. Clair <billstclair@gmail.com> 4 September 2015
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-diceware system |
Bill St. Clair <bill@billstclair.com>
MIT
Diceware in Lisp
1.0
cl-diceware.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-diceware.asd file | ||
• The cl-diceware/package.lisp file | ||
• The cl-diceware/random.lisp file | ||
• The cl-diceware/diceware-word-list.lisp file | ||
• The cl-diceware/diceware.lisp file |
Next: The cl-diceware/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-diceware.asd
cl-diceware (system)
Next: The cl-diceware/random․lisp file, Previous: The cl-diceware․asd file, Up: Lisp files [Contents][Index]
cl-diceware (system)
package.lisp
Next: The cl-diceware/diceware-word-list․lisp file, Previous: The cl-diceware/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
cl-diceware (system)
random.lisp
Next: The cl-diceware/diceware․lisp file, Previous: The cl-diceware/random․lisp file, Up: Lisp files [Contents][Index]
random.lisp (file)
cl-diceware (system)
diceware-word-list.lisp
*diceware-words* (special variable)
Previous: The cl-diceware/diceware-word-list․lisp file, Up: Lisp files [Contents][Index]
diceware-word-list.lisp (file)
cl-diceware (system)
diceware.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-diceware package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Evaluate BODY with STREAM bound to a binary input stream to /dev/random.
random.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
Return one random byte.
random.lisp (file)
Return a random integer >= 0 and < limit. Same as ‘cl:random’, but better randomness.
random.lisp (file)
Return a random Diceware word.
diceware.lisp (file)
Return a list of COUNT random Diceware words.
diceware.lisp (file)
Return a string containing COUNT random Diceware words, separated by spaces. COUNT default to 5.
diceware.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros | ||
• Internal functions |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
random.lisp (file)
diceware.lisp (file)
diceware-word-list.lisp (file)
Control whether we use /dev/random or /dev/urandom. See documentation for ‘real-random-p’.
random.lisp (file)
random.lisp (file)
random.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
random.lisp (file)
Previous: Internal macros, Up: Internal definitions [Contents][Index]
random.lisp (file)
random.lisp (file)
random.lisp (file)
random.lisp (file)
random.lisp (file)
Helper function for ‘with-dev/random’.
random.lisp (file)
Get the Diceware word for KEY, which should be a five-digit (base 10) integer, with digits from 1 to 6.
diceware.lisp (file)
Initialize and return ‘*diceware-hash*’.
diceware.lisp (file)
Initialize ‘*diceware-hash*’, if its null, and return it.
diceware.lisp (file)
Return an integer containing COUNT random bits.
random.lisp (file)
Compute a random Diceware key, a five-digit (base 10) integer with digits from 1 to 6.
diceware.lisp (file)
True if ‘*real-random-p*’ is true or ‘*real-random-p*’ is :USE-FEATURES
and :CL-DICEWARE-REAL-RANDOM is on ‘*features*’, which it will be if
you load cl-diceware.asd with a non-null value for the CL_DICEWARE_REAL_RANDOM
environment variable.
random.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
/
C D F I M R W |
---|
Jump to: | %
/
C D F I M R W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
C | |||
cl-diceware : | The cl-diceware system | ||
cl-diceware : | The cl-diceware package | ||
| |||
P | |||
Package, cl-diceware : | The cl-diceware package | ||
| |||
S | |||
System, cl-diceware : | The cl-diceware system | ||
|
Jump to: | C P S |
---|