Want everyone on your software team to learn this? Free 14-day trial.

Train my team
Smart Use of Encryption
Python
@app.post('/signup')
def do_signup():
  username = request.form['username']
  password = request.form['password']

  # The user is signing up - calculated their password hash and save it to the database.
  salt   = bcrypt.gensalt()
  hashed = bcrypt.hashpw(password.encode(), salt)

  save_credentials(username, hashed)

  return redirect('/login')