liveBook · Manning

Password hashing

As explained in Rust Servers, Services, and Apps

Password hashing is the one-way transformation of a password into a value intended for secure storage and later verification.

Password hashing transforms a submitted password into a one-way value for storage and later verification. The original password cannot be reconstructed from the hash. section 8.3

A registration handler applies the technique in this sequence:

  • Receive the registration form through the POST /register route. section 8.3
  • Use the Argon2 library to hash the submitted password, supplying a salt to construct the hash. section 8.3
  • Persist the resulting value with the user record rather than retaining the recoverable password. section 8.3

Tutor registration

A Rust Actix Web handler reads TutorRegisterForm, checks that the password and confirmation match, hashes the password with Argon2, and continues registration. Successful registration produces a tutor identifier; invalid input produces messages such as “Passwords do not match.”

How Rust Servers, Services, and Apps covers it

How deep it goes
Explains the one-way hash and salt, then applies Argon2 inside a registration handler without detailing its internals.
Examples
Demonstrates tutor registration, password confirmation errors, successful registration, and Rust handler code.
What it assumes
Assumes familiarity with Rust web handlers, forms, and database models while introducing hashing through registration.
What you can do after
Apply it via rust-argon2 when implementing a Rust registration endpoint.
How it connects
Connects password hashing with Argon2, password verification, registration forms, and database persistence.

Also explained in

Compare how 5 books explain password hashing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.