Writing a Simple Password Generator in Racket

Writing a Simple Password Generator in Racket

Since there are only 6 symbols in our encoding, the encoding is now longer, but it represents the same random 128 bit number:

We have all the building blocks we need to build a simple command line utility to generate passwords. This is done by keeping track of the current position and inserting the separator if the current position is a multiple of the grouping:

We also need to process the command line arguments passed in to the script to control password length, alphabet choice and grouping; this can be done using the macro, but since it is a macro, it interprets its arguments in a special way, which may be surprising if you expect a normal function call. See the full documentation for the macro for details, however, below is the invocation required to accept three command line arguments for the number of bits in the password, for the alphabet to use and for the grouping.

Source: alex-hhh.github.io