LinuxCommandLibrary

mcookie

TLDR

Generate random number

$ mcookie
copy
Use file as seed
$ mcookie --file [path/to/file]
copy
Use limited bytes from file as seed
$ mcookie --file [path/to/file] --max-size [bytes]
copy
Show verbose randomness details
$ mcookie --verbose
copy

SYNOPSIS

mcookie [options]

DESCRIPTION

mcookie generates a 128-bit random hexadecimal number (32 hex characters). It is primarily used for generating X authority cookies but can be used for any purpose requiring random data.

PARAMETERS

-f, --file FILE

Use file contents as additional entropy source
-m, --max-size BYTES
Maximum bytes to read from file
-v, --verbose
Print details about randomness sources

OUTPUT

32 hexadecimal characters (128 bits of randomness)

CAVEATS

Uses /dev/urandom and system entropy. Part of util-linux package.

SEE ALSO

xauth(1), uuidgen(1)

Copied to clipboard