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!?
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 ;
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.
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.