You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode Password cracking: why a stolen list of hashes still gives passwords away

How passwords and logins work: why a website should not know your password

Password salt: why two people with the same password get different hashes

Two people choose the same password. A well-built website keeps two completely different hashes for them. A small random string makes the difference. Because of it, a thief must crack each account on its own.

  1. 1 Before grinding your password, the website now makes up a string of random characters just for you, x7Qp, and mixes it in. This string is called a salt.sunflower7hash functionsaltx7Qp6debe3157bff

    Before grinding your password, the website now makes up a string of random characters just for you, x7Qp, and mixes it in. This string is called a salt.

  2. 2 The salt is no secret. The website keeps it in plain sight, in your row, right next to the hash.climbwall.example: membersemailsalthashyou@mail.examplex7Qp6debe3157bffsam@mail.exampleTb8r09ee40df203e

    The salt is no secret. The website keeps it in plain sight, in your row, right next to the hash.

  3. 3 Nora, another member, also picked sunflower7. She got her own salt, Lm2e, so her hash looks nothing like yours. Nobody reading the list can tell that you two share a password.you@mail.examplex7Qp6debe3157bffnora@mail.exampleLm2e16ef1c07cf07both picked sunflower7

    Nora, another member, also picked sunflower7. She got her own salt, Lm2e, so her hash looks nothing like yours. Nobody reading the list can tell that you two share a password.

  4. 4 At login, the website takes the salt from your row, mixes it with what you type, and grinds again. Same salt, same password, same hash: you are in.you@mail.examplex7Qp6debe3157bffsunflower76debe3157bff

    At login, the website takes the salt from your row, mixes it with what you type, and grinds again. Same salt, same password, same hash: you are in.

  5. 5 Rono's ready-made tables now find nothing: they were made without your salt. And one guess no longer tests every member at once. To try 123456, he must grind it with your salt for your row, then with Nora's salt for hers, and so on, 5,000 times.passwordhash1234568d969eef6ecasunflower781580afc7bfcRonoNo match.Anywhere.

    Rono's ready-made tables now find nothing: they were made without your salt. And one guess no longer tests every member at once. To try 123456, he must grind it with your salt for your row, then with Nora's salt for hers, and so on, 5,000 times.

  6. 6 So Rono guesses one member at a time. Still, his computer has a graphics card, a part built to make huge numbers of small calculations at once: billions of guesses a second. How long would your password last?you@mail.examplex7Qp6debe3157bffbillions of guessesa secondRonographics card

    So Rono guesses one member at a time. Still, his computer has a graphics card, a part built to make huge numbers of small calculations at once: billions of guesses a second. How long would your password last?

  7. Quick check

    Quick check.Two members both use123456, and each onehas a salt. Does oneguess from Ronofind both?

    Quick check.

    Show the answer

    No. Their salts differ, so their hashes differ. He has to grind 123456 once with each salt.

  8. Go further

    Two names that go with salt.rainbow tablea ready-made table likeRono's, packed to takeless room. A salt makesit useless8d969eLinkedIn, 20126.5 million password hasheswith no salt were postedonline, and most werecracked within days

    Two names that go with salt.

Next episode Password hashing algorithms: how a website fights a very fast password cracker

Share this comic

More comics