Skip to content Skip to sidebar Skip to footer

I Want To Encrypt Blob Using Sha In Javascript

I want to encrypt blog using SHA in javascript so that I can send the encrypted blob chunk to server and where I can decrypt it.

Solution 1:

This is not possible.

SHA is a cryptographic hash function, not an encryption function - the result is not reversible. See Fundamental difference between Hashing and Encryption algorithms for an in-depth explanation.

Now, to really encrypt data in JavaScript (say with AES), there are several options. Since it is hard to get cryptography and key exchange correct, using a hand-rolled encryption scheme may be no better than plain-text. As such, normally one would just use HTTPS to ensure the entire channel is securely encrypted.


HTTPS itself is "secure" with the correct negotiation options and patches.

Post a Comment for "I Want To Encrypt Blob Using Sha In Javascript"