in C++, Management, Strategy

Easy and better passwords

In this morning’s mail I received a link to a good post about passwords and entropy and the like. There is so much cruft about passwords that it is difficult to reliably suss the good and the bad, but the above posting is both correct and reasonable. Sometimes I need a password, not a password system, and I offer the following as a free solution for you to use.

Quick explanation of the code

Download the source

The solution is an example from the little known TV show “This Old Code.” The program, craic, was first produced in 2003 as an example for the CS246 class at VCU that had a title something close to C++ Programming for Electrical Engineering Students. Looking through the code this morning, I recall its use for demonstrating every basic programming technique I expected the students to know, from the slightly deranged in the function noOhsAndEls() to the banal in addWordsToList().

If you know nothing of C++, or don’t want to, just type the following at the shell prompt:

g++ -o craic craic.cpp

You should be left with an executable named craic correctly bound to the libraries on your machine. If you run the program with no arguments you will get the help including an example of the output of the program.

It’s the solution to what problem, exactly?

The weakest link in passwords is the process of thinking up the password, a process by which you inject your own knowledge of the selection process, decreasing entropy considerably.

Sometimes, you just need a password. Sometimes you need the password now. Sometimes you need a password that meets the rules of “must contain a …” or “may not be longer than …”

Final points about the code

Before you go crazy critiquing the code, keep in mind that

  • Individual functions in the file were often written to teach some particular feature of C++
  • Commenting and capitalization differ from point to point in the file
  • It is not object oriented.
  • It conforms strictly to the C++11 standard.