Quantum Builders ClubQuantum computing projects

Project 04 · Ladder 1 · Beginner

Quantum Password Generator: quantum meets cybersecurity

How it works

  1. Sixteen characters lock in one by one, each picked with quantum random bits.
  2. The padlock snaps shut, and the meter fills with the password's strength in bits.
  3. At a trillion guesses a second, cracking it would take about 485 billion years.

The final rung of Ladder 1: quantum meets cybersecurity. Build a password generator powered by qubits, measure its strength to the decimal place, then think like an attacker.

Start my 7-day free trialSee all ten builds

Level
Beginner
Hours
4 to 6
Automated tests
17
Ships to
GitHub

What you build

Quantum Password Generator in Python and Qiskit

Quantum security has a deadline. In August 2024 NIST published the first post-quantum cryptography standards (FIPS 203, 204 and 205), and the UK's National Cyber Security Centre wants organisations moved to post-quantum cryptography by 2035. Every one of those systems starts from the same raw ingredient: unpredictable random numbers.

So you turn your QRNG into a tool anyone understands. You'll prove with statistics that every character is equally likely, calculate exactly how strong each password is, and work out that brute-forcing one of your 16-character passwords at a trillion guesses a second takes about 485 billion years on average: roughly 35 times the age of the universe.

Choose the length, switch symbols on or off, leave out look-alike characters, guarantee every character class, and get the exact entropy and a brute-force time for every password.

The quantum ideas inside

  • Entropy in bits
  • Uniform sampling
  • Modulo bias
  • Threat modelling
  • Post-quantum cryptography

New to Qiskit? Run your first circuit free, or warm up with the free Qiskit tutorials.

Real output · Project 04Qiskit Aer simulator

python quantum_password.py --length 16 --count 5 --seed 7 --plot pw_results.png
Quantum passwords (16 characters, alphabet of 94):
   1;|Lp~7Pl/T<V8K8
   cz*KsMBdk1u*xp?+
   G@n9yg0G~FI^tO_M
   ^CUzG>p{muf"9k}6
   ajx=ue@M5Yxa2cIw

Entropy: 104.9 bits without class rules, 104.6 bits with 'every class at least once'
Average brute-force time at 1e12 guesses/s: 4.85e+11 years
Classical (secrets) password for comparison: YWqzR~LWHR].+q!B
Chart saved to pw_results.png
What your finished program prints, from the build's own guide.

By the end

What you walk away with

  • a password generator driven by 16 measured qubits, with zero modulo bias
  • an exact entropy calculation, checked against brute-force counting
  • a chart that proves your characters are uniform and shows why length beats complexity
  • 17 automated tests, one extension that is all yours, and a public GitHub repo with a proper security notice
  • the threat-model thinking that security teams look for

Where it sits

Ladder 1: Beginner

BeginnerLadder 1

  1. Quantum Coin Flip

    One qubit, proven fair with real statistics.

    18 tests · 2 to 4 hours

  2. Quantum Dice Roller

    Catch a loaded die red-handed.

    16 tests · 3 to 5 hours

  3. Quantum Random Number Generator

    Build it, then try to break it.

    18 tests · 4 to 6 hours

  4. Quantum Password Generator

    Its strength, measured in bits.

    17 tests · 4 to 6 hours

Your first circuit is 10 minutes away

Stop watching quantum. Start shipping it.

Start my 7-day free trial

$0 today. 7 days free, then $7.99 a week or $190 a year. Cancel any time.

Detail C · A qubit's state