Ben Chuanlong Du's Blog

It is never too late to learn.

Hash Password Using Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Using the Python Package crypt

In [1]:
import crypt
In [4]:
crypt.crypt("gitpod")
Out[4]:
'$6$kr6wIhxB7CykAXc9$j6EF3LxyvQx83oKsDeRLwnVRmDQfFmHgr4MeNOXZu8ydkVueVnPu1DzTtdIJNMK.9a38ScG4Zpn9hCNtmg9KB/'

Using the Python Package bcrypt

In [79]:
import bcrypt
In [89]:
bcrypt.hashpw(b"gitpod", bcrypt.gensalt())
Out[89]:
b'$2b$12$fACqka4PM4aPL8JNyGGyfucIHaYnFc//yBBtJ/.FMH/2e565WAgY.'
In [ ]:
 

Comments