Password Storage

Intent

This pattern (actually more of a best practice) provides an easy method of adding some level of encryption for password storage.

Problem

Many applications still store passwords in clear text. Because most of the code is already written to provide at least some level of encryption, there is little excuse for not providing it.

To understand this pattern, you must first understand the concept of a one-way hash. A simple definition of a one-way hash is a scrambled version of a string that cannot be easily unscrambled to get the original string back. To store the password, the hash is generated for the password to be stored. We'll call the stored hash value hash1. When the user comes to the site and enters his or her password, ...

Get .NET Patterns: Architecture, Design, and Process now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.