1

I'm building a service where one can publish a crypted file on the internet which can be accessed and decrypted by people allowed. I don't want to store any crypted key on a server or something.

For the moment, I have the owner of the file who initializes a key on the blockchain, and the addresses in a list can access this key after a good require statement. But then I realized that when the owner initializes his key, it's being seen over the input which is public.

Is there a known way to solve this issue ?

  • You could use asymmetric encryption. I won't go into detail, but you could have the sender of the data encrypt it using the public key of the receiver, and store it either on the blockchain, or on IPFS or something, in which case you could store the data hash on the chain for verification. The public key is not the same as the address. It must either be provided by the receiver, or by deriving it from a signature of the receiver. There are ways to do that. After the data is stored on IPFS, the receiver can decrypt the data using their own private key. – Henk Aug 21 '18 at 9:35
  • The thing is I that I want to be able to dynamically manage permission to this key since the owner can add viewer and remove them on the go – Yooooomi Aug 21 '18 at 9:38
  • How would you handle the viewer copying the data before deleting them? – Henk Aug 21 '18 at 9:39
  • Everyone can copy data, everyone can screenshot or whatever, this is not the issue here :) – Yooooomi Aug 21 '18 at 9:40
  • In this case, you could just not encrypt and publish the data using the deleted viewer's public key after an update. – Henk Aug 21 '18 at 9:42
0

You could use asymmetric encryption. I won't go into detail, but you could have the sender of the data encrypt it using the public key of the receiver, and store it either on the blockchain, or on IPFS or something, in which case you could store the data hash on the chain for verification. The public key is not the same as the address. It must either be provided by the receiver, or by deriving it from a signature of the receiver. There are ways to do that. After the data is stored on IPFS, the receiver can decrypt the data using their own private key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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