Password Hashing Using Python

in #python7 years ago

Python as we know , is a powerful language and it has a lot of modules as well as libraries , today we are going to see how to hash passwords using python
let us get started :
first step is importing a module :
Code:
import hashlib
second step is writing the password we want to hash
Code:
password = 'Your Password'
third step is choosing which encryption do we want to use :
Code:
h = hashlib.md5(password.encode())
4th step is easy is printing our hash :
Code:
print(h.hexdigest())
this is it , see you next

Sort:  

Hey, just a suggestion.

If you are going to post source code I recommend using the triple ``` on lines (of their own) surrounding the code, or indent the code by four spaces to render code appropriately, such as:

import hashlib
password = 'Your password'
# and so on

See this as steemit markdown syntax is heavily based on GitHub's implementation, or many other articles just by searching for markdown and steemit for other tips on the markdown syntax.

Anyway welcome to Steemit!

thanks man i appreciate your response

You can also just indent the block of code by four spaces. I find the four spaces to be easier when using an external editor to type stuff up first, or using four tildes when typing directly into the post, but to each his own.

Step three of your process is actually choosing a cryptographic hashing function, not an encryption algorithm.

You can edit your post to include the code blocks so that its more readable and you'll probably get a few more upvotes...