Search code examples
encryptioncryptojs

CryptoJS v3.1.2 SHA3 (512) decryption


I am writing a site that needs to use multiple encryptions through out the entire process. I started to use CryptoJS v3.1.2 vSHA3 (512) and am able to encrypt the data no problem. Where I'm having trouble is decrypting the data once it's been encrypted. I have been searching the web for the last week or 2 and have only been able to find ways to encrypt the data but no way to decrypt it. If there is no way to decrypt the data, I will have to look for a different encryption. Any help here would be gratefully appreciated.


Solution

  • SHA3 is a hash function, and hash functions are not reversible -- that is, not decryptable. You may instead need a symmetric algorithm such as AES.

    That being said, getting the nuances of cryptography right to avoid vulnerabilities is notoriously hard even for veterans, much less someone new to these concepts. Try very, very, VERY hard to rely on standard and ready-made solutions. Use things like HTTPS, for example, or your database's built-in security features.