0

This question already has an answer here:

I am designing a system where some data needs to be hidden and the idea is to store it in an encrypted file. How can you allow nodes to interact with it through a smart contract without revealing the encryption key?

marked as duplicate by flygoing, Richard Horrocks, Achala Dissanayake, Ismael, Roman Frolov Jan 30 '18 at 20:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

You can't.

I know this answer ins't good so let me explain. If a node must interact with a data they must know this data.

You have solution but without using smart contract or using smart contract for all except encryption. You can use an private node running a program decrypting data and make all must do. And ethereum address and private key is just asymetric encrypting algo key and private key so you can use address for encrypt data and private key for decrypt it.

PS: The question have already been asked : Store secret data in contract

  • Along with this being the right answer, another option to research is Oracles, where you can bring in your own data to a contract. – ReyHaynes Jan 29 '18 at 15:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.