Login Register






Password Hasher filter_list
Author
Message
Password Hasher #1
Hello Guys, Today I bringing you my Password Hasher, A rather easy script!

[Image: b85f4f1b278a71e0ef6542dc144a0640.png]

Code:
import uuid import hashlib def hash_password(password): # uuid is used to generate a random number salt = uuid.uuid4().hex return hashlib.sha256(salt.encode() + password.encode()).hexdigest() + ':' + salt new_pass = input('Please enter a password: ') hashed_password = hash_password(new_pass) print('Hashed password: ' + hashed_password)

was going to make it allow it to verify it but meh.

Updated again







Reply

RE: Password Hasher #2
ignore the post above me, I submitted it before finishing it. So, Yes, To this I have updated it to where you can Find the hash out of files. By doing this you just change the name of the file. for example, In the code look where it says.

Code:
with open('hchasher.py', 'rb') as afile:

change it to whatever you want. Though it's only working for small files as of now.


Full code.
Code:
import uuid import hashlib def hash_password(password): salt = uuid.uuid4().hex return hashlib.sha256(salt.encode() + password.encode()).hexdigest() + ':' + salt new_pass = input('Please enter a password: ') hashed_password = hash_password(new_pass) print('Hashed password: ' + hashed_password) #This is a different file, This will hash files #Join Hack Community hasher = hashlib.md5() with open('hchasher.py', 'rb') as afile: buf = afile.read() hasher.update(buf) print(hasher.hexdigest())







Reply

RE: Password Hasher #3
Why not make it take command line arguments for the path to the file? It's something I think every Python programmer should have at least a brief understanding of.

Second, instead of using string concatenation, try to use string formatting.

Code:
print('Hashed password: ' %s) % hashed_password

Reply

RE: Password Hasher #4
How do you even work with that Reddish eye blasting Console :S My eyes hurt lol...

Also use sys.argv to get command line input just as Anima said
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: Password Hasher #5
Added the "Source"-tag.
And command line arguments is a good suggestion. It makes your program more flexible to use.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: Password Hasher #6
(06-23-2014, 07:15 AM)Ex094 Wrote: How do you even work with that Reddish eye blasting Console :S My eyes hurt lol...

Also use sys.argv to get command line input just as Anima said

Lol, It's easy to work with. Confusedmile:

And all of you, Thanks for your comments, I will work on it. Confusedmile:







Reply