7

I am wondering if Ethereum can be used for encrypted peer to peer communication like delivering encrypted short messages or encrypted data in bulk between two or multiple parties.

Are there any examples or applications that I can review?

7

Check out the Use Cases section in the Ethereum Whisper protocol at https://github.com/ethereum/wiki/wiki/Whisper-Overview :

  • shh.post({ "topic": t, "payload": p }); No signature, no encryption: Anonymous broadcast; a bit like an anonymous subject-filtered twitter feed.
  • shh.post({ "from": myIdentity, "topic": t, "payload": p }); Open signature, no encryption: Clear-signed broadcast; a bit like a normal twitter feed - anyone interested can see a particular identity is sending particular stuff out to no-one in particular.
  • shh.post({ "to": recipient, "topic": t, "payload": p }); No signature, encryption: Encrypted anonymous message; a bit like an anonymous drop-box - message is private to the owner of the dropbox. They can't tell from whom it is.
  • shh.post({ "from": myIdentity, "to": recipient, "topic": t, "payload": p }); Secret signature, encryption: Encrypted signed message; like a secure e-mail. One identity tells another something - nobody else can read it. The recipient alone knows it came from the sender.
  • shh.post({ "from": myIdentity, "to": recipient, "topic": t, "payload": p, "deniable": d }); Secret signature, encryption with optional plausible deniability. If boolean parameter d is false, it is equivalent to the previous call. If d is true, recipient cannot prove to any third party that the message originates from sender, though still can verify it for herself. This is achieved by the digital signature being calculated on the symmetric session encryption key instead of the message body.

Response to your comment below

Quoting Péter Szilágyi from What are effective techniques to encrypt/decrypt data stored in a smart contract?:

Since all transactions and data on the blockchain are public, you need to encrypt the data outside of Ethereum and insert the already encrypted data. Similarly you need to pull the encrypted data and decrypt it locally. I'm sure there are a lot of crypto libraries for javascript that will allow you to do this, web3 I doubt contains such functionality as it's out of scope for it.

And quoting dbryson from Can smart contracts compute on encrypted data?:

If I understand your question correctly, what you are referring to is called secure multi-party computation which is not a current capability of smart contracts. In fact, it's a challenging problem that is probably best done off the blockchain as it can be computationally intensive. I'd recommend looking at MIT's enigma and openPDS projects for starters. I've not seen any planned milestones for this capability in Ethereum.

You may also want to check out the following:

  • @BokkyPoohBah Thanks a lot for your response. Do you know any Dapps that are implemented to do small or bulk encryption? How can one integrates smartcontract with encryption using Whisper so that for example once encryption is done, decryption is done within 24 hours and once decryption is done, it cannot be done again. Does that make sense? – user2065276 Apr 13 '16 at 14:06
  • Is there a limitation on the size of encrypted data that can be put on the Ethereum blockchain? – user2065276 Apr 13 '16 at 18:10
2

We have just propose our project UnwiredApp based on Ethereum. that is basically a Smart Contract that records messages related to a given user and let the recipient and only him to read them. The pitch video is here.

Essential solidity code in the smart contract is the following:

struct mess {
  uint256 idMessage;
  uint256 idPrevious;
  uint256 timestamp;
  address from;
  string message;
}

/* Array with all messages with structure messages[to][idMessage] */
mapping (address => mapping (uint256 => mess)) public messages;

So, every stored message is an structure holding values for the id, a pointer to the previous message, the timestamp, the sender (from) and message itself as a string.

All messages are stored on a mapping with 2 indexes, "to" and "idMessage". This way the smart contract can always answer about last messages for a given account.

  • 1
    And how does that contract work? Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Afr Jan 9 '17 at 13:26
  • Well, I have added some explanations. I hope it helps. – Juan Ignacio Pérez Sacristán Jan 9 '17 at 15:53

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.