A password is only as strong as the randomness behind it. This set covers why the shell number $RANDOM will not do, what is subtly wrong with the common /dev/urandom pipeline, and how the finished genpass.sh works out the entropy of a password from its length and its alphabet.
Each one is marked as you go, and the explanation arrives straight after, which is
the part worth reading.
4 questions, marked as you go.
Tasks
These need your own device. Run the command in Termux, then paste what it printed.
The marking looks at what the output means, so spacing, version numbers and
ordering do not matter. If you have not installed anything yet, the
lesson covers the setup.
Run the generator you built
The genpass.sh you finished in the last lesson is already saved next to you. This runs it for a twenty character password drawn from lower case, upper case and digits, and prints the password and its entropy on one line. Paste that line.
Run this in Termux
On your own device. Nothing on this page executes it. The command runs in
your terminal, and this box only reads what you paste back.
bash genpass.sh -l 20 -c lud
The bracket at the end is the report: the length, the size of the alphabet it drew from, and the entropy in bits.
a 20 character password with the 62 character alphabet reported
the entropy is the real figure for that alphabet
the script ran
What a good answer looks like
One line, holding a twenty character password and then a bracketed report. The report should read 20 chars, alphabet 62, and a figure near 119.08 bits, because twenty characters drawn from 62 possible ones is 20 times log2(62). Lower case, upper case and digits together are 26 plus 26 plus 10, which is 62. If the alphabet figure is different, the wrong classes were selected; if the bit figure is much lower, the length did not take.
Marking your own work
Both halves of this are checked in your browser, with no server involved, so nothing
stops you from pasting output you did not run. The tasks are written so that the
easiest way to pass one is to actually do it and read the result, which is the whole
intention.