How are user passwords managed and validated in databases?

How are user passwords managed and validated in databases?

Did you know, back in 2005, Reddit developers confirmed that a hacker had stolen backup copies of their database that contained password information for Reddit users in plain text!!

Yes you read that right!

The password information was stored as plain, unprotected text. In other words, once the hacker had the database, he had everyone’s passwords as well.

If you are storing passwords of your user's in a database, you are committing a big mistake! All it does is weaken the security of your web site, needlessly putting your users, your employer, and yourself at risk.

Is converting passwords into hashes and storing them in the database enough ?

Hashing is usually a one-way function where once you hash any field, you get a string of characters representing the original text but there is no way to convert it back to the original text.

But still, storing password hashes directly is not sufficient because it is pruned to precomputation attacks, such as rainbow tables.

Hence, before computing the hash, it's always a good idea to append the password with a "salt". A salt is a unique, randomly generated string that is added to each password as part of the hashing process.

In practice, the salt is stored in plaintext along with the hash and the username in the database so that when the user logs in, the salt can be looked up and appended to the provided password, hashed and then verify if the stored hash matches the computed hash.

Had the folks at Reddit salted and hashed the passwords and then stored the salts and resulting hashes in the database instead, the hacker would have been in a very different situation.

It will be awesome to learn the concepts of system design from you

To view or add a comment, sign in

More articles by Pratima Upadhyay

  • The Rise of Indian SaaS Startups : Comparing SaaS with IaaS and PaaS

    Did you know, despite the tight macroeconomic pressure and funding crunch, Indian SaaS startups have raised more than…

    2 Comments
  • Master the Art of System Design: Enroll in My Live Course and Strengthen Your Fundamentals

    Register for the course Are you ready to take your technical skills to the next level? Look no further than my live…

    1 Comment
  • Properties of Pub Sub Architecture

    Topics in a publish-subscribe system not only act as intermediaries between publishers and subscribers, but they also…

    5 Comments
  • What are coroutines and how are they different from threads?

    Coroutines are a programming construct that can be thought of as a lightweight version of threads. While threads are…

    2 Comments
  • Pub/Sub Messaging Model

    Pub-Sub messaging is an asynchronous communication method used in microservice architecture. The Pub-Sub model consists…

    4 Comments
  • An introduction to Kubernetes

    What is Kubernetes and why is it so popular? Kubernetes is an open source container orchestration tool developed by…

    2 Comments
  • An introduction to Containers

    Have you ever wondered what is the buzz around containers and why is everyone moving towards containerizing their…

    2 Comments
  • The birth and rise of NoSQL

    The acronym NoSQL was first used in 1998 by Carlo Strozzi while naming his lightweight, open-source “relational”…

    3 Comments
  • Replication and Sharding

    Replication refers to having several copies of the same dataset hosted on separate machines in order to maintain…

    12 Comments
  • Consistent Hashing

    Why do we need Consistent Hashing ? Consistent hashing is the solution for the widely encountered Rehashing problem in…

    2 Comments

Explore content categories