Reimplementation Kick-Off

07.04.2022 yahe calcpw code hardware raspberry security

About a decade ago I presented a hardware-based password calculator called which generates passwords based on a single strong password and a service-dependent information, thus allowing you to use individual passwords for each of your services without having to care for a password database. I even presented it at a few conferences.

In the meantime much better microcontrollers have become available and my understanding of cryptography and password generation have improved as well. That is why I have kicked-off the reimplementation of! 😃

What will stay?

  • will continue to use off-the-shelf components so that people can build it themselves. It will therefore also remain open-source software and hardware.

  • will remain stateless. Break your hardware, build it anew and you will be able to calculate the same passwords as before. The password calculation does not depend on hardware-specific or random values that need to be kept somewhere.

  • will provide a software-only implementation. There will be situations where you do not have your hardware at hand but need one of your passwords. The software-only implementation is going to be cross-platform just as before.

  • The password calcuation will continue to use two different cryptographic algorithms in conjunction to protect the initial password. The input for the password will still be a single strong password and a service-dependent information.

  • will continue to act as a keyboard to send the generated passwords.

What will change?

  • The password calculation will use different cryptographic algorithms and they will work together differently. The password encoding will also change to be less predictable and instead follow industry best-practices.

  • The way the information has to be entered in order to define the length, character set and enforcement of characters will change. Instead of appending all those extra values to the information, you will instead prefix trigger flags to the information for the length (#), the character set (*) and the enforcement (!). will then ask for the length and the character set individually. Hopefully, this change will improve the usability.

  • will use the Raspberry Pi Pico hardware and the RP2040 microcontroller in the future instead of the Arduino platform. It is not only much cheaper but also much more powerful and enables the implementation of much stronger cryptographic algorithms.

  • will not be connected between a keyboard and the computer anymore. The man-in-the-middle approach was fun to work with, but not very useful when sitting in front of a notebook or when using a smartphone. Instead, will use an integrated keypad and T9-style character input. Thanks to that will be a portable and handheld device!

  • will have a PCB schematic so that soldering will be much easier.

What has been done?

  • The password calculation has already been designed, including the key expansion that converts the password and information into a pseudo-random byte stream as well as the password encoding. The cryptographic algorithms used are PBKDF2-SHA-256 and AES-256-CTR. The password encoding uses rejection sampling to prevent modulo bias.

  • The password calculation has been described in detail, including schematics of the key expansion as well as rationales as to why certain constructs have been chosen.

  • A PHP-based reference implementation of the password calculation has already been published called calcpw.php. It should not be used for productive use as it does not clean-up the used memory, but it is useful for experiments and tests. The results of the production-ready implementation will be compared against the output of this reference implementation.

  • Based on calcpw.php the key expansion underwent a full dieharder test run to check the randomness properties of the pseudo-random byte stream. Furthermore, the password encoding underwent a statistical test to make sure that it does have a modulo bias.

  • All relevant parts for the first few prototypes have been sourced.

What is coming next?

  • To get the first production-ready implementation up and running, I am currently working on a Swift-based implementation of the password calculation so that it can be used on iOS devices.

  • Afterwards, the password calculation will be implemented in plain C so that it can be compiled for Linux, macOS and Windows. The C implementation will also be the basis for the code that is going to run on the microcontroller.

  • When the password calculation is running on the RP2040 microcontroller, the first prototype can be built that contains all the peripherals as well as the final UI elements.

  • Finally, the PCB schematic can be designed and a test PCB batch can be ordered.

Final words

As you can see, a lot of work has already gone into the reimplementation of, but there is still a lot to do. The single tasks will have to fit into an already-tight time schedule, so I will post updates when major progress has been made. I hope you are just as excited as I am. Things are looking great so far. 😁



administration (44)
arduino (12)
calcpw (3)
code (38)
hardware (19)
java (2)
legacy (113)
linux (30)
publicity (7)
raspberry (3)
review (2)
security (64)
thoughts (22)
update (9)
windows (17)
wordpress (19)