How to decrypt the SHA-256 to text again?

I learn these days about some cryptography. I got SHA-256...I encrypt some text but I searched and tried a lot to return to text ,but don't know how!? https://code.sololearn.com/WD3ojq5T1fEO/?ref=app When I was learning about it I could learn how to encrypt text,but SL is not supported my code 😅... Just if I am ganna use this cryptography in future want to know how to decrypt again ; Note : wanna know how to do this by JavaScript or any library from it.

1/15/2020 6:28:21 AM

Basel Al_hajeri.MBH()

6 Answers

New Answer


In a nutshell: One of the essential parts of a cryptographic hash is that it is irreversible. You create a hash not to encrypt a message, but to provide a signature, kind of a check sum. It is a means to ensure that the original message has not been tampered with. But you need the plain text to verify this (pass it through the digest and look if the hash value is the same). The idea is for instance to ensure that a tar-ball you want to install is not manipulated to install malware on your computer. You get the tar-ball and its hash, you verify that the hash is correct, and most likely the tar-ball is genuine and you can safely install it. With encryption/decryption, you require the process to be reversible. The idea is to prevent unauthorised people from reading the content. It requires a key (a passphrase) and it mangles the plain text through several layers of encryption, each step being reversible, to produce an output that withstands known attacks on encrypted data. On the receiving end (might be yourself), the passphrase needs to be known. Together with this key and the known algorithm, the steps can be undone to recreate the plain text.


You cannot reverse a hash. It is a unidirectional algorithm. Different texts may result in the same hash value - so it is, as a function, not invertible.


Coder Kitten what is the difference between Hashing and decryption?


The only thing you can do is a dictionary or brute force attack which compares hashes of word lists to the hash you wish to "decrypt". there's no real reversion like Coder Kitten said already. Hashes like SHA haven't been made to encrypt anything anyway and are not considered secure enough to store sensitive information in. these hashing algorithms are made to be fast because their original purpose is to verify file integrity of downloads, for example. a secure algorithm would be designed to be slow to calculate. for actual encryption of communication, you would neither use conventional nor secure hashing. instead, the concept of having a public and a private key is used, which is different entirely: end to end encryption that's both secure and reversible.


Thank you Gregor Dietrich and Coder Kitten ... I got it after posting the question 🙂


You're welcome.