Python's Bcrypt encryption method verification

Source: Internet
Author: User

Address of the Bcrypt library https://pypi.python.org/pypi/py-bcrypt/

Can be downloaded by the source package in the local compilation installation, but Windows will be more trouble, need to VCForPython27 this stuff to help,

In fact, there is an easy way:

Pip Install Bcrypt

Easy to handle.

The usage scenario for Bcrypt encryption is this:

1, the server record the original password, the client receives the user input password, and then use this password calculation to generate a string, sent to the server.

hash = BCRYPT.HASHPW (password, bcrypt.gensalt ())

2, the server receives this string, pass in the password, check whether this encrypted string is correct

HASH1 = BCRYPT.HASHPW (password, hash)

hash = = Hash1?? If they are equal, that means the password is correct.

Python's Bcrypt encryption method verification

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.