First, there is a difference between hashing and encryption. SHA256 is a hashing function, not an encryption function.
Secondly, since SHA256 is not an encryption function, it cannot be decrypted. What you mean is probably reversing it. In that case, SHA256 cannot be reversed because it's a one-way function. Reversing it would cause a preimage attack, which defeats its design goal.
Thirdly, SHA256 verification works by computing it again and comparing the result with the result at hand. If both results match, then the verification is successful. The theoretical background is that it's difficult to find another input which gives the same hash result. Violation of this creates a second-preimage attack, which defeats its design goal.
Finally, digital signatures are not simply hash and key combinations. But a hash function may improve its security.
这是你应该读的post。
相关问题 更多 >
编程相关推荐