Best practices for storing password

Hashing, which we touched upon in Chapter 3, Getting Started with Vapor, when creating our Vapor app, is very useful for a lot of things, including password encryption. Certain hashing algorithms such as BCrypt and SHA-256 can be thought of as functions that can take in some text and generate unintelligible text that is long and hard to memorize. The beauty of these hashing functions is that they will generate a new random string that cannot be reversed to its original form. Even a slight change in one character can generate output that is completely different, making it a lot harder to figure out the original text that was hashed. Knowing this quality of the hashing function, we can generate a hash of ...

Get Hands-On Full-Stack Development with Swift 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.