Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2024 Sep 4;14:20606. doi: 10.1038/s41598-024-71666-y

Formal analysis of signal protocol based on logic of events theory

Zehuan Li 1,2,, Meihua Xiao 1,, Ruihan Xu 1
PMCID: PMC11375095  PMID: 39232203

Abstract

The Signal is an end-to-end encrypted communication protocol composed of a double ratchet (DR) protocol and an extended triple Diffie-Hellman (X3DH) protocol. Its complex ratchet structure and the characteristics of protocol composition make it challenging to realize formal analysis. A formal analysis method based on logic of events theory (LoET) is proposed to conduct a security analysis of the Signal protocol. The method includes inference rules with key relation and key chain as the core to realize the formal analysis of ratchet structure, and the inference relation between sub-protocols is established by putting forward the composition theorem. The proposed method achieves a formal analysis of Signal, revealing that it does not satisfy a strong authentication property during the X3DH phase. The results show that the LoET-based method can be effectively applied in the formal analysis of Signal protocols, thus promoting the application and development of these protocols with ratchet structure and composition properties.

Keywords: Logic of events theory, Signal protocol, Ratchet protocol, Protocol composition, Formal methods

Subject terms: Mathematics and computing, Computer science

Introduction

Extensive monitoring and privacy disclosure make network users pay more attention to the security of network communication products. In particular, they hope to ensure the security of two-party and multi-party communication even when they do not trust the product provider and network environment. End-to-end encryption technology is an effective method for solving communication in an insecure network environment. Common network communication protocols using end-to-end encryption technology include off-the-record (OTR), OMEMO, Signal protocol, etc. The Signal protocol, developed by open whisper systems, is already widely used in social and instant messaging apps such as Signal, WhatsApp, Facebook, and Threema to provide secure communications. According to statistics, more than 1.5 billion users used Signal applications in 20181. The predecessor of the Signal protocol is called TextSecure. From 2014 to 2016, all versions of the TextSecure protocol were gradually unified and called Signal. Signal protocol inherited the core module of TextSecure protocol, therefore, TextSecure and Signal are regarded as the same protocol in this article.

The research on the provable security of Signal protocol is to construct an adversary and user interaction model based on the game-based method, and then reduce the protocol security problem into a mathematical problem. The game-based method has been recognized by many scholars in the research on the security of Signal protocol27, but the game-based approach does not directly map the adversary's attack path. Therefore, some scholars use logic-based structured reasoning methods to describe, analyze, and prove Signal and other cryptographic protocols816. Our research is based on LoET.

LoET is a formal method based on reasoning, which is mainly used for the formal analysis of distributed systems, especially the description and analysis of security protocols10,11,17. The basic LoET includes protocol description language, event system, axiom system, and security property definition. The protocol description language is used to precisely abstract the action of the security protocol, while the event system is the protocol action eventalized transformation rules, and the axiom system and the security property definition are a set of proof systems. In recent years, LoET has been used to analyze and prove the security of PUF, 5G-AKA, RCIA, and other protocols15,16,18.

Contribution

  1. We propose an analysis method of the ratchet structure of security protocols based on LoET. By extending the analysis capabilities of LoET on key relations and key chains. The formal analysis of symmetric ratchets and asynchronous ratchets is realized.

  2. We propose a method to prove the security properties of the composition protocol. By constructing a composition theorem between protocols and their sub-protocols, the modular analysis of complex protocols is realized and the complexity of the protocol analysis process is simplified.

  3. We conduct LoET to prove that Signal protocol cannot resist unknown key-share (UKS) attacks, and give suggestions for improvement. The results show that the extended LoET can be effectively applied to the security analysis of complex protocols with ratchet structures such as Signal.

Paper organization

The remaining organizational structure of this paper is as follows: Sect. "Related Work" introduces the current international research on the Signal protocol. Sect. "Signal Protocol" briefly describes the structure and basic functions of the protocol, and analyzes the interactive process and characteristics of Signal protocol. Sect.

"Logic of Event Theory" introduces LoET, gives the axioms and symbols needed in the following sessions, and presents the extended LoET. In Sect."Authentication proof of signal protocol" "Authentication Proof of Signal Protocol", extended LoET is used to prove the authentication of the Signal protocol. Sect."Discussion" "Discussion" discusses research results. Sect."Conclusion and future work" "Conclusion and Future Work" summarizes the work done and puts forward future work.

Related work

As an end-to-end encryption protocol, Signal is widely adopted in various instant messaging applications due to its stronger security properties. This widespread utilization has made researchers vigilant about security of Signal, prompting many scholars to dedicate their efforts to studying its security measures.

Frosch et al.19 first provided a comprehensive and accurate description of interaction process of the TextSecure protocol and conducted a security analysis. They established formal security definitions and security proof for the three component modules of the protocol and found that it was vulnerable to a UKS attack. After TextSecure was upgraded to Signal, Cohn-Gordon et al.2 proposed a formal security analysis method that can capture the ratchet structure. Moreover, they proved that the key exchange core of Signal protocol could satisfy standard security properties. Building on this approach, Cohn-Gordon et al.4 proposed an Asynchronous Ratcheting Trees (ART) design method for stronger security properties.Frosch and Cohn-Gordon's work discussed the security of the whole Signal protocol, while Bellare et al.3 focused on the ratchet structure of the Signal protocol, which used a game-based method to provide semantic and security definitions of protocol ratchet encryption and key exchange, presented a ratchet key exchange method with security verification, and then showed how to capture ratchet encryption properties from the ratchet key exchange and standard encryption. Compared with the research of Cohn-Gordon et al.2 Bellare et al. focused on a ratchet structure independent of Signal and other protocols as simple as possible, so as to capture the essence of the ratchet algorithm that needs to reach the target. Therefore, for the analysis of Cohn-Gordon, the ratchet step stops at key distribution. Bellare defines ratchet encryption as a two-party protocol based on trusted initial key distribution, which isolates ratchet key exchange from the message key exchange used to generate the initial key. This has the advantage of allowing for more modular processing. Poettering and Rösler5 proposed an improved unidirectional ratcheted key exchange (URKE) security model on the basis of Bellare et al.3 and introduced security models of sesquidirectional ratcheted key exchange (SRKE), bidirectional ratcheted key exchange (BRKE), gave the provable security structures of URKE and SRKE.

Multi-user participation in protocol operation makes protocol interaction more complex and security more uncertain. Rösler, Mainka & Schwenk6 proposed a comprehensive security model for analyzing group Signal, and found that the group communication of Signal protocol did not meet the requirements of post-compromise security.

Consider the security of the Signal protocol implementation. Alwen, Coretti & Dodis20 first formalized immediate decryption properties of Signal protocol and established a modular universal Signal protocol. Vatandas et al.21 first conducted formal research on the offline deniability of Signal protocol, proposed a general theorem, which linked the deniability of the communication session with the deniability of the key distribution protocol that initiates the session, extended the deniability result of the X3DH protocol in the initial phase to the entire Signal protocol. For software applications that use the Signal protocol, Paterson et al.22 conducted an in-depth analysis of Signal protocol implementation of Threema, especially focusing on its user registration, private key backup, and multiple user interaction.

Most of the above research is a game-based security analysis of the whole Signal protocol or only the ratchet structure. Other formal methods and tools are also applied to the research of Signal protocol. Almuzaini and Ahmad used Scyther, a formal verification tool, to conduct formal modeling and verification of Signal protocol. Jacomme et al.23 used Tamarin to verify the security properties of the protocol. Kamkuemah et al.14 proposed using epistemic logic for the security properties and interactive behavior of the Signal protocol. Zhao et al.24 used Spin to research the composition property of security protocols. Beguinet et al.25 used Tamarin to conduct formal modeling and verification of the Signal protocol. The related work is summarized in Table 1.

Table 1.

Summarization of the related work.

Related Work Summarization
Frosch et al.19 Established formal security definitions and security proof for the three component modules of the Signal protocol and found that it was vulnerable to UKS attack
Cohn-Gordon et al.2 Proposed a formal security analysis method that can capture the ratchet structure and proved that the key exchange core of Signal protocol could satisfy standard security properties
Cohn-Gordon et al.4 Proposed an ART design method for stronger security properties
Bellare et al.3 Proposed security definitions of the rachet mechanism, presented a ratchet key exchange method with security verification and showed how to capture ratchet encryption properties
Poettering and Rösler5 Proposed an improved URKE security model, introduced SRKE and BRKE security model, and gave the provable security structures of URKE and SRKE
Rösler, Mainka & Schwenk6 Proposed a comprehensive security model analyzing group Signal protocol
Alwen, Coretti & Dodis20 First formalized immediate decryption properties of Signal protocol and established a modular universal Signal protocol
Vatandas et al.21 First conducted formal research on the offline deniability of Signal protocol
Paterson et al.22 Conducted an in-depth analysis of Signal protocol implementation of Threema
Kamkuemah et al.14 Proposed using epistemic logic to analyze the security properties and interactive behavior of the Signal protocol
Zhao et al.24 Used Spin to research the composition property of security protocols
Beguinet et al.25 Used Tamarin to conduct formal modeling and verification of the Signal protocol

As can be seen from Table 1 and the above-related work, the current analysis of the Signal protocol is insufficient, and the research mainly focuses on the ratchet part of the Signal protocol, without considering whether the composition of subprotocols will affect the overall security of Signal. However, the key that triggers the Signal ratchet is generated by the initial sub-protocol negotiation, which leads to an unreasonable assumption that the key that triggers the Signal ratchet is secure if the Signal ratchet structure is considered separately. Therefore, a protocol composition analysis technology is urgently needed to realize the comprehensive analysis of Signal protocol. The current modeling of the DR structure of Signal is not accurate enough, because most of the work is based on the consideration of different ratchet states of Signal. However, this cannot express the continuity of ratchet operation in the protocol, and will lead to ignoring the intermediate process of ratchet conversion, that is, the relation and transmission of keys between different ratchets are not considered. So, for the DR structure of Signal, it is necessary to propose an analysis method that considers its continuous operation.

Signal protocol

In essence, the Signal protocol is a multi-stage authentication key exchange (AKE) protocol. The secure exchange of keys between users is the core function of the Signal protocol26,27. The Signal protocol generates an ephemeral key pair before each session to ensure the independence of the session but also retains a long-term key to identify the agents and avoid missing messages due to out-of-order messages, thus maintaining some relevance between sessions. The goals to be achieved in different stages of the Signal protocol are inconsistent, so the security strength of different stages of the Signal protocol is different. However, the key generation and exchange mechanism as the core of the protocol is unified, the key generated in the initial stage flows to the next stage along with the implementation of the protocol, so the strong security phase that leads to the protocol does not necessarily have stronger security. The independence of different phases should be considered in the security analysis of Signal, but the integrity of the entire protocol and the relation between phases should not be ignored. Therefore, we divide Signal into the X3DH phase and DR Phase. The action symbols of Signal protocol are described in Table 2.

Table 2.

Action symbol of Signal protocol.

Action Meaning Action Meaning
send(x) Send message x enc(x,k,c) The plaintext x is encrypted by the key k to obtain the ciphertext c
rcv(x) Receive message x dec(x,k,c) The ciphertext c is decrypted by the key to obtain the plaintext x
kdf(x,y) The kdf is key derivation function (KDF), x as input message and y as kdf output sign(x,k,s) The message x is signed by the key k to get the signature s
dh(m,n,x) The dh denotes an implementation of Diffie-Hellman (DH) algorithm, that is, dh function randomly chooses a group g, then computes x = g^(mn) verify(x,k,s) The signature s is verified by the key k for consistency with the message x
del(x) Delete message x genkey(<k,pk>) Generate key pair
bond(m,n,x) The bond denotes connection, that is, x is the result of the end-to-end connection of messages m and n encode(x) Encode the message x

X3DH phase

We divide the X3DH phase into the registration and the Diffie-Hellman (DH). Participants in the registration section are users and a server. Users need to upload their identity key, signed pre-key, signature of signed pre-key by user’s identity key, and one-time pre-shared key to the server26. The identity key is a long-term key, and the signed pre-key is a semi-long-term key, which is updated periodically as required. The one-time pre-key is a bundle of keys. After the server distributes a one-time pre-key to the session initiator, the key is deleted. In order to enhance the efficiency of the protocol, some simplified versions of the Signal protocol do not use the one-time pre-key. As a result, the security of the entire protocol deteriorates. This would make the overall protocol less secure, and we do not consider this scenario. Table 3 shows the symbolic representation of the key pair in the registration section (Fig. 1).

Table 3.

The key pair of the registration section.

Key pair Meaning
IK IPK Agent's long-term keys pair, * denotes an agent
SRK SRKP Agent's signed pre-key pair, * denotes an agent
OTK[n] OTPK[n] Agent's bundle of one-time pre-key pair, the length is n, * denotes an agent
OTKl OTPKl Agent's lth one-time pre-key, * denotes an agent

Fig. 1.

Fig. 1

Protocol interaction of the X3DH phase.

The registration section is when all Signal protocol users register their own keys with the server. This registration mechanism is to realize the offline communication function of the protocol. However, in the analysis and proof of the protocol, we do not consider the registration server of the initiator. This is because the key registered by the protocol initiator to the server does not participate in the session, so it is not considered.

In the DH section, the protocol initiator verifies the signature after obtaining the key data registered by the responder on the server. If the verification succeeds, the protocol continues to be executed. The goal of the DH section is to achieve the first session between the protocol initiator and responder and generate the initial root key of the DR Protocol after the first interaction. Table 4 shows the symbol of the key in the DH section.

Table 4.

The key pair of the DH section.

Key pair Meaning
EKi EPKi The ith generation ephemeral key pair generated by the agent *
SK - Shared key
AD - Associated data byte string
dh - The result of the DH calculation output
Sdh - The results of the bond calculation output
encode(Key) - Encoding calculation

The interaction between the registration section and the DH section is depicted by the protocol description language, as shown in Fig. 2. The symbols outside the key are described as shown in Table 4.

Fig. 2.

Fig. 2

The interaction of the DR Protocol.

The DR phase

The DR Phase is the actual session phase of the Signal protocol. This phase has two parts, one called the DH ratchet and the other called the symmetric ratchet27 The DH ratchet is used to trigger the rotation of the symmetric ratchet. When the symmetric ratchet is activated by the DH ratchet, the symmetric ratchet automatically rotates to generate a message key for encryption and decryption. The key symbols in the DR phase include the ratchet key, root key, chain key, and message key, as shown in Table 5.

Table 5.

The key pair of the DR phase.

Key pair Meaning
RHKi RHPKi The ratchet key pair is generated by the agent * for the ith time
RKi,jIR/RI - The root key is generated by the initiator (responder) for the ith DH ratchet, jth symmetric ratchet rotation
CKi,jIR/RI - Chain key, explain in detail such as the root key
MKi,jIR/RI - Message key, explain in detail such as the root key

The root key used at the beginning of the first round of DR protocol is the shared key SK obtained in the X3DH phase. This key and the ratchet key generated by the protocol executor act as the wedge of the root key, chain secret key, and message key of the DR protocol. The difference between the nth round of DR protocol and the initial round is that the root key of the initial round is from the shared key calculated in the X3DH phase, while the root key of the nth round is calculated in the last DR phase. The specific interaction of the DR phase is shown in Fig. 2.

The generation of the key of the DR protocol is in the form of trees2830. The update of the root key RKi,jIR/RI is the trunk of the whole tree, and the chain key CKi,jIR/RI and the message key MKi,jIR/RI are the branches of the tree, as shown in Fig. 3. Both encryption and decryption keys are branches derived from the trunk of a tree. Combined with the concept of DR, the rotation of the DH ratchet is the growth of the tree, and the rotation of the symmetric ratchet is the generation and growth of branches.

Fig. 3.

Fig. 3

The tree structure of the key chain.

Logic of event theory

Brief introduction of event logic and its defects

The LoET is a formal method based on theorem proving, which is mainly used for the formal analysis of distributed systems. According to the characteristics of security protocol, the basic LoET includes protocol description language, event system, axiom system, and security property definition. The protocol description language is used to precisely abstract the action of the security protocol, while the event system is the protocol action eventalized transformation rules, and the axiom system and the security property definition are a subset of proof systems. The main symbols and symbolic semantics of the event system are shown in Table 6.

Table 6.

Basic symbolic syntax and semantic.

Symbol and Form Expression Semantic

A,B

thr1,thr2

A=B,AB Agent or thread’s identifier
atom = { a,b,data,Key}

a=b,ab,

<a,b,key>

Atom denotes basic data unit
E = { New,Send,Rcv,Sign,Verify,Enc,Dec,e } E(e),E(Atom) = <Atom> Events describe the protocol state
action = { new,send,rcv,sign,verify,enc,dec } action(E(e)) Action describes protocol run and behavior
Honest HonestId The agent of identifier Id is honest
loc Id=loc(E) Event E occurs at the location of the identifier Id
bss bss(Id,Id,Id) Basic sequence bss denotes event sequence
oneOf oneOf(bss,Id) The bss is event basic sequence of identifier Id
inOneOf inOneOf(E,Id,bss,Id) The event E in bss occurs at the agent of the first identifier Id and thread of the second identifier Id
MatchingKeys MatchingKeys(Key,Key) The two keys match
has Id/EhasAtom Atom is included in the content of the agent or thread
Id/EAtom Atom independent of the content of the agent or thread
atom e1 atom e2 An event has atom data that derives from another event
<, e1<e2,e1e2 The event of the symbolic left side occurs earlier than the event of the symbolic right side, or equality
n thr1nthr2 There are n matching sessions between the two threads

LoET was first proposed in the literature11,17 and used to analyze and prove the authentication of security protocols. Later, the extension of LoET was mainly about the simplification of the proof steps and the security properties proof of the fine-grained protocol model. LoET urgently needs to strengthen the analysis ability of complex structure protocols. LoET has the following defects:

  1. LoET cannot analyze the ratchet structure. The ratchet structure of the security protocol generates a tree-like key chain, which grows in a depth-first way, and each leaf node represents a different key. At present, LoET analyzes key transfer and exchange through flow relation axioms, order, independence, and ownership relations, but these cannot analyze the relation between leaf nodes in the tree secret key chain, and cannot conduct a comprehensive security analysis of ratchet structure.

  2. LoET lacks the ability to analyze composition protocols. The current security protocol is usually a combination of multiple protocols, for example, the Signal protocol consists of the X3DH protocol and the DR protocol. For the analysis of the composition properties of multiple protocols, LoET lacks corresponding theorems to guide the analysis process, that is, it cannot effectively analyze the relation and the key flow between protocols.

Therefore, in view of the above problems, we extend the LoET and use the extended LoET to analyze and prove the Signal protocol.

Extend logic of event theory

In order to capture the ratchet structure in the protocol, key generation events GenKey(<Key,Key>), DH events DH(<Key,Key>,Key), KDF events KDF(<Key,Key>,Key), bond events Bond(<Atom,Atom,Atom>), and deletion events Del(Key) are proposed. According to these events, corresponding theorems and lemmas are proposed.

Definition 1.

Event Value. Event value refers to the item contained in the event operator, the symbol is expressed as Val(E(x))=x.

Definition 2.

Key Generation Event. The key generation event GenKey(<Key,Key>) generates a new key or key pair in the agent. The new key is guaranteed to be unique and does not exist in any location before generation.

Definition 3.

Del Event. The deletion event Del(Key) deletes the key in the protocol agent, and then the key does not exist in the protocol agent.

Definition 4.

Key Relation. The key relation means that there is a key that participates in the calculation of a certain event and generates a new key, then the set of all keys participating in the calculation is related to the newly generated key, but the generated new key is no related between them, and the specific definitions are as follows:

KRel(K1,K2)defe:E.ehas(K1K2)K1K2

Theorem 1

If the key K constructs a relation with the key K in an event, then the key K can deduce the key K. The formal description is as follows:

K,KVal(E(e)).KRel(K,K)(KK)

Proof: This can be proved according to the definition of the key relation.

Theorem 2

Analysis for a single agent A, If no event E(Rcv) occurs in the key lifetime, then there must be an event generating the key. The formal description is as follows:

E(Rcv)||ke:E.ehaske=E(GenKey)

Proof: Suppose that there is no key generation event E(GenKey) in agent A when agent A uses a key k to encrypt, decrypt, or sign data, the key k does not originate from internal generation, then the agent must obtain k through E(Rcv), which is in contradiction with the precondition E(Rcv)||k.

Lemma 1

Analysis for a single agent A, If there is not an associated computation event in the key's lifetime, then there must be an E(Rcv) event.

E(GenKey)||ke:E.ehaske=E(Rcv)

Proof: Suppose that there is no receiving event E(Rcv) in agent A, when agent A uses a key k to encrypt, decrypt, or sign data, the key k does not originate from external receiving, then the agent must be generated through E(GenKey), which is in contradiction with the precondition E(GenKey)||k.

Definition 5

Bond Event. The bond event Bond(<Atom,Atom,Atom,>) inputs the atomic type parameter in the protocol agent and outputs the result of the bond calculation. This event is proposed to avoid the ambiguity between the independent symbol and the bond symbol.

Definition 6

Key Chain. Key chain KChain(Key,n,l=0,1,2) refers to similar keys (generated in the same way and with the same function) that have relevance, order, causality, and functional consistency. Then these keys form a key chain, and the specific definitions are as follows:

KChain(Key,n,l=0,1,2)defn:N+.Kn:Key.e:E.KkVal(e).((l=2l=1)(K1K2K3Kn-1Kn)).((l=2l=0)(K1K2K3Kn-1Kn))

The l is direction label of the key chain, the l = 0 refers to a reverse key chain, the l = 1 refers to a forward key chain, and the l = 2 refers to a two-way key chain. The N+ is a set of positive integers, the n is the length of the key chain. An application example of predicates KRel and KChain is shown in Appendix A.

Definition 7 DH Event

The DH event DH(<Key,Key,>,Key) executes calculations based on the DH algorithm in the agent of the protocol.

Theorem 3

The key K1 can deduce the Key K2, the Key K2 can deduce the key K3, then it is considered that the key K1 can deduce the K3.

KRel(K1,K2)KRel(K2,K3)KRel(K1,K3)

Proof: When there is KRel(K1,K2) then K1 can be derived K2; When there is KRel(K2,K3) then K2 can be derived K3. According to definition 7, there is a key chain KChain(K,3,1), then KRel(K1,K3) can be obtained.

Definition 8

KDF Event. KDF event KDF(<Key,Key,>,Key) executes the calculation based on the KDF algorithm in the agent of the protocol.

Theorem 4.

The key generated by the event E(KDF) can not reversely imply the input key of this event. The formal description is as follows:

<K,K>=Val(E(KDF))KChain(K,n,1)¬KChain(K,n,0)

Proof: According to the definition of event E(KDF), it can be seen that it is a one-way event, so a one-way key chain can be formed.

Definition 9

Match. Similar to encryption and decryption, such corresponding events are called matches, and the existing matches are as follows:

  1. Given a decryption event, if there is an encryption event and an existing equation ValDecx=Val(Enc(x)), then the encryption event matches the decryption event, defined as DEMatch(E(Dec),E(Enc)).

  2. Given a receiving event, if there is a sending event and an existing equation ValRcvx=Val(Send(x)), then the sending event matches the receiving event, defined as RSMatch(E(Rcv),E(Send)).

  3. Given a verification event, if there is a signature event and an existing equation ValRcvx=Val(Send(x)), then the signature event matches the verification event, defined as VSMatch(E(Verify),E(Sign)).

The definition of match leads to the axiom about the uniqueness of a match:

  • DEM Val(Dec(m,k,s))=Val(Enc(m,k,s))DEMatch(E(Dec),E(Enc))E(Enc)<E(Dec).

  • RSM Val(Rcv(m,k,s))=Val(Send(m,k,s))RSMatch(E(Rcv),E(Send))E(Send)<E(Rcv).

  • VSM Val(Verify(m,k,s))Val(Sign(m,k,s))m=mMatchK(k,k)VSMatch(E(Verify),E(Sign))E(Sign)<E(Verify).

The Decryption and Encryption Match (DEM) axiom states that when there is a decryption event, there must be an encryption event before the decryption event that matches it. The Receiving and Sending Match (RSM) axiom states that when there is a receiving event, there must be a sending event that matches the receiving event. The Verification and Signature Match (VSM) axiom states that when there is a verification event, there must be a signature event that matches it before the verification event.

Definition 10

Authentication. The authentication of the protocol is defined through the matching of sessions between agents. The specific definitions are as follows:

Pr|=auth(bss,n)defA,B.thr1.(Honest(A)Honest(B)Pr(A)Pr(B)ABloc(thr1)=Abss(A,B,thr1))thr2.loc(thr2)=Bthr1nthr2

The definition of strong authentication in LoET is to add a strict event ordering based on the authentication definition, that is, E(Send) match with E(Rcv), and E(Send) must occur before E(Rcv).

Theorem 5

Protocol Composition. Given protocol P, if the protocol consists of p and q, and the initial data k in protocol q is passed by protocol p, then for the security property formula ϕ, there is pϕqϕPϕ, if and only if k is not leaked.

Proof: If protocol P does not satisfy the formula ϕ, then P may not satisfy the formula ϕ in part p, or it may not satisfy the formula ϕ in part q. If the failure to satisfy ϕ occurs in the process of running subprotocol p, obviously, protocol P does not run to sub-protocol q, so protocol p directly does not satisfy the formula ϕ, hence the contradiction. If the failure to satisfy ϕ occurs during the operation of sub-protocol q, protocol p is completed before protocol q, the key k is passed to protocol q as the initial data, then for q, as long as the initial data is secure, the operation of protocol q is independent of the operation of p. Therefore, if the key k is not leaked, protocol q directly fails to satisfy the formula ϕ, resulting in a contradiction.

Authentication proof of signal protocol

Proof procedures

The Signal protocol is a composition of X3DH and DR protocols in sequence. We use the extended LoET to prove the authentication of X3DH and DR Protocols respectively through the process shown in Appendix B.

Detailed steps of Fig. 4 are explained as follows:

  1. Describe the protocol using the protocol description language and divide the basic sequence.

  2. Assume existing the honest agent, and make the honest agent the instance in the basic sequence. Recursively proves whether there is a match between basic sequences.

  3. According to decryption and encryption match axiom DEM, Receiving and Sending Match axiom RSM, Theorem 1, and flow relation deduce match event。

  4. The match session is proved by the honesty AxiomS, DEM, and protocol interaction specification, taking the match event in the instantiation basic sequence as the entry point.

  5. The order of match sessions is proved by the flow relation, the verification and signature match axiom VSM. This step completes the proof of strong authentication.

Fig. 4.

Fig. 4

Proof process of LoET.

After all the sub-protocols are proved, Theorem 5 is finally demonstrated to determine whether the protocol is satisfied with the security properties. The axioms of the LoET axiom system used in the proof are shown in Fig. 4.

Authentication proof of X3DH

Analyzing the X3DH protocol of Fig. 1, we can divide the protocol getting the basic sequence of the protocol. The basic sequence of the initiator is as follows:

I1=send(B)I2=I1,rcv(IPKB,SRPKB,S0,OTPKlB),verify(encode(SPKB),IPKB,S0)I3=I2,genkey(<EKiA,EPKiA>),dh(IKA,SRPKB,dh1),dh(EKiA,IPKB,dh2),dh(EKiA,SRPKB,dh3),dh(EKiA,OTPKlB,dh4),bond(dh1,dh2,dh3,dh4,Sdh),kdf(Sdh,SKA)I4=I3,del(EKiA,dh1,dh2,dh3,dh4),bond(encode(IKA),encode(IPKA),AD)I5=I4,enc(m0,<AD,SKA>,S1),send(IPKA,EPKiA,l,S1) 1

The basic sequence of the responder is as follows:

R1=genkey(<SRKB,SRPKB>,<OTKB[n],OTPKB[n]>),sign(encode(SPKB),IKB,S0),send(B,IPKB,SRPKB,S0,OTPKlB)R2=R1,rcv(IPKA,EPKiA,l,S1)R3=R2,dh(SRKB,IPKA,dh1),dh(IRB,EPKiA,dh2),dh(SRKB,EPKiA,dh3),dh(OTKlB,EPKiA,dh4),bond(dh1,dh2,dh3,dh4,Sdh),kdf(Sdh,SKB)R4=R3,del(dh1,dh2,dh3,dh4),bond(encode(IPKA),encode(IKB),AD)R5=R4,dec(m0,<AD,SK>,SB),del(OTKlB) 2

The basic sequence of the server-side protocol is as follows:

S1=rcv(B,IPKB,SRPKB,S0,OTPKlB)S2=S1,rcv(B)S3=S2,send(IPKB,SRPKB,S0,OTPKlB),del(OTPKlB) 3

The X3DH protocol is ProtocolI1,I2,I3,I4,I5,R1,R2,R3,R4,R5,S1,S2,S3, first proves the authentication, satisfying X3DH|=auth(R5,4). Assuming that two honest agents A and B follow the Signal protocol, the instantiated threads thr1 of A and the instantiated threads thr2 of B execute the operations in the basic sequence of the X3DH protocol, and the operations in the basic sequence of the X3DH protocol are mapped to events in the thread. According to the actual protocol interaction in this case, A refers to the initiator, and B refers to the responder.

Make the thread thr2 of the honest agent B instantiate as an instance in the sequence R5, so that there are an event sequence e0<loce1<loc<loce13 in the sequence containing some atoms type such as S0, S1, SKB, AD, and atoms-like information parameters. R5 instantiation looks like this:

e0<loce1<loc<loce13GenKey(e0)=<<SRKB,SRPKB>,<OTKB[n],OTPKB[n]>>Sign(e1)=<encode(SPKB),IKB,S0)Send(e2)=<B,IPKB,SRPKB,S0,OTPKlB>Rcv(e3)=<IPKA,EPKA,l,S1>DH(e4)=<SRKB,IPKA,dh1>DH(e5)=<IRB,EPKiA,dh2>DH(e6)=<SRKB,EPKiA,dh3>DH(e7)=<OTKlB,EPKiA,dh4>Bond(e8)=<dh1,dh2,dh3,dh4,Sdh>KDF(e9)=<Sdh,SKB>Del(e10)=<dh1,dh2,dh3,dh4>Bond(e11)=<encode(IPKA),encode(IKB),AD>Dec(e12)=<m0,<AD,SKB>,S1>Del(e13)=<OTKlB> 4

The event e12 is the decryption for the message S1, so according to the axiom AxiomS and the axiom DEM, we know that there must be an encryption event e that matches e12 so that the following formula is satisfied:

e<e12DEMatch(e12,e)loc(e)=Bloc(e)=A 5

Among the instances of the basic sequence, only I5 contains the encryption event E(Enc), so supposing that e is an instance in I5, including S1 and other atom or atom-like parameters, we can get:

e0<loce1<loc<loce13Send(e0)=<B>Rcv(e1)=<IPKB,SRPKB,S0,OTPKlB>Verify(e2)=<encode(SPKB),IPKB,S0>GenKey(e3)=<EKiA,EPKiA>DH(e4)=<IKA,SRPKB,dh1>DH(e5)=<EKiA,IPKB,dh2>DH(e6)=<EKiB,SRPKB,dh3>DH(e7)=<EKiA,OTPKlB,dh4>Bond(e8)=<dh1,dh2,dh3,dh4,Sdh>KDF(e9)=<Sdh,SKA>Del(e10)=<EKiA,dh1,dh2,dh3,dh4>Bond(e11)=<encode(IKA),encode(IPKB),AD>Enc(e12)=<m0,<AD,SKA>,S1>Send(e13)=<IPKA,EPKiA,l,S1> 6

From the formula, it can be found that the structure of events e12 and e12 is equal, and according to the decryption axiom DEM, the following formula can be obtained:

Enc(e12)=<m0,<AD,SKA>Dec(e12)<m0,<AD,SKB>,S1>DEMatch(e12,e12) 7

Therefore, the encryption event e12 in the thread thr1 matches the decryption event e12 in the thread thr2, and gets:

DEMatch(e12,e12)loc(e12)=BS1=S1(<AD,SK>=<AD,SKB>) 8

Then according to the axiom AxiomK:

MachingKeys(AD,AD)MachingKeys(SK,SK) 9

It can be seen that the generated keys AD and AD, SK and SK match, so according to Theorem 1 and the flow relation, it can be concluded that:

(IK=IPKAIPK=IKB)(Sdh=Sdhdh1=dh1dh2=dh2dh3=dh3dh4=dh4(OTPKlB=OTKlBl=l)EKiA=EPKiASRPK=SRKB) 10

In summary, it can be proved that DEMatch(e13,e3), Enc(e13) and Dec(e3) match.

In the case of the above analysis, there is an event Rcv(e1) in the sequence I5, and according to the receiving the axiom RSM, it can be known that there must be an event E(Send) that matches Rcv(e1). I1-I5, S3, R1-R5 contain the event E(Send), considering the validity of the protocol, the interaction of the protocol should be two or more parties, excluding R1-R5. the event E(Send) of I1-I5 and the event Rcv(e1)=<IPK,SRPK,S0,OTPK1B> cannot be one-to-one in structure, so it is excluded.

Suppose that there is an event e matching Rcv(e) in S3, it can be obtained.

e0<loce1<loce2<loce3Del(e0)=<OTPKl>Send(e1)=<IPKB,SRPKB,S0,OTPKl>Rcv(e2)=<B>Rcv(e3)=<B,IPKB,SRPKB,S0,OPTKl[n]> 11

According to the axiom RSM, Rcv(e0) and Rcv(e1) must have E(Send) to match with them, so there are I1-I5, S3,R1-R5 with the event E(Send), and considering the actual interaction meaning of the protocol, S3, I3-I5, R2-R5 are excluded. It can be seen that there are:

RSMatch(e0,e2)RSMatch(e1,e0) 12

It can be obtained that the event Rcv(e0) matches the event Send(e2), and the event Rcv(e1) matches the event Send(e0). According to the flow relation, the event Send(e2) parameters in S3 can be obtained, and get:

Del(e0)=<OTPKlB>Send(e1)=<IPKB,SRPKB,S0,OTPKlB>Rcv(e2)=<B>Rcv(e3)=<B,IPKB,SRPKB,S0,OPTKB[n]> 13

To sum up, RSMatch(e1,e2) can be proved, the events Rcv(e1) and Send(e2) match. After the above proof, the new basic sequence I5 is deduced as follows:

Send(e0)=<B>Rcv(e1)=<IPKB,SRPKB,S0,OTPKlB>Verify(e2)=<encode(SPKB),IPKB,S0>GenKey(e3)=<EKiA,EPKiA>DH(e4)=<IKA,SRPKB,dh1>DH(e5)=<EKiA,IPKB,dh2>DH(e6)=<EKiA,SRPKB,dh3>DH(e7)=<EKiA,OTPKlB,dh4>Bond(e8)=<dh1,dh2,dh3,dh4,Sdh>KDF(e9)=<Sdh,SKA>Del(e10)=<EKiA,dh1,dh2,dh3,dh4>Bond(e11)=<encode(IK),encode(IPKB),AD>Enc(e12)=<m0,<AD,SKA>,S1>Send(e13)=<IPK,EPKiA,l,S1> 14

The basic sequence R5 is as follows:

GenKey(e0)=<<SRKB,SRPKB>,<OTKB[n],OTPKB[n]>>Sign(e1)=<encode(SPKB),IKB,S0)Send(e2)=<B,IPKB,SRPKB,S0,OTPKlB>Rcv(e3)=<IPK,EPK,l,S1>DH(e4)=<SRKB,IPK,dh1>DH(e5)=<IRB,EPKiA,dh2>DH(e6)=<SRKB,EPKiA,dh3>DH(e7)=<OTKlB,EPKiA,dh4>Bond(e8)=<dh1,dh2,dh3,dh4,Sdh>KDF(e9)=<Sdh,SK>Del(e10)=<dh1,dh2,dh3,dh4>Bond(e11)=<encode(IPK),encode(IKB),AD>Dec(e12)=<m0,<AD,SKA>,S1>Del(e13)=<OTKlB> 15

It is proved that A and B have two matching sessions during the execution of the protocol, and a shared key is generated, which satisfies the weak authentication, but to prove the strong authentication of agents also needs to prove the orderings e13<e3, e2<e1, e1<e1, e0<e2. According to the above process of proving that events e13 and e3 is matching session, we can get e13<e3, then prove e2<e1, e1<e1, e0<e2. There is an event e2 in the basic sequence I5, and according to the axiom VSM, there must be a sign event matching it. The sequence containing sign events is R1-R5, considering the sequence of protocol execution, and ignoring events that have not occurred, then excluding R2-R5, the only sequence containing sign event is only R1. Then VSMatch(e1,e1) can be obtained from the axiom VSM, the events Verify(e1) match with Sign(e1), and there are e2<e1, but e2<e1, e1<e1, e0<e2 are not sufficient conditions, then X3DH does not satisfy the strong authentication property, but only satisfies the weak authentication property.

Authentication proof of DR

In the Signal protocol, the X3DH protocol provides one-way authentication services for the initiator and the responder and provides an initial key for the subsequent interaction of the DR protocol. Its relation with the DR protocol is only that the shared key SK is used as the initial root key in the DR protocol to generate message keys.

Figure 2 shows the nth round of DR protocol interaction. In the process of using LoET to analyze the DR protocol, each interaction of the protocol, that is, the success of the interaction in the symmetric ratchet phase is regarded as a one-way authentication of B to A or A to B. If the agent of the receiving message can successfully decrypt the message sent by the agent of the sending message, the authentication is successful; otherwise, the protocol does not satisfy the authentication. The relation between protocol interaction and authentication makes the protocol from the first interaction to the kth interaction regarded as the interaction of the protocol completion k/2 round, that is, the protocol completes the second two-way authentication k/2 times. So the protocol interaction has universal characteristics, analyzing the authentication of the first round of interaction in the protocol can deduce the authentication of (k/2)th round of interaction. The basic sequence of the initiator of the first round of the DR protocol is divided as follows:

I1=genkey(RHK0A,RHPK0A),dh(RHK0A,SRPKB,dhr1),kdf(dhr1,SKA,<CK0,0IR,RK0,0IR>),kdf(CK0,0IR,<CK0,1IR,MK0,0IR>),enc(m1,MK0,0IR,S2)I2=I1,send(S2,RHPK0A),del(CK0,0IR,SKA,MK0,0IR)I3=I2,rcv(S3,RHPK0B)I4=I3,dh(RHK0A,RHPK0A,dhr2),kdf(dhr2,RK0,0IR,<CK1,0IR,RK1,0IR>,kdf(CK1,0IR,<CK1,1IR,MK1,0IR>)),dec(m2,MK1,0IR,S3),del(CK1,0IR,RK0,0IR,MK1,0IR) 16

The basic sequence of the responder is divided as follows:

R1=rcv(S2,RHPK0A)R2=R1,dh(RHPK0A,SRKB,dhr1),kdf(dhr1,SKB,<CK0,0RI,RK0,0RI>),kdf(CK0,0RI,<CK0,1RI,MK0,0RI>),dec(m1,MK0,0RI,S2),del(CK0,0RI,SKB,MK0,0RI)R3=R2,genkey(<RHK0B,RHPK0B>),dh(RHK0B,RHPK0A,dhr2),kdf(dhr2,RK0,0RI,<CK1,0RI,RK1,0RI>),kdf(CK1,0RI,<CK1,1RI,MK1,0RI>),enc(m2,MK1,0RI,S3),del(CK1,0RI,RK0,0RI,MK1,0RI)R4=R3,send(S3,RHPK0B) 17

The first round of the DR protocol is as follows ProtocolI1,I2,I3,I4,I5,R1,R2,R3,R4,R5,S1,S2,S3. Prove the authentication of A to B DR|=auth(I4,2). Suppose there is an honest agent A executing thread thr1, an honest agent B executing thread thr2, and the agent follows the DR protocol. Thread thr1 is an instance of I4, then there is an event sequence e0<loce1<loc<loce12 in the agent A, for some Id, Atoms, Key type parameters S2, RHK0A, RHPK0A, etc.:

e0<loce1<loc<loce12GenKey(e0)=<RHK0A,RHPK0A>DH(e1)=<RHK0A,SRPKB,dhr1>KDF(e2)=<dhr1,SKB,<CK0,0IR,RK0,0IR>>KDF(e3)=<CK0,0IR,<CK0,1IR,MK0,0IR>>Enc(e4)=<m1,MK0,0IR,S2>Send(e5)=<S2,RHPK0A>Del(e6)=<CK0,0IR,SKA,MK0,0IR>Rcve7=<S3,RHPK0B>DH(e8)=<RHK0A,RHPK0A,dhr2>KDF(e9)=<dhr2,RK0,0IR,<CK1,0IR,RK1,0IR>>KDF(e10)=<CK1,0IR,<CK1,1IR,MK1,0IR>>Dec(e11)=<m2,MK1,0IR,S3>Del(e12)=<CK1,0IR,RK0,0IR,MK1,0IR> 18

According to the rules of the axioms DEM and AxiomS, it can be deduced that the existence event e satisfies the formula e<e11DEMatch(e,e11)loc(e)=B. The honest agent B follows the DR protocol, then the event e must be an instantiation in the basic sequence of the DR protocol. It can be known that the basic sequence contains an event E(Enc) including I1, I2, I3, I4, R3, R4. If e is an instantiation in the basic sequence I1, I2, I3, I4, then according to the actual meaning of the implementation of the protocol, there is loc(e)=AB, which does not meet the requirements of loc(e)=B, so it is excluded. If e is an instantiation event in the basic sequence R4, then there are parameters such as RHK0B, RHPK0B, SRKB in agent A, and the event sequence e0<loce1<loc<loce12 can be expressed as follows:

e0<loce1<loc<loce12Rcv(e0)=<S2,RHPK0A>DH(e1)=<RHPK0A,SRK,dhr1>KDF(e2)=<dhr1,SK,<CK0,0RI,RK0,0RI>>KDF(e3)=<CK0,0RI,<CK0,1RI,MK0,0RI>>Dec(e4)=<m1,MK0,0RI,S2>Del(e5)=<CK0,0RI,SK,MK0,0RI>GenKey(e6)=<RHK0B,RHPK0B>DH(e7)=<RHK0B,RHPK0A,dhr2>KDF(e8)=<dhr2,RK0,0RI,<CK1,0RI,RK1,0RI>>KDF(e9)=<CK1,0RI,<CK1,1RI,MK1,0RI>>Enc(e10)=<m2,MK1,0RI,S3>Del(e11)=<CK1,0RI,RK0,0RI,MK1,0RI>Send(e12)=<S3,RHPK0B> 19

Events e11 and e10 in the above sequence satisfy:

Enc(e10)=<m2,MK1,0RI,S3>Dec(e11)=<m2,MK1,0IR,S3>DEMatch(e10,e11)

The encryption event e11 is matched with the decryption event e10, getting m1=m1, MatchingKeys(MK0,1IR,MK0,1RI), S2 = S2. According to Lemma 1, it can be known that RHPK0B = RHPK0B, then there is an event Rcv(e7)=<S3,RHPK0B> in the basic sequence I4, which matches the event Send(e12)=<S3,RHPK0B> in R4.

If e is an instantiation of the basic sequence R3, the reasoning process is similar to the instantiation reasoning process of R4, but it cannot deduce the match between events E(Send) and event E(Rcv), so it is excluded, instantiation R4 has:

Rcv(e0)=<S2,RHPK0A,MK0,1IR>DH(e1)=<RHPK0A,SRK,dhr1>KDF(e2)=<dhr1,SK,<CK0,0RI,RK0,0RI>>KDF(e3)=<CK0,0RI,<CK0,1RI,MK0,0RI>>Dec(e4)=<m1,MK0,0RI,S2>Del(e5)=<CK0,0RI,SK,MK0,1RI>GenKey(e6)=<RHK0B,RHPK0B>DH(e7)=<RHK0B,RHPK0A,dhr2>KDF(e8)=<dhr2,RK0,0RI,<CK1,0RI,RK1,0RI>>KDF(e9)=<CK1,0RI,<CK1,1RI,MK1,0RI>>Enc(e10)=<m2,MK1,0RI,S3>Del(e11)=<CK1,0RI,RK0,0RI,MK1,0RI>Send(e12)=<S3,RHPK0B> 20

In terms of the instantiation result of an event e in the basic sequence R4, it can be seen that there is an event Dec(e4), and according to the rules of DEM and AxiomS, there must be some event e satisfying e<e4DEMatch(e,e4)loc(e)=A. The sequences with events E(Enc) are I1, I2, I3, I4, R3, R4, and the sequences I3, I4, R3, R4 do not conform to the validity of the protocol, so they are excluded. If e is an instantiation event in I2, then the Id, Atoms, and Key type parameters have an event sequence e0<loce1<loc<loce6, which is obtained as follows:

GenKey(e0)=<RHK0A,RHPK0A>DH(e1)=<RHK0A,SRPKB,dhr1>KDF(e2)=<dhr1,SKA,<CK0,0IR,RK0,0IR>>KDF(e3)=<CK0,0IR,<CK0,1IR,MK0,0IR>>Enc(e4)=<m1,MK0,0IR,S2>Send(e5)=<S2,RHPK0A>Del(e6)=<CK0,0IR,SKA,MK0,0IR> 21

The instantiated events e4 and e4 in I2 satisfy:

Enc(e4)=<m1,MK0,1IR,S2>Dec(e4)=<m1,MK1,0RI,S2>DEMatch(e4,e4)

The encryption event e4 is matched with the decryption event e4, and m1 = m1, MatchingKeys(MK0,1IR,MK1,0RI), and S2 = S2, and then according to Lemma 1, it can be known that RHPK0A = RHPK0A, then there is a matching RSMatch(e0,e5), and the event Send(e5) matches the event Rcv(e0).

Analysis procedure of I1 is similar to I2, but E(Send) and E(Rcv) can not be deduced, so it is excluded. The analysis process of I3 and I4 is consistent with that of I2, but because of the order of sessions (the second session must occur after the first session), there is no need to consider the occurrence of the second session during the analysis of the first session, so exclude I3, I4. Therefore, the final I2 has:

GenKey(e0)=<RHK0A,RHPK0A>DH(e1)=<RHK0A,SRPKB,dhr1>KDF(e2)=<dhr1,SKA,<CK0,0IR,RK0,0IR>>KDF(e3)=<CK0,0IR,<CK0,1IR,MK0,0IR>>Enc(e4)=<m1,MK0,0IR,S2>Send(e5)=<S2,RHPK0A>Del(e6)=<CK0,0IR,SKA,MK0,0IR> 22

The above proves that the DR protocol has two weak match sessions in the basic sequence I4, and the strong match session also needs to prove that e12 < e7 and e5 < e0. Based on the matching proof of e12 and e7, according to the Lemma 1 of the key and the nonce axiom AxiomF, it can be known that the key RHPK0B of the basic sequence I4 must appear for the first time in the event Rcve7, and RHPK0B is generated from the instantiation event GenKey(e6) of the basic sequence R4, and is released for the first time in the event Send(e12), proves that e12 < e7.The proof of e5 is similar to that of e0, it can be proved that e5 < e0, so far there are two strong matching sessions, and the authentication DR|=auth(I4,2) is obtained. The authentication proof of B is similar to that of A, which proves that it satisfies strong authentication.□

Finally, according to Theorem 5, the X3DH protocol, as the first-phase sub-protocol of the Signal protocol, does not meet the strong authentication, so the Signal protocol does not meet the strong authentication. The result is consistent with the result found in Ref.19 that the protocol may be attacked by the UKS. The defect of the Signal protocol is possible cause the server does not include signature data in the process of distributing the key, which renders the server susceptible to impersonation by malicious users. If the sending message sequence contains the server's signature of the initiator's identity, this defect can be avoided.

The X3DH protocol may be vulnerable to UKS attacks in practical application scenarios due to its lack of strong authentication. A UKS attack refers to a situation where a participant in the protocol establishes a shared session key with an adversary without verifying the identity of the interacting party, which can be considered a type of man-in-the-middle attack. From the perspective of a man-in-the-middle attack, there may be several potential modes of attack as follows:

  1. The adversary intercepts the initiator's request for access to the server and applies for access to the server disguised as the initiator. The adversary intercepts the initiator's access request to prevent the server from receiving it and then impersonates the initiator to make a session request to the server. As a result, the message that the initiator receives back from the server is the one that the adversary expects.

  2. The adversary utilizes messages from a previous session to impersonate the server and interact with the initiator. The adversary is able to store messages from the initiator's prior session, and when the initiator requests a new session from the server, the adversary, disguised as the server, relays those previous messages to the initiator.

  3. The adversary impersonates the responder by sending data to the server for storage. By directly assuming the identity of the responder and registering with the server, the adversary ensures that any messages the initiator retrieves from the server are the ones the adversary intends for the initiator to receive. This leads to a situation where the responder, in subsequent interactions, mistakenly treats the adversary as the genuine responder.

  4. The adversary sends a corresponding request to the server at the same time as the initiator sends an access request. Specifically, while the adversary requests access to the server, the initiator also sends an access request to the server. In this case, due to the two access requests, the server needs to respond twice. However, because the server's feedback lacks digital signature markings, the initiator cannot distinguish whether the received message is from their own request or the adversary's request. This situation may lead to the initiator receiving a message intended for the adversary.

Discussion

The proof process of the Signal protocol demonstrates that the extended LoET can be effectively applied to the security proof of DR protocols and composition protocols. LoET extends key predicates KRel and KChain for the DR structure. Predicate KRel characterizes the relation between keys to capture the key chain that appears in the protocol, and predicate KChain is used to establish the tree structure of the protocol's key chain based on this. The tree structure of the key chain abstracts the protocol's DR mechanism, and we propose axioms DEM, RSM, and VSM to achieve the security proof of the DR. Complex protocols are usually composed of multiple sub-protocols, and the security of a single protocol cannot meet the security properties of the composition protocol. Therefore, we propose a composition theorem to prove the security of the protocol composition by ensuring the security of the sub-protocols. Table 7 shows a comparison between this article and similar methods, indicating that the extended LoET has outstanding advantages in analyzing ratchet protocols and the properties of protocol composition. It can be effectively applied to the security proof of complex protocols. However, compared to methods Ref.12,24,25,33, LoET lacks automated proof tools, and the proof process is more complex, which is not user-friendly for non-professionals.

Table 7.

Comparison of similarity methods.

Articles Protocols Analysis ability of ratchet structure Analysis ability of composition Find Attack Tools
This Work Signal Unknown key-share attack -
Ref.2 Signal None -
Ref.8 CR None -
Ref.12 Signal Unknown key-share attack Scyther
Ref.19 TextSecure Unknown key-share attack -
Ref.24 NSB, NSL Man-in-the-middle attack Spin
Ref.25 Signal Unknown key-share attack Tamarin
Ref.31 RFIDs Impersonation attack -
Ref.32 Toy

Temporary information attack

Privilege insider attack

Stolen smart card attack

-
Ref.33 MTProto 2.0 Unknown key-share attack ProVerif

Given that this article takes into account the ratchet structure of the Signal protocol and key exchange within protocol composition, the primary focus is on proofing the authentication of the Signal protocol. However, building upon the extensions made to the LoET, LoET is also equipped to demonstrate the security proof of a variety of protocols. Consequently, we present the conceptual approach of LoET in proving the security properties of other protocols in Table 8. It provides a succinct summary of the proofs of secrecy, integrity, and availability for the DTLS (Datagram Transport Layer Security) protocol, the proof of secrecy for the DTLS-SRTP (Secure Real-Time Transport Protocol), and the proof of integrity for the PUF (Physical Unclonable Functions) protocol.

Table 8.

Proof summary of multiple protocols.

Protocols Security Properties Proof Summary
DTLS Secrecy, Integrity, Availability

Secrecy:                                                                                                                                                                                                                        (1)By employing Predicate KRel, ascertain which keys associated with the session key exist within the DTLS protocol and establish a key chain concerning the session key

(2) Prove the direction of the secret key chain in (1) by Theorem 1

(3) Suppose that the key chain can be destroyed by the adversary, that is, the adversary can obtain a link in the key chain. According to Theorem 2, Theorem 3, and Theorem 4, it can be obtained that the key chain does not exist when the hypothesis is true, and the secrecy can be proved

Integrity:

(1) Determine the associated key of the encrypted data key by predicate KRel, and establish the key chain for protecting the data key

(2) Theorem 2, lemma 1 is used to analyze whether the data protection key is released during the whole life cycle

(3) Use axiom DEM, RSM, and VSM to prove that messages cannot be tampered with. Complete proof of the integrity of the DTLS protocol

Availability:

(1) Use Val to extract the values of event Send and Rcv to get the protocol message structure

(2) Use axioms DEM, RSM, and VSM. it is proved that Send event and Rcv event message structures are equivalent

(3) The flow relation axiom is used to prove that the match events Send and Rcv in 2) have a sequential relation, with Send < Rcv. This proves the availability of the DTLS protocol

DTLS-SRTP Secrecy

Secrecy:

(1) Predicate KRel is used to determine which keys related to the session key exist in the DTLS protocol and establish the key chain about the session key

(2) Prove the direction of the DTLS protocol key chain in (1) by Theorem 1

(3) Suppose that the key chain can be destroyed by the adversary, that is, the adversary can obtain a link in the secret key chain. According to Theorem 2, Theorem 3, and Theorem 4, it is obtained that the key chain does not exist if the hypothesis is true

(4) Use the same method to prove the secrecy of SRTP session keys, and then use Theorem 5 (Composition theorem) to prove that the sequential composition of DTLS protocol and SRTP protocol meets the secrecy. The secrecy of DLS-SRTP protocol is proven

PUF Integrity

Integrity:

(1) Predicate KRel is used to determine the key related to the encrypted data in the PUF protocol, and predicate KChain is used to establish the one-way key chain of the protocol

(2) Use lemma 1 to determine that the key in the one-way key chain is not released during the lifetime

(3) Use axiom DEM and RSM to prove that there are match events Send and Rcv in PUF protocol

(4) Then prove the existence of a digital signature in the message by axiom VSM. By (2) there is no released key in the obtained key chain, so the adversary cannot construct the same digital signature. Complete proof of the integrity of PUF protocol

Conclusion and future work

We achieve the formal analysis of the DR structure and protocol composition characteristics of Signal protocol by extending LoET. For the DR structure of Signal, predicates KRel and KChain are extended to facilitate its formal abstract representation. The predicate KRel is capable of expressing the interrelation between keys during the ratchet generation process, while the predicate KChain delineates the ratchet trace, that is, describes generation of key chain during the ratchet turns. Meanwhile, the axioms DEM, RSM, and VSM, along with a set of theorems and lemmas, facilitate the security proof of the ratchet structure. Our approach is applicable to the formal analysis of the DR structure, with the core focus on establishing key relations and the ratchet trace, which can clearly depict the switching and continuous operation of the ratchet within the Signal protocol. The Signal protocol is a sequential composition of the X3DH protocol and the DR protocol. The DR mechanism resides within the DR protocol, with the output of the X3DH protocol serving as the initial input for the DR protocol. Therefore, the DR mechanism cannot guarantee the security of the entire protocol, necessitating a composition analysis of the sub-protocols within Signal. To address this, this article extends the composition theorem to achieve a composition analysis of the Signal protocol. The extended LoET is used to analyze Signal, the result shows that the Signal protocol cannot resist UKS attack in the X3DH phase because the registration session of X3DH is not signed effectively, so the server is susceptible to impersonation by adversaries. Therefore, including the server's signature of the long-term key during the registration session can solve this problem.

The LoET doesn't support the analysis and proof of group protocols. However, group communication services do exist universally, such as multi-server systems, audio/video conferencing, and various collaboration applications that need to support dynamic groups. As a special communication group, the relation of group members in dynamic groups can change frequently and generally adopt one-to-many or many-to-many, rather than one-to-one communication mode. This situation makes the security mechanism of dynamic groups very complicated. So, the future work we will start from the above point.

Supplementary Information

Author contributions

Z.H. provided ideas and wrote the first draft, M.X. supervised the entire project process and gave methodological guidance, Z.H., M.H. and R.H. revised the first draft, Z.H. and R.H. wrote the experimental code, M.H. integrated the experimental data. All authors reviewed the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China, Grant Number 62362033, 61962020), Double Thousand Talent Plan of Jiangxi Province (No. jxsq2023201009), Natural Science Foundation of Jiangxi Province (No. 20224ACB202006).

Data availability

All data generated or analyzed during this study are included in this published article.

Competing interests

The authors declare no competing interests.

Ethical approval

This article does not contain any studies with human participants or animals performed by any of the authors.

Footnotes

Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Contributor Information

Zehuan Li, Email: zehuanli@ecjtu.edu.cn.

Meihua Xiao, Email: xiaomh@ecjtu.edu.cn.

Supplementary Information

The online version contains supplementary material available at 10.1038/s41598-024-71666-y.

References

  • 1.Constine, J. WhatsApp hits 1.5 billion monthly users. $19B? Not so bad. Tech Crunch31, https://techcrunch.com/2018/01/31/whatsapp-hits-1-5-billion-monthly-users-19b-not-so-bad/ (2018).
  • 2.Cohn-Gordon, K., Cremers, C., Dowling, B., Garratt, L., & Stebila, D. A Formal Security Analysis of the Signal Messaging Protocol. In 2017 IEEE European Symposium on Security and Privacy (EuroS&P), pp.451–466. IEEE 10.1109/eurosp.2017.27 (2017)
  • 3.Bellare, M., Singh, AC., Jaeger, J., Nyayapati, M., & Stepanovs, I. Ratcheted Encryption and Key Exchange: The Security of Messaging. In 37th Annual International Cryptology Conference, pp.619–650. Springer 10.1007/978-3-319-63697-9_21 (2017)
  • 4.Cohn-Gordon, K., Cremers, C., Garratt, L., Millican, J., & Milner, K. On Ends-to-Ends Encryption: Asynchronous Group Messaging with Strong Security Guarantees. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pp.1802–1819. ACM 10.1145/3243734.3243747 (2018)
  • 5.Poettering, B., Rösler, P. Towards Bidirectional Ratcheted Key Exchange. In Advances in Cryptology-CRYPTO 2018: 38th Annual International Cryptology Conference, pp.19–23. Springer 10.1007/978-3-319-96884-1_1 (2018)
  • 6.Rösler, P., Mainka, C., & Schwenk, J. More is Less: On the End-to-End Security of Group Chats in Signal, WhatsApp, and Threema. In 2018 IEEE European Symposium on Security and Privacy (EuroS&P), pp.415–429. IEEE 10.1109/eurosp.2018.00036 (2018)
  • 7.Xie, Q., Zixuan, D., & Panpan. Z. Provably secure and anonymous V2I and V2V authentication protocol for VANETs. IEEE Transactions on Intelligent Transportation Systems24(7), 7318–7327 10.1109/TITS.2023.3253710 (2023).
  • 8.Datta, A., Derek, A., Mitchell, JC., Roy, A. Protocol Composition Logic (PCL). Electron. Notes Theor. Comput. Sci.172, 311–358. 10.1016/j.entcs.2007.02.012 (2007)
  • 9.Cremers, C. On the Protocol Composition Logic PCL. In Proceedings of the 2008 ACM symposium on Information, computer and communications security, pp.66–76. 10.1145/1368310.1368324 (2008)
  • 10.Xiao, M., Bickford, M. Logic of Events for Proving Security Properties of Protocols. In 2009 International Conference on Web Information Systems and Mining, pp.519–523. IEEE 10.1109/wism.2009.111 (2009)
  • 11.Bickford, M., Constable, R. Automated Proof of Authentication Protocols in a Logic of Events. In 6th International Verification Workshop, pp.13–30. 10.29007/r7n1 (2010)
  • 12.Almuzaini, NZ., Ahmad, I. Formal Analysis of the Signal Protocol Using the Scyther Tool. In 2019 2nd International Conference on Computer Applications & Information Security (ICCAIS), pp.1–6. IEEE 10.1109/cais.2019.8769532 (2019)
  • 13.Chen, X., Deng, H. Efficient Verification of Cryptographic Protocols with Dynamic Epistemic Logic. Appl. Sci.10(18):6577. 10.3390/app10186577 (2020)
  • 14.Kamkuemah, MN. Reasoning about Authentication and Secrecy in the Signal Protocol. In 2021 International Conference on Electrical, Computer and Energy Technologies (ICECET), pp.1–6. IEEE 10.1109/icecet52533.2021.9698415 (2021)
  • 15.Zhang, T., Xiao, M., & Ouyang, R. Proving Mutual Authentication Property of 5G-AKA Protocol Based on PCL. In Theoretical Computer Science: 39th National Conference of Theoretical Computer Science, pp.23–25. Springer 10.1007/978-981-16-7443-3_13 (2021)
  • 16.Zhong, X., Xiao, M., Tong, Z., Ke, Y., & Yunxian, L. Proving Mutual Authentication Property of RCIA Protocol in RFID Based on Logic of Events. Chin. J. Electron.31(1), 79–88. 10.1049/cje.2021.00.101 (2022)
  • 17.Bickford, M. Unguessable Atoms: A Logical Foundation for Security. In 2nd Working Conference on Verified Software-Theories, Tools and Experiments, pp.30–53. 10.1007/978-3-540-87873-5_7 (2008)
  • 18.Song, J., Xiao, M., Zhang, T., & Zhou, H. Proving authentication property of PUF-based mutual authentication protocol based on logic of events. Soft Comput.26, 841–852. Springer 10.1007/s00500-021-06163-9 (2022)
  • 19.Frosch, T., Mainka, C., Bader, C., Bergsma, F., Schwenk, J., & Holz, T. How Secure is TextSecure? In 2016 IEEE European Symposium on Security and Privacy (EuroS&P), pp.457–472. IEEE 10.1109/eurosp.2016.41 (2016)
  • 20.Alwen, J., Coretti, S., & Dodis, Y. The Double Ratchet: Security Notions, Proofs, and Modularization for the Signal Protocol. In Advances in Cryptology-EUROCRYPT 2019: 38th Annual International Conference on the Theory and Applications of Cryptographic Techniques, 129–158. Springer 10.1007/978-3-030-17653-2_5 (2019)
  • 21.Vatandas, N., Gennaro, R., Ithurburn, B., & Krawczyk, H. On the Cryptographic Deniability of the Signal Protocol. In Applied Cryptography and Network Security: 18th International Conference, pp.19–22. Springer 10.1007/978-3-030-57878-7_10 (2020)
  • 22.Paterson, K., G., Matteo S., & Kien T., T. Three lessons from threema: Analysis of a secure messenger. In 32nd USENIX Security Symposium (USENIX Security 23), pp.1289–1306. USENIX, (2023)
  • 23.Jacomme, C., Klein, E., Kremer, S., & Racouchot, M. A comprehensive, formal and automated analysis of the EDHOC protocol. In 32nd USENIX Security Symposium (USENIX Security 23), pp.5881–5898. 2023. USENIX10.1007/978-3-031-49737-7_8 (2023)
  • 24.Xiao, M., Zhao, H., Yang, K., Ouyang, R. & Song, W. A formal analysis method for composition protocol based on model checking. Sci. Rep.12(1), 8493. 10.1038/s41598-022-12448-2(2022) (2022). 10.1038/s41598-022-12448-2(2022) [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Beguinet, H., Chevalier, C., Ricosset, T., & Senet, H. Formal Verification of a Post-Quantum Signal Protocol with Tamarin. In International Conference on Verification and Evaluation of Computer and Communication Systems, pp.105–121. Springer 10.1007/978-3-031-49737-7_8 (2023)
  • 26.Marlinspike, M., Perrin, T. The X3DH Key Agreement Protocol. Open Whisper Syst.283(10). https://signal.org/docs/specifications/x3dh/x3dh.pdf (2016)
  • 27.Perrin, T., Marlinspike, M. The Double Ratchet Algorithm. GitHub wiki112(4). https://soma.cx/pdf/signal/doubleratchet.pdf (2016)
  • 28.Mattsson, J. P. Security Properties of One-Way Key Chains and Implications for Security Protocols like TLS 1.3. Cryptology ePrint Archive2024,1–36 https://ia.cr/2024/220 (2024).
  • 29.Bienstock, A., Paul, R., & Yi, T. Asmesh: Anonymous and secure messaging in mesh networks using stronger, anonymous double ratchet. In Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security, pp.1–15. ACM10.1145/3576915.3616615 (2023)
  • 30.Hassani Karbasi, A., Shahpasand, S. SINGLETON: A lightweight and secure end-to-end encryption protocol for the sensor networks in the Internet of Things based on cryptographic ratchets. J.Supercomput.77(4), 3516–3554. 10.1007/s11227-020-03411-x (2021)
  • 31.Ghahramani, M., HaddadPajouh, H., Javidan, R., & Kumari, S. VQR: Vulnerability analysis in quadratic residues-based authentication protocols. J. Ambient Intell. Hum. Comput.14(6), 7559–7574. 10.1007/s12652-023-04557-1 (2023)
  • 32.Ghahramani, M. Find it with a pencil: An efficient approach for vulnerability detection in authentication protocols. IEEE Trans. Inf. Forensic. Sec.18, 2005–2014. 10.1109/tifs.2023.3262125 (2023)
  • 33.Miculan M, Vitacolonna N. Automated verification of Telegram’s MTProto 2.0 in the symbolic model. Comput. Sec.126, 103072. 10.1016/j.cose.2022.103072 (2023)

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Data Availability Statement

All data generated or analyzed during this study are included in this published article.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES