Hey there I was wondering what the best technique would be for sending encrypted data to a contract, which can later be decrypted, either by the initial user, or by the contract itself, but not anyone else.
My best guess right now is to create a key-pair using CryptoJS/Forge and encrypt it with the public key, then hold the private key safely until the message is ready to be decrypted. I'm guessing that the private key will be exposed as soon as you decrypt, so would I need to generate a new key pair for every event that requires this encryption?
I've never used CryptoJS or Forge or any browser symmetric encryptions, I was wondering how I could pull this off securely?