Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The point of a hash like sha256 is that it is supposed to be a one way function (although the existence of true one way functions is still an open question, see <a href="http://en.wikipedia.org/wiki/One-way_function" rel="noreferrer">http://en.wikipedia.org/wiki/One-way_function</a>).</p> <p>Note <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="noreferrer">http://en.wikipedia.org/wiki/Cryptographic_hash_function</a>:</p> <pre><code>The ideal cryptographic hash function has four main properties: 1. it is easy to compute the hash value for any given message 2. it is infeasible to generate a message that has a given hash 3. it is infeasible to modify a message without changing the hash 4. it is infeasible to find two different messages with the same hash. </code></pre> <p>If you could reverse it then you'd be breaking rule 2. These rules allow one to tell another party that they have some information (such as a password), without revealing the information. For example, see wikipedia: <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function#Illustration" rel="noreferrer">http://en.wikipedia.org/wiki/Cryptographic_hash_function#Illustration</a></p> <p>If you need invertibility see <a href="https://stackoverflow.com/questions/2490334/simple-way-to-encode-a-string-according-to-a-password">Simple way to encode a string according to a password?</a>, you can use something weak like Vignere, but there is also an example using PyCrypto:</p> <pre><code>from Crypto.Cipher import AES import base64 cipher = AES.new(secret_key,AES.MODE_ECB) # never use ECB in strong systems obviously encoded = base64.b64encode(cipher.encrypt(msg_text)) # ... decoded = cipher.decrypt(baes64.b64decode(msg_text)) </code></pre> <p>If you want a reversible hash function, see <a href="https://stackoverflow.com/questions/4273466/reversible-hash-function">Reversible hash function?</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload