June 2020
Intermediate to advanced
382 pages
11h 39m
English
SHA was developed by the National Institute of Standards and Technology (NIST). Let's see how we can use Python to create a hash using the SHA algorithm:
from passlib.hash import sha512_cryptsha512_crypt.using(salt = "qIo0foX5",rounds=5000).hash("myPassword")
Note the use of a parameter called salt. Salting is the procedure of adding random characters before hashing.
Running this code will give us the following result:

Note that when we use the SHA algorithm, the hash generated is of 512 bytes.