Secure channel setup using Ethereum accounts

ETHCC 7 · 11 Jul 2024 · 16:06

Ramses Fernandez-Valencia, an applied cryptographer, presents work on secure group messaging that uses Ethereum accounts as identities. He compares sender keys with MLS and its TreeKEM mechanism, covering forward secrecy and post-compromise security, and notes that MLS needs total ordering of messages and is not fully decentralized. The plan is a first version combining MLS with a Sign-In with Ethereum style authentication service, then a second built on DCGKA, which is decentralized but scales less well.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

So well, first of all, thank you for joining me today in my presentation where I will talk about our work on secure channel setup using Ethereum accounts. I'm Ramses Fernandez, uh an applied cryptographer, a cryptographer in the applied cryptography and zero knowledge group of BAC. And I have divided this presentation in the following parts. I will start with the main motivation for for the project and the problem. And then I will introduce oh, sorry. I will introduce the main results.

After that, I will talk about TriCAM and ratcheting schemes, then I will follow with uh DMLS and the DC GKA protocols, and I will finish with uh presenting a basic architecture of the proof of the proof of concept that we are uh developing. So the motivation for the problem is that the usual approach to group messaging is based on ratcheting schemes and in particular sender keys. And the thing is that sender keys offer good uh good properties in terms of security and is a great solution for one-to-one communications. But the main issue is that when we are approaching the problem of group communications, the main or the usual approach is uh using sender keys as a one-to-one channel between the members of the group.

So it sets uh a one-to-one communication between each pair of users in a group, and that's not a this is not a very efficient solution. So this is where the MLS and the DCGKA uh come into play. So the main results are I will introduce a messaging protocol which is delivery service agnostic and uses Ethereum addresses as identifiers, and the approach uh has two stages. In the first version of the protocol, we will use the MLS protocol combined with an authentication service inspired by CWI, sign in with Ethereum. And a second version of the protocol will replace the MLS component with a variation of sender keys, in fact, the DCGKA, with a fully decentralized mechanism in mind.

Okay. So before getting into the details, let me introduce a couple of concepts related to the security of communication protocols, which are forward secrecy and post-compromise security. Okay, we say that a protocol is forward secure. If in the event of a key exposure, past messages remain uh confidential. It'd be a bit confusing talking about forward secrecy to refer to past messages, but that's all that's life. On the other hand, we have post-compromise security, and we say that a protocol is post-compromise secure if, in the event of a key exposure, and after a period of healing, after a healing period of time, uh messages after that period uh become confidential again.

So ratcheting schemes are mechanisms aiming to provide both forward secrecy and post-compromise security. Okay. So sender keys is the backbone for messaging uh applications like WhatsApp, uh Signal and Telegram and so on. And the main components are a secure communication channel between between peers, a symmetric encryption mechanism, a digital signature scheme, and a central server providing total ordering to some of the messages. Okay, and the following diagram depicts a high-level version or a high level description of the of sender keys.

And we see what we see in the figure is well, we start with an initial key, an initial input, the chain key CK1, which serves as an initial input for two hash functions, H and G. CK1 is the initial input for H, which will output a CK2 chain key two, which will be the initial uh input for a new function H, which will lead to CK3, and so on. At the same time, CK1 will be the input for a hash function G, which will output an MK1 key, which is an encryption key for the symmetric encryption mechanism. So once you combine this MK1 with uh plain text M, what you get is a message, a ciphertext message mu.

And the same happens with CK2, and the same happens with CK3, and so on. So among these ingredients, the one the most important is the secure communication channel between peers, and this is obtained via the double ratchet mechanism. Okay, in the DALD in the double ratchet, we what we have is Alice communicating communicating with Bob. And what we see in the figure is uh Alice point of view. It's exactly the same for Bob. Okay, so we call it the double ratchet because we are combining two mechanisms, a Diffie-Hellman key exchange and a key derivation function. And what we see is that Alice will use her secret key together with Bob with Bob's public key to feed the Diffie-Hellman key exchange and obtain a common a common secret, which in combination with a root key will be used with the keDF to obtain first a receiving key and a new feed or a new input for a new KDF.

In fact, the same KDF. So as we see in parallel, what we have is that Alice will use again her secret key with Bob's public key to fit the KDF and obtain a sender key, a sending key, and so on. Okay. So sender keys and the associated communication protocol set group communications, as I said, by creating one to one channels between peers. And that's not efficient. The problem, or that's the main motivation for the introduction of the MLS, which is a protocol designed to facilitate efficient and secure messaging communications in groups ranging from just a couple of users to potentially thousands. The good thing in uh with the MLS is that it brings flexible implementation, forward secrecy, and post-compromise security.

Okay. And the underlying mechanism in the MLS or the magic from the MLS comes from TriCEM, which is essentially a combination of recursive hashing with a final KDF step. And what we see in the left is a group of five users, A, B, C, D, and E, which manage to create a common group key, which is the root of the key by simply uh combining hashes on the secret keys of the users. The good thing of Trickam is that it allows for an easy removal and inclusion of new users to a group.

And that's what we see on the right side uh diagram, which we are including a new user F. And the thing is that all users in this new group will be able to compute the common group in the same fashion. I mean, combining hashes after hashes. Okay. So what which are the main drawbacks of DMLS from our point of view? The thing is that the MLS is essentially federated, it's not fully decentralized, and it requires total ordering in application and control messages. So when we add a member of a group, or when we remove a member of a group, or for when we for some reason a member decides to update the keys, this concurrency is requires in the MLS case total order in the mathematical sense, and this is obtained usually via an untrusted central server.

And that's the motivation for us to uh think about using the DCGKA as a next step. So as with blockchain technology and communication schemes also present their own trilemma where we have security, scalability, and decentralization. And the thing is that the MLS is great for security and scalability, but it's not that good uh when it comes to decentralization. The good thing on the DCGKA side is that it's amazing in security with the security, it's fully decentralized, but it's not that good on scalability. So you cannot have it all in this life.

Okay. So the DCGKA was a proposal made by in 2021 by Witner, Klepman, Hagenroth and Bergsford. The main strength is it it's that it's fully decentralized, avoids total ordering, and it replaces with causal order, which is a weaker uh a weaker, don't know how to say it's a weaker term, and it brings you strong security properties. The main drawbacks is that it's not that scalable, and it is not exactly a group key agreement, although the G and K in the acronym stands for group key.

To be honest, the DCGKJ is similar to sender keys, and this is what uh this figure uh it's a high-level uh description of the of this of sender keys. So what we have is a in is an initial input I1, which is the initial input for a say the random generator, a PRG function, which will output two values, and in an encryption key, K1, and the input for the next PRG, which will in turn return a K2 encryption key and the input for the next PRG and so on. The DCGKJ comes into play in order to distribute these initial values between all the users of a group.

Okay. Essentially, it's made of three pilers authentication, authenticated causal broadcast based on Lamport clocks, a decentralized group messaging based on deterministic functions, and it depends on each construction, and a two-party secure messaging based on an updatable public key encryption, which is essentially it's public key encryption where the sender somehow forces the receiver to update the public key once they receive the message. When it comes to authentication, the authentication service in a communication protocol is based or is responsible for maintaining user identities, issuing credentials to new users, and managing the authentication of credentials.

So usually in the MLS and also in the DCGKA, what we have the credentials are defined as a user ID, a digital signature scheme, a signaling public key and a digital signature on one, two, and three. What we have in mind is replacing somehow the authentication service using Ethereum accounts. I mean, essentially what we use is let me go back. The user's ID will be the others account, and the digital signature and sign in public key will come from the Ethereum network itself. When it comes to the access control, what we do is something C wish in the sense that we are using a simplified version of SyncNIN with Ethereum.

In the usual protocol, what we have is an interaction between the user and the authentication service, where the user sends a login request, the server provides a random nonce, the user needs to digitally sign the nonce, and the server simply provides a response. So and now that we have all the ingredients, this is the basic architecture of the solution that we are um creating.

That's the user side, and what we see is the user with the Ethereum address and the key package which feed the authentication service, which in turns provides uh some information for the on-chain storage, essentially the key packages of all users, and some information goes to the off-chain storage, and on the other side we have the the interaction with the MLS groups, and when it comes to the user connection, um the connection is given by the following diagram. We see the three users: user one, user two, user three, which all belong to a group G1. The identities of its user, ID one, ID2, ID3 go to the authentication service with in terms of storage off-chain and on-chain, and the communication channel is set by an agnostic pop-sub, which in can could be Wakwoo, could be RedSys or whatever.

Okay. I think yep. Questions I will be more than happy to give answer to the cryptographic side of questions, but not on the implementation and engineering side, sorry. Question thank you for the presentation. I'm quite new about the crypto repeat, but I have uh the development developed about the group key uh agreement, and usually the problem was when someone and the party leave, then we needed to create another group key because he's not anymore our group.

So how come how can uh this setting uh can change the group key? So you said uh something compromise the security. I forgot the name, but I I would like to see how can we do it. The thing is that well, this is something that can be managed with the the trick. And the thing is that in that point the MLS is responsible for sending messages to all the other users in the sense that maybe let's say Alice decided to remove a member of the group or or whatever, and that's the point. The MLS needs to send a message to all users, letting them know that some user was removed, and that's on one of the problems that needs to be in total order.

So the thing is that at the same time that Alice is removing Charlie from a group, or at the same time that something like that happens, another user can be uh uh updating the keys, and maybe another user is um adding a new member to the group. And the thing and one of the problems of the MLS is that all control messages letting all the users know that this is happening, need to be uh sent in exactly the same order they were proposed to all users. And all users need to receive this message.

That's uh the concept of total order, and that's the main problem with the MLS. Okay, yeah. Okay, anybody have another question? No? Less trends? Thank you. Okay, thank you.

Related talks