This question already has an answer here:
- Decryption in a smart contract 4 answers
I am trying to make a document sharing app after signing the NDA between 2 parties.
My Smart contract saves the address of involved parties as Sender(Party1 who makes the NDA) and recipient(Party2 who signs the NDA).
Once both parties signs NDA I want to share the documents between 2 parties for via smart contract.
I am planning to upload the encrypted document(which is encrypted by user while uploading) on a Server and keep the address and decryption key inside the smart contract itself and once NDA expires delete all the decryption keys from Contract so that users can not access documents anymore.
Problems I am facing are :
1, User do not want the name and address of parties to be readable in Smart contract so I need to encrypt everything inside Smart contract and only the involved parties should be able to decrypt and read the details of contract.
If I can do this then the address of document and encryption key to document will also remain safe.
What kind of en/decryption can I use for this situation?
I do not want to pass the encryption/ decryption keys between users.
Is there any public and private keys attached to Ethereum accounts?, If Yes, How can I make use of those?
Please advise If my whole approach seems doubtful to you.