How to reverse SHA1 Encrypted text [duplicate]

橙三吉。 提交于 2019-12-02 23:45:24

问题


I have a requirement to reverse translate a SHA1 encrypted text to plain text.

I need the Java Code to it.

many forums say that it cant be done but i have found a link http://www.stringfunction.com/sha1-decrypter.html which does exactly the same. I have tested it. Now i need the algorithm to implement in Java.

Please help!!!


回答1:


It's plain impossible. SHA1, like all cryptographic digest algorithms, is not an encryption algorithm, but a hashing algorithm. It takes any text, as long as you want, and transforms it into a few bytes, in a way that is impossible to revert, by design. The whole point of a cryptographic hash is to be one-way, and thus impossible to revert. If it was possible, the algorithm would be useless.




回答2:


No you cannot do that, the website you gave is based on pre-generated mapping database, and it could only find a string which exists in its database.

  1. SHA1 is a digest algorithm, it's a many to 1 mapping, so theoretically speaking you could find many strings which give you the same SHA1 value.

  2. It's made to be hard to reverse calculate.

So there's no go.




回答3:


I'm pretty certain it isn't possible to decrypt SHA1. The only way I know of is to bruteforce it, to generate random strings and encrypt them until you find the match, which could take an extremely long time, if the text isn't very complex. The solution the link you provided is to have an enormous database with a lot of strings and it's SHA1 equalient, but that generally wont work unless the original text exist in the database.



来源:https://stackoverflow.com/questions/12419756/how-to-reverse-sha1-encrypted-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!