encryption - How to decrypt sha1-encrypted String in Java -


is possible decrypt string earlier encrypted sha-1 algorithm in java?

sha1 cryptographic hash function, , entire point can't undo it. if possible reverse hash (find input given hash), wouldn't useful. if need encrypt , later decrypt it, should use encryption function aes or rsa.

however, simple inputs may possible crack hash function guessing input , checking if hash same.

example python code:

def crack_hash(hash_to_crack, hash_function, list_of_guesses):     # try hash in our guess list     guess in list_of_guesses:         new_hash = hash_function(guess)         # if hashes match, found         if new_hash == hash_to_crack:             return guess     # if none of them match, give     return none 

of course, if want crack hashes efficiently, using software john ripper or hashcat best bet. note works on passwords since they're short , easy guess, difficulty increases exponentially input increases. can crack every sha-1 hash 6-character input in minutes, while cracking 1 16 characters take trillions of years on average.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -