Library: hash

From Yombo
Jump to: navigation, search
hash
Commonly Used No
Status Active

Summary
Quickly create secure password hashes.

Introduction

Password hashing is used to create a one-way, but verifiable password hash. This helps prevent passwords from being discovered, while the hash output can be stored in plaintext. The hashing library primarily uses 'argon2' to prevent GPU brute force hacking.


Hooks

No hooks registered.

Usage

Simply use the self._Hash.hash('password') and self._Hash.verify('password', 'hashed_text_here') to create and validate passwords.

Examples

To create a hashed representation of a password, simply pass it to the hash function:

hashed = self._Hash.hash('password') # returns an argon2 hashed version of the password.

When you want to validate if a supplied password matches a known good password hash, simply submit the user submitted password along with a previously created hashed_password:

if self._Hash.verify('password', hashed): # 'hashed' is the string strored from the hash() function.
  do_something()


This page was last edited on 28 March 2018.