14
computers & security 82 (2019) 227–240 Available online at www.sciencedirect.com j our nal homepage: www. el sevi er . com/ l ocat e/ cose O 2 TR: Offline OTR messaging system under network disruption Mahdi Daghmehchi Firoozjaei a, b , MinChang Kim a , JaeSeung Song b , Hyoungshick Kim a, 1, a Department of Electrical and Computer Engineering, College of Information and Communication Engineering, Sungkyunkwan University, Suwon, Republic of Korea b Department of Computer and Information Security, College of Software & Convergence technology, Sejong University, Seoul, Republic of Korea a r t i c l e i n f o Article history: Received 14 August 2018 Accepted 26 December 2018 Available online 29 December 2018 Keywords: Key management Reliability OTR Privacy-preserving Security a b s t r a c t Providing a secure and efficient communication system under network disruption without a trusted third party remains a challenging issue. To develop a secure and efficient system in such situations, we extend the conventional Off-The-Record (OTR) protocol into a new protocol named offline OTR (O 2 TR). O 2 TR provides end-to-end security between users with- out requiring the assumption that they are persistently connected to each other. To show the feasibility of the proposed protocol, we implemented a prototype to support O 2 TR based on the Gajim XMMP instant messaging platform. Our experiments showed that O 2 TR can be used reliably even when the corresponding network party is temporarily broken down. Moreover, O 2 TR provides an efficient way to resume private sessions which is about 34% faster than the original OTR. We also proved the secrecy of O 2 TR using an automated veri- fication tool called AVISPA. © 2018 Elsevier Ltd. All rights reserved. 1. Introduction When a disaster such an earthquake, fire, and terrorist attack happens, secure and efficient communication systems are needed to manage the crisis. In such situations, constructing a reliable and efficient communication system for emergency requests and responses is a major challenge. Due to the high priority of rescue missions, the privacy of some victims may not necessarily be protected well. In general, people are concerned about their privacy associated with their physical and mental health, which include: stress, disability, This research was supported by the MSIT (Ministry of Science, ICT), Korea, under the ITRC (Information Technology Research Center) support program (IITP-2018-2015-0-00403) supervised by the IITP (Institute for Information & communications Technology Promotion). This research was also supported by the ICT R&D program (No.2018-0-00532). Corresponding author. E-mail address: [email protected] (H. Kim). 1 https://seclab.skku.edu/people/hyoungshick-kim/. and confusion, in a disaster. Moreover, the prevalence of global surveillance, including an untrusted third party or government monitoring, has caused much concern to many users (Channa and Ahmed, 2010; Daghmehchi Firoozjaei et al., 2017b; Rastogi and Hendler, 2017), and communication service providers generally make money from mining per- sonal data (Lustgarten, 2016). Based on these facts, a generic emergency communication system is expected to provide confidentiality and integrity services in any condition. Due to the rapid growth of smartphone-based applications and global trends toward online services, traditional emer- gency facilities face challenges handling the types of com- munication that consumers expect today. In comparison to https://doi.org/10.1016/j.cose.2018.12.013 0167-4048/© 2018 Elsevier Ltd. All rights reserved.

O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

Available online at www.sciencedirect.com

j o u r n a l h o m e p a g e : w w w . e l s e v i e r . c o m / l o c a t e / c o s e

O

2 TR: Offline OTR messaging system under

network disruption

Mahdi Daghmehchi Firoozjaei a , b , MinChang Kim

a , JaeSeung Song

b , Hyoungshick Kim

a , 1 , ∗

a Department of Electrical and Computer Engineering, College of Information and Communication Engineering, Sungkyunkwan University, Suwon, Republic of Korea b Department of Computer and Information Security, College of Software & Convergence technology, Sejong University, Seoul, Republic of Korea

a r t i c l e i n f o

Article history:

Received 14 August 2018

Accepted 26 December 2018

Available online 29 December 2018

Keywords:

Key management

Reliability

OTR

Privacy-preserving

Security

a b s t r a c t

Providing a secure and efficient communication system under network disruption without

a trusted third party remains a challenging issue. To develop a secure and efficient system

in such situations, we extend the conventional Off-The-Record (OTR) protocol into a new

protocol named offline OTR (O

2 TR). O

2 TR provides end-to-end security between users with-

out requiring the assumption that they are persistently connected to each other. To show

the feasibility of the proposed protocol, we implemented a prototype to support O

2 TR based

on the Gajim XMMP instant messaging platform. Our experiments showed that O

2 TR can

be used reliably even when the corresponding network party is temporarily broken down.

Moreover, O

2 TR provides an efficient way to resume private sessions which is about 34%

faster than the original OTR. We also proved the secrecy of O

2 TR using an automated veri-

fication tool called AVISPA.

© 2018 Elsevier Ltd. All rights reserved.

1. Introduction

When a disaster such an earthquake, fire, and terrorist attackhappens, secure and efficient communication systems areneeded to manage the crisis. In such situations, constructinga reliable and efficient communication system for emergencyrequests and responses is a major challenge. Due to thehigh priority of rescue missions, the privacy of some victimsmay not necessarily be protected well. In general, peopleare concerned about their privacy associated with theirphysical and mental health, which include: stress, disability,

� This research was supported by the MSIT (Ministry of Science, ICT),support program (IITP-2018-2015-0-00403) supervised by the IITP (InstThis research was also supported by the ICT R&D program (No.2018-0-

∗ Corresponding author. E-mail address: [email protected] (H. Kim).

1 https://seclab.skku.edu/people/hyoungshick-kim/ .

https://doi.org/10.1016/j.cose.2018.12.013 0167-4048/© 2018 Elsevier Ltd. All rights reserved.

and confusion, in a disaster. Moreover, the prevalence ofglobal surveillance, including an untrusted third party orgovernment monitoring, has caused much concern to manyusers ( Channa and Ahmed, 2010; Daghmehchi Firoozjaeiet al., 2017b; Rastogi and Hendler, 2017 ), and communicationservice providers generally make money from mining per-sonal data ( Lustgarten, 2016 ). Based on these facts, a genericemergency communication system is expected to provideconfidentiality and integrity services in any condition.

Due to the rapid growth of smartphone-based applicationsand global trends toward online services, traditional emer-gency facilities face challenges handling the types of com-munication that consumers expect today. In comparison to

Korea, under the ITRC (Information Technology Research Center) itute for Information & communications Technology Promotion). 00532).

Page 2: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

228 c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

tac

a9aedev

2

p

ccpvstrvaeiote

2pm

an

Scco

Ogcmcu

iG

cn

2caihc

sa

skr

2tpcvup

et

tsi(pp

OpbcOaeoc

f

ali

he traditional communication systems, online services, such

s instant messaging (IM), provide different features that in- lude: texting, picture/video sharing, location-based services,nd most importantly, real-time delivery. The next generation

-1-1 (NG9-1-1) project,2 for instance, will allow callers to take dvantage of mobile device features, such as IM systems in an

mergency situation. Since IMs have no security features by efault, some security mechanisms such as client-to-server ncryption via TLS or end-to-end confidentiality and integrity ia SCIMP ( Moscaritolo et al., 2012 ), TextSecure ( Frosch et al.,016 ) or off-the-record (OTR) ( Borisov et al., 2004 ) are used torovide secure messaging ( Frosch et al., 2016 ).

Basically, OTR provides an authenticated and confidential hannel for an online conversation, but the content of the onversation is repudiable afterward ( Liu et al., 2013 ). Besides airwise encryption and mutual authentication, OTR also pro- ides advanced security properties, such as perfect forward

ecrecy (PFS) and deniability. To have end-to-end confiden- iality and integrity with messaging, a novel fine-grained key efreshing feature called OTR ratcheting is used. Since it in- olves asymmetric (public key) cryptography, it is known as symmetric ratcheting. To this end, OTR clients continuously stablish a fresh Diffie–Hellman (DH) ephemeral shared secret n each round trip message ( Cohn-Gordon et al., 2017 ). More- ver, by revealing the used authentication keys, OTR mimics he features of an actual face-to-face conversation in a virtual nvironment ( Daghmehchi Firoozjaei et al., 2017a; Liu et al.,013; Rastogi and Hendler, 2017 ). These features make the OTR

rotocol a proper solution for privacy preservation in online essaging services. In general, asynchronous messaging, where the sending

nd receiving of a message do not need to happen simulta- eously, is a normal phenomenon in the most IM systems.ince each key is securely chained to the previous key in the urrent session, the applicability of OTR is limited to syn- hronous messaging in which both conversation parties are nline ( Frosch et al., 2016 ). In spite of the security features ofTR, this limitation makes it an improper choice for emer- ency systems that should support any kind of communi- ation. For instance, if a disaster leads to an unstable com- unication link, such that the receiver goes offline and be-

omes unreachable, any offline encrypted messages will be nreadable.

Despite a relatively limited adoption of OTR, its ratchet- ng technique can be seen in other security protocols ( Cohn- ordon et al., 2017 ). TextSecure ( Frosch et al., 2016 ) and its suc-essor, Signal 3 protocol, applied the idea of the ratchet tech- ique in OTR to the key update protocol ( Cohn-Gordon et al.,017; Marlinspike, 2013 ). Signal provides an end-to-end en- ryption as well as PFS and future secrecy in synchronous and

synchronous messaging environments. The double ratchet- ng algorithm (DR algorithm) ( Perrin and Marlinspike, 2016 ) as been used to update the keys with an initial shared se- ret (also known as root key) ( Rosler et al., 2018 ). The initialhared key between two parties is calculated with X3DH key greement protocol ( Marlinspike and Perrin, 2016 ) that uses

2 http://www.nena.org/?NG911 _ Project . 3 https://signal.org/docs/ .

OS

ow

tatic and ephemeral DH shares of both parties. The public eys of each party should be uploaded to the server at the egistration phase ( Marlinspike and Perrin, 2016; Rosler et al.,018 ). This key distribution mechanism requires a trusted

hird party who is responsible for managing the public keys of arties in a secure manner ( Marlinspike and Perrin, 2016 ). In

omparison, the end-to-end confidentiality and integrity pro- ided by OTR independent of any key distribution server make s consider this protocol as the better solution for privacy- reserving purposes.

To provide a secure and efficient messaging system for mergency communications, we extended the original OTR

o create a new protocol named offline OTR (O

2 TR). Basically,he ephemeral key exchange in OTR is based on a three- tep ratchet as a mechanism of advertising keys and receiv- ng confirmations for those keys in subsequent messages Marlinspike, 2013 ). After establishing a private session, OTR

arties exchange their next ephemeral secrets in each data acket. In fact, the key materials in OTR are chained together.

2 TR utilizes this feature to handle offline messages. Our ex- eriments showed the complete practicability of the O

2 TR- ased system to handle offline messaging. Although the pro- essing time to handle O

2 TR messages is almost the same as TR’s, O

2 TR provides faster private session resumption. Over- ll, the O

2 TR-based system does not need any changes in the xisting messaging infrastructure and is able to retrieve the ffline messages during a network disruption in an emergency ommunication.

The main contributions of this paper are summarized as ollows:

• We introduced a secure and reliable messaging system

based on the O

2 TR protocol for emergency requests. The proposed system provides the end-to-end confidentiality and integrity services in which the service provider has no role in the credential management. In this system, the user’s privacy is completely preserved in the presence of a curious server. Furthermore, the system reliably retrieves any offline messages encrypted in the last disconnected

private session. • To address the limitation of OTR in the asynchronous mes-

saging, we design a mechanism in O

2 TR to regenerate the session keys of the last interrupted private session to han- dle offline messages. We develop a solution to renew and

replace the stored keys based on the incoming and outgo- ing messages.

• To evaluate the performance of our model in a real case,we implemented O

2 TR on the Gajim IM system launched

on an XMPP/Jabber platform. We also proved the secrecy of O

2 TR using the AVISPA automated verification tool.

The rest of this paper is organized as follows. In Section 2 ,n overview of OTR is presented. Section 3 defines the prob- em and explains the threat model. The O

2 TR protocol and

ts model are explained in Section 4 . The implementation of

2 TR and the evaluation results are respectively explained in

ections 5 and 6 . In Sections 7 and 8 , we analyzed the securityf O

2 TR, summarized our conclusions, and defined our future ork, respectively.

Page 3: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0 229

Fig. 1 – Handshake process in OTR.

2. Overview of OTR

Initially, Borisov et al. (2004) introduced OTR protocol in 2004.OTR is built on a high-level cryptographic abstraction, inwhich AES (128-bit), SHA-256, and SHA-1 hash functions areused in the latest version of OTR, Ver. 3 ( Goldberg et al., 2005 ).In this protocol, SHA-256 is used in the handshake processand each encrypted message is authenticated by SHA-1 as anHMAC function ( Di Raimondo et al., 2005 ). Furthermore, all ex-ponentiation operations are done modulo a particular 1536-bit prime ( Goldberg et al., 2005 ). Basically, the authenticationprocess in OTR is performed after setting up a secure channel.In practice, OTR’s parties first perform an unauthenticated DHkey exchange to set up an encrypted channel. Afterwards, theyimplement a mutual authentication ( Goldberg et al., 2005 ). Aversion of SIGMA is used as an authenticated key exchange(AKE) and both parties, Bob and Alice, use their long-term au-thentication public keys; pub A and pub B .

To generate DH keys, the values of x and y need to be atleast 320 bits, and they are randomly picked. As shown inFig. 1 , in the first AKE message, to prevent any man-in-the-

middle (MitM) attack, the encrypted value of Bob’s DH expo-nent ( g x ) with its hashed value (SHA-256) are sent to Alice.When Alice replies, she sends her DH encryption key ( g y ) inan unencrypted form. From the third message, an encryptedchannel is opened. All encryption keys; c, c ′ , and MAC keys;m 1 , m

′ 1 , m 2 , and m

′ 2 , are computed by hashing (SHA-256) the

DH’s shared value, s = g xy . The details of generating thosekeys are explained in Goldberg et al. (2005) . After exchang-ing DH secrets, the parties authenticate each other by theirlong-live DSA public keys, which are used only for authenti-cation ( Alexander and Goldberg, 2007; Goldberg et al., 2005 ), inan encrypted channel. By verifying sig B ( M B ) and sig A ( M A ), theauthentication will be performed at the end of the handshakeprocess.

To provide a secure data exchange, a key derivation func-tion (KDF) is used to calculate the sending/receiving encryp-tion and authentication keys based on DH shared key; s . KDFgenerates two 128-bit AES encryption keys, which are the“sending k e ” and the “receiving k e ”’ and two 160-bit SHA1-HMAC keys, which are the “sending k m

” and the “receivingk m

”, for each message ( Goldberg et al., 2005 ). To compute s indata exchanges, both sides use the keyids listed in the data

Page 4: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

230 c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

Fig. 2 – Data exchange in OTR.

mctb

i

A

tskt

i

plkrkbv(

hsqrkcd(

a(a

3

Ismm

3

I

pdtsmssi

vcetp

essage to select the ephemeral DH keys. Since the keys are hanged per each message, the keyids are used to make sure hat a unique set of keys is being used ( Alexander and Gold- erg, 2007 ).

To provide the feature of PFS, a fine-grained key refreshing s achieved by the OTR ratcheting in each messaging round.s shown in Fig. 2 , in any data message, a new DH secret, in

he next _ dh, is suggested for the next data message. This DH

ecret is MAC protected and cannot be used until being ac- nowledged by the recipient. In each data message, a value of he counter, ctr , is selected such that the triple ( key A , key B , ctr )s never repeated in a private session ( Goldberg et al., 2005 ). Torovide for the deniability, MAC keys are revealed one round

ater to the public. Because of this feature, once the old MAC

eys; k ∗j , are released, anyone can modify the message and the eceiver cannot prove the sender’s authorship. Since the MAC

eys are not revealed until their corresponding public keys are eing discarded, there is no danger of accepting a message as alid which uses a MAC key that has already been revealed

Goldberg et al., 2005 ). Fig. 3 shows the format of OTR data packet in which the

eader shows the protocol version, the message type, the ender and the receiver of the message as well as the re- uired flags. In the payload, all fields except k ∗j , which is eleased publicly, are authenticated. The MAC value of the eyid of the sender and the receiver, next _ dh, ctr , and En- rypted data is settled in the Authenticator field. The Encrypted ata field consists of the encryption of the message and TLV

type/length/value) records, if needed. Generally, TLV records

re used for special purposes besides the message exchanging Goldberg et al., 2005 ). The MAC keys which were used before re revealed publicly in the Old MAC keys field.

. Problem definition and threat model

n this section, we first discuss the privacy issues in a mes- aging system and key requirements for emergency com- unication. Moreover, we present the threat model and our otivation.

.1. Privacy concerns

n messaging systems, users’ personal data (e.g., profile,rivate messages/photos, and location information) can be isclosed when its message database is accessed by unau- horized users. End-to-end secure communication is not ufficient for protecting user privacy. User’s personal infor- ation is typically stored in a database on the messenger

erver. As a consequence, user’s personal information at the erver would become one of the most attractive targets for ntelligence agencies ( Lustgarten, 2016 ).

Due to the priority of the rescuing purposes, a client’s pri- acy may be ignored unintentionally in order to have more ac- urate emergency reporting. Therefore, providing an end-to- nd confidentiality and integrity with no interference of any hird parties or service providers is required to protect clients’ rivacy and data confidentiality.

Page 5: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0 231

Fig. 3 – OTR data packet format.

Fig. 4 – Overview of communication with a curious messaging service provider.

3.2. Retrieve undelivered messages

Due to the nature of emergency situations, efficient dataneeds to be delivered immediately and accurately to the res-cue service centers. In this view, every tiny clue may changea victim’s fate in a life-threatening condition. Therefore, eachemergency request should be considered carefully. As a ba-sic rule of all emergency rescue facilities, it is required that:they do not ignore any request. To get some insight into theproblem, consider that a network disruption, whether it wasplanned (e.g., upgrading Reitblatt et al., 2012 or a service dis-ruption Xu et al., 2015 ) or unplanned because of a naturaldisaster, occurs in which the server is unable to deliver theemergency requests. What would happen with an undeliv-ered emergency request? Perhaps that message was the lastchance for a victim to send his request. Therefore, any emer-gency facility requires a reliable messaging system that guar-antees to save messages and delivers them meaningfully tothe receiver.

3.3. Threat model

Compromising user’s privacy is considered as the main secu-rity threat in our model. To define the threat model, we as-sumed the messaging service provider is a curious providerthat is able to monitor message traffic and open the messagesbefore being delivered to the receiver. As shown in Fig. 4 , inthis scheme the service provider performs credential man-agement and provides a secure channel to deliver the clients’messages. This capability makes a curious service providerable to freely review all messages on the server side.

In this threat model, no messages were considereddropped and the server delivers all the messages, but it is as-sumed that they are reviewed or manipulated by the server.

3.4. Motivation

OTR secure channel prepares end-to-end confidentiality inwhich a curious server has no role or interference overthe credential management. Therefore, message retentionon the server side cannot compromise the system’s secu-rity (e.g., key extraction). Because of OTR ratcheting, thisprotocol is only applicable in synchronous communications( Daghmehchi Firoozjaei et al., 2017a; Frosch et al., 2016 ). Basedon this limitation, an OTR-based system does not seem tobe the appropriate choice for any network disruptions thatleads to unstable connections. When a receiver goes offlineand loses an on-the-fly OTR session, an offline message in theserver wont be readable when the receiver gets back onlineand starts a new OTR session. This case of communicationseems to be possible in the most unwilling disruption cases,such as natural disasters or man-made violations. This situa-tion gets worse when a victim does not have a chance to re-send his emergency request. Therefore, to address the limita-tion of OTR to handle offline messages, we introduced O

2 TRprotocol to retrieve any undelivered messages.

Basically, O

2 TR is an extension of the original OTR to coverasynchronous messaging. In addition to the basic features ofOTR, O

2 TR supports offline messaging by exploiting the keyrefreshing property of OTR.

4. Offline OTR (O

2 TR)

In OTR, the authentication state and the message state areused to indicate the current state of each conversation. Theauthentication state shows the authentication progress (e.g.,none, awaiting _ dhkey , and awaiting _ sig ). While the messagestate indicates the ciphering state of the messaging (e.g., plain-text, encrypted , and finished ) ( Goldberg et al., 2005 ). To preventany flaw and inconsistency in sending messages, the mes-sage state controls what happens during the OTR conversa-tion. For instance, if during a private session a party logs outhis OTR client the correspondent will be notified to switch tomsgst at _ f inished mode. This notification prevents a conversa-tion party from unwillingly sending any message in plaintextmode ( Goldberg et al., 2005 ).

Based on this structure, what would happen if an OTRclient accidentally loses a private session (e.g., due to con-nection lost)? Since the OTR private session depends on the

Page 6: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

232 c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

rwiv

avop

usbrtOtdm

ctonrrnnatt

gugp

GDipkteam

4

Bp(

twpewoti

t

mn(t

daocavtatamM

tf

olh

b

Fwlds

o

5

TtXt

vtsmvet

woisGp

lse

4 https://gajim.org/index.php?lang=en . 5 https://www.process-one.net/en/ejabberd/ . 6 https://github.com/python- otr/gajim- otr . 7 https://github.com/python- otr/pure- python- otr .

unning IM chat room, the message state mismatching occurs hen a client is disconnected and leaves the chat room while

ts OTR session has not finished. In this case, the current pri- ate session is not terminated on the other side. Therefore,ny message sent by the correspondent is based on the pre- ious unfinished private session. An unreadability error will ccur when the client receives an offline message from the revious unfinished private session.

As long as an OTR party, as receiver, gets disconnected, any ndelivered message that remains on the server side is con- idered an offline message. Although the offline message will e delivered when the receiver goes back online, it will not be eadable. The delivered message was encrypted by the keys hat have already expired. The new connection requires a new

TR session that requires a new handshake and new parame- er sharing. In other words, the synchronous communication

ependency of OTR makes it impossible to decrypt the offline essages. To prevent any parameter mismatching in the asyn-

hronous communication, we introduce the O

2 TR to handle he offline messages. Especially, O

2 TR can guarantee that any ffline emergency requests are securely decryptable after any etwork disruption. As stated earlier, the ciphering keys are enewed with each message exchange on both sides by OTR

atcheting. Based on the suggested DH secret share for the ext ephemeral key, each party can generate the key for the ext message pair. By retaining these shares in O

2 TR, we are ble to retrieve any offline message. In this case, a conversa- ion party can authenticate and decrypt an offline message hat was created in the last disconnected session.

In the original OTR, practically all the keys are separately enerated on each side of the conversation and the keyids are sed to identify which pair of exponents were used in any iven message. Since the keys are changed per each message air and in order to use a unique set of keys ( Alexander andoldberg, 2007 ), the keyid is increased by generating a new

H key. This sequence restarts in each new session, and it is mpossible to accept a message with a different keyid from a ast session. To handle this impossibility, we considered the eys independently of their keyid when an urgent event is de- ected. In our emergency communication model, the urgent vent is defined as a condition when a client unwillingly loses private session without any signaling (i.e., with no sign of sgst at _ f inished mode).

.1. Model description

asically, the O

2 TR model consists of two extra parts in com- arison to the original OTR, emergency key management

EKM) and offline message detection (OMD). As shown in Fig. 5 ,he ephemeral keys generated by KDF are saved in EKM as ell. These keys are generated based on the DH secrets of both

arties, next _ dh and our _ dh . Since the keys are renewed for ach O

2 TR message, the registered keys in EKM are replaced

ith new ones. Therefore, in each conversation EKM consists f the latest keys for both O

2 TR parties. In fact, EKM retains he ephemeral keys one more round even if the O

2 TR session

s finished or interrupted. To handle the offline message in O

2 TR model, OMD checks he state of the incoming message. In the case of an offline

essage, an encrypted message is delivered to the client with

o private session. Therefore, the state of the offline message in msgst at _ encrypt ed mode) does not match with the state of he receiver, which is in plaintext mode. As shown in Fig. 5 , byetecting this mismatch in OMD, the message is considered

n offline message and is handled by EKM stored keys instead

f being rejected. The offline message is authenticated and de- rypted to extract the plaintext by EKM driven keys. This situ- tion is critical with an emergency communication when the ictim unwillingly loses a private session. In fact, O

2 TR gives he receiver the ability to handle an offline message without live private session. Since the offline message is created by he last unfinished O

2 TR session, no MAC keys are released

nd they are still valid. Therefore, it is impossible to compro- ise the validity of the offline message before releasing its AC key in the next data message ( Goldberg et al., 2005 ).

In response to the offline message, the receiver refreshes he O

2 TR session to prevent MitM and replay attacks. This re- reshing is based on the secret shared by the next _ dh in theffline message. In fact, O

2 TR parties resume the interrupted

ast private session without the need to perform a complete andshake process.

Consequently, O

2 TR not only retrieves the offline message ut also speeds up the private session establishing progress.ig. 6 shows how O

2 TR resumes the previous private session

ithout any interruption. By retrieving the saved keys of the ast private session from EKM, the receiver is able to verify and

ecrypt the delivered offline message. By selecting a new DH

ecret ( x ) and the received y , which is in the next _ df field of theffline message, a new DH key; s = (g xy ) , is generated.

. Implementation

o implement O

2 TR model, the Gajim

4 messaging applica- ion was selected as an IM system. Furthermore, an eJabberd

MPP 5 server was used to provide an XMPP/Jabber platform

o launch the Gajim IM. Due to the ability of eJabberd to pro-ide secure client-to-server connections (i.g., SSL/TLS connec- ion) and a storage for retaining undelivered messages, this erver was selected for our implementation. The credential anagement authority allows the eJabberd server to freely re-

iew and scrutinize all messages. Based on this, we consid- red the eJabberd XMMP server as the curious server for our hreat model. To enable OTR for the Gajim XMPP/Jabber client,e used the OTR plugin implemented by K. Braden available n GitHub.6 Furthermore, the Pure-Python-OTR, a Python OTR

mplementation package, also available on GitHub,7 was in- talled to enable the OTR plugin. To implement O

2 TR in the ajim XMPP/Jabber client, we optimized the Pure-Python-OTR

ackage and OTR plugin to add EKM and OMD modules. During each message handling, sending and receiving, the

atest keys are saved by EKM module. These keys consist of endenc, sendmac, rcvenc , and rcvmac , which are generated for ach message. The first two keys are the sender’s keys for the

Page 7: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0 233

Fig. 5 – O

2 TR model.

Fig. 6 – Private session resumption in O

2 TR.

Page 8: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

234 c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

Fig. 7 – Processing time to handle the incoming message and outgoing message, respectively, in OTR and O

2 TR protocols.

cr

Btata

pit

6

Tshcmm

6

T

wtr

actbii

smgcs

Fab

ahisaOt

6

Tct

Foiddrspt

2

icsmmOttokdtdttktt

urrent sending message and the second two keys are the keys elated to the message that will be received in the next round.y detecting an offline message in OMD, the receiver handles his message with the rcvenc and rcvmac keys that are avail- ble on EKM. As shown in Fig. 6 , by verifying and decrypting he offline message the correspondent’s DH secret, y , is avail- ble to make a new DH key, s . Based on this, EKM helps O

2 TRarties to continue the chain of ephemeral keys without any

nterruption. Having resumed an O

2 TR session, the conversa- ion is continued privately.

. Experiments

o evaluate the performance of the O

2 TR-based messaging ystem, we tested the reliability of the messaging system to andle offline messages as well as the processing time. For a lear comparison, these items were scrutinized by the IM com- unication between the Gajim XMMP/Jabber clients in two odels: OTR and O

2 TR.

.1. Messaging reliability

o evaluate the reliability of O

2 TR in offline message handling,e considered an unwilling event that caused a disconnec-

ion of a normal Gajim IM conversation. This event was car- ied out for more than 200 separate conversations. As a result,ll the offline messages were recovered (100%) and decrypted

ompletely with the Gajim-O

2 TR while it is not possible in

he normal Gajim-OTR model. Therefore, the suggested O

2 TR- ased messaging system provides a full messaging reliabil-

ty in the cases of a network disruption and a private session

nterruption. Based on the time of disconnection, our experiments

howed that different conditions happen to handle an offline essage. These conditions are different when an O

2 TR party oes offline after sending a message or goes offline after re- eiving a message. Depending on whether a message is being ent or received, the arrangements of the keys are different.or instance, if several O

2 TR messages are received without ny message being sent, the rcvenc and rcvmac keys should

e updated respectively in EKM and vice versa. To prevent

ny key mismatching, O

2 TR runs KDF and updates EKM after andling each message, whether it being sending or receiv-

ng. Generally, the ejabberd server respectively forwards mes- ages based on the time of origin. Since the ephemeral keys re chained to the previous keys, our experience showed that

2 TR successfully handles any number of offline messages re- ained on the messaging server.

.2. Processing time

o provide a practical comparison, we evaluated the pro- essing time of the message exchange, the handshaking and

he session refreshment in both protocols of O

2 TR and OTR.ig. 7 depicts the processing time to handle the incoming and

utgoing messages in OTR and O

2 TR protocols. Unlike outgo- ng messages, handling incoming messages takes more time ue to performing some additional tasks. To verify and han- le an incoming message, the receiver scrutinizes the cur- ent policies (e.g., accepting encrypted or non-encrypted mes- ages), the message type (data packet or AKE message), OTR’s arameters (e.g., version and validity), and the key IDs, and

hen it authenticates the received message ( Goldberg et al.,005 ).

Fig. 8 (a) shows the processing time to handle the offline ncoming messages, which is the main feature of O

2 TR. In

omparison to normal incoming messages, an offline mes- age takes more time to be handled. Detecting the offline essage and extracting the saved keys from EKM are the ain reasons for this time difference. We noted that if an

2 TR party receives multiple offline messages, the processing ime to handle the first message is longer than the processing ime for the rest of the offline messages. Unlike the first ffline message, which needs to extract the saved keys, the eys required to handle the remaining messages are prepared

ifferently. Since all offline messages are encrypted with

he same key in the multiple offline messages, they can be ecrypted with the same encryption key. Despite the fact that hey have different authentication keys and ctr , the encryp- ion key for the first offline message, extracted from the saved

eys, can be used for other offline messages. Therefore, for he second and subsequent offline messages, the processing ime is significantly shorter. Based on our experiments, the

Page 9: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0 235

Fig. 8 – (a) Processing time to handle the first two offline messages in O

2 TR. (b) Processing time for OTR handshake in

comparison to O

2 TR session resuming.

Table 1 – Average processing time to handle incoming, outgoing, and offline message in OTR and O

2 TR.

Message type

OTR O

2 TR Mann–Whitney U test ( p )

Incoming msg

15.15 ms 16.07 ms 3 . 7 × 10 −48

Outgoing msg 1.11 ms 1.14 ms 0.0867 Offline msg –first

– 29.95 ms –

Offline msg –non first

– 9.53 ms –

average processing time to handle the first offline messageby O

2 TR is 29.95 ms , while the second offline message takes9.53 ms on average for processing.

As a significant feature of OTR, the conversation parties areable to refresh the current private session and renew the DHkeys anytime during their conversation. Based on this, we pro-vided a condition in order to resume the private session inO

2 TR, when an offline message is received, instead of startinga new handshake, which takes longer. Fig. 8 (b) shows the pro-cessing time for both the OTR handshaking process and theO

2 TR private session resumption. On average, an OTR hand-shake takes 58.29 ms while the resumption of the private ses-sion in O

2 TR takes 43.49 ms. Based on these results, in O

2 TR,a private session is refreshed 34% faster than creating a newprivate session in OTR.

Table 1 compares the average processing times to handleall messages in OTR and O

2 TR models. To clarify the dif-ference between the distributions of the processing time inboth models, we performed a Mann–Whitney U test . As shownin Table 1 , there is a statistical difference in the processingtime for handling the incoming messages in OTR and O

2 TR( p < 0.001) while we failed to show a difference for handlingoutgoing messages ( p = 0 . 0867 ). Based on this result, theaverage processing time to handle the outgoing messagesare almost same in both models but handling the incomingmessages in O

2 TR is averagely longer. In comparison to the

incoming message handling, the processing time to handlethe offline messages in O

2 TR is almost two times longer.

7. Security analysis

Centrally distributing public keys leaves open the possibilitythat the key distributing server itself could carry out MitMattack, if it gets compromised or is under the coercion ofthe law enforcement authorities ( Bai et al., 2016; Shirvanianet al., 2017 ). Security code verification has been used inseveral applications (e.g., Signal systems), to mitigate MitMattack. In this case, the usability challenges (e.g., false rejector communication delay), caused by users’ less knowledgeor application’s incorrect supporting, may lead to serioussecurity problems. For instance, an inadequate warning maylead to aborting to reestablish the secure session after MitMattack detection ( Schröder et al., 2016 ).

In Signal systems, each party generates a set of DH keyscontaining ( Cohn-Gordon et al., 2017; Marlinspike and Perrin,2016; Schröder et al., 2016 ):

• a long-term identity key • a medium-term signed pre-key • a set of one-time pre-keys

In the registration phase, the Signal party uploads the pub-lic keys corresponding to these values to the key distributionserver, together with a signature on medium-term signed pre-key ( Cohn-Gordon et al., 2017 ). The server retains this set ofkeys to allow other parties to establish a private session withthis client. To perform a key agreement and a private session,a Signal party contacts the key distribution server and fetchesa pre-key bundle from the receiver. After verifying the pre-keysignature, the Signal party generates an ephemeral key pairwith the public key ( Marlinspike and Perrin, 2016 ). Registeringthe pre-keys to the intermediate server makes a Signal partyable to establish a private session even when the receiver isoffline.

Page 10: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

236 c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

WcfictSvSblisf

ipf(wawoP

bpci

spoattmtttoac

Osenbu

Abc

2fl

fiw

eg

hk

Vw

tf

c

wm

c

tieco

ng

ibra(

ap

tsf

t(

Bc

A

ct

B

a

g

q

g

Dii

Despite the explosive uptake of Signal (e.g., Signal 8 and

hatsApp

9 ), there are some issues in the usability and se- urity aspects. The lack of clear instructions for code veri- cation and insufficient information related to the possible onsequences of users’ actions lead to decrease the verifica- ion success and underestimate the actual risks ( Mujaj, 2017; chröder et al., 2016 ). To decreases the human errors in code erification, a semi-automated code verification is provided by ignal. In this case, the received code is copied to the clipboard

y user and the application verifies it by comparing with the ocally generated code ( Shirvanian et al., 2017 ). Despite this mprovement, granting access to the clipboard opens the pos- ibility of access to the private data and side channel issues or Signal users.

In the view of security, the server trust is the main security ssue of the Signal protocol. Refusing to hand out one-time re-keys by a compromised server causes forward secrecy or the secret key to depend on the signed pre-key’s lifetime Marlinspike and Perrin, 2016 ). This reduction in the initial for- ard secrecy could also happen if one party maliciously drains

nother party’s one-time pre-keys or impersonates himself ith a real client’s identity key along with the cooperation

f a compromised key distribution server ( Marlinspike and

errin, 2016; Schröder et al., 2016 ). Unlike the Signal protocol,oth OTR and O

2 TR need no third party for key distribution

urposes. Implementing the secure sessions independently auses the O

2 TR’s parties do not face these kinds of security ssues.

To evaluate the security properties of an O

2 TR-based mes- aging system, we analyzed the confidentiality provided in the resence of an untrusted messaging service provider. Based

n our threat model, the adversary is able to log the messages nd monitor their traffic. The capability of the attacker to re- ain the messages leads us to consider the ciphertext-only at- ack (COA) as the attack model for this analysis. In this attack

odel, the attacker can stop the message delivery and force he sender to send messages encrypted with the same key. On

he other hand, the attacker has information about the plain- ext, which is useful. For example, the message may consist f English words encoded in ASCII codes or a JPEG image. The ttack is successful if the corresponding plaintext can be de- rypted or if the key is derived.

As one of the basic security properties of OTR as well as

2 TR, ephemeral key exchanges are used to generate unique ession keys for each message. Based on the chain of key gen- ration in OTR, each data packet consists of a new DH expo- ent suggested by the sender to generate a DH key that is to e used for the next message. In practice, the key cannot be sed until the receiver has acknowledged this advertised key.s a result, if an OTR party needs to send multiple messages efore receiving any replies, he/she needs to keep using the urrent key and keep advertising the same key ( Frosch et al.,016; Marlinspike, 2013 ). This condition may lead to a possible aw when a curious messaging server, as an active attacker,lters the packets and forces the client to send all messages ith the same key. In this regard, retaining offline messages

8 https://signal.org/ . 9 https://www.whatsapp.com/ .

vi

c

c

ncrypted with the same key is a possible issue for the sug- ested O

2 TR-based system. Basically, the attack of COA is aided when the attacker

as multiple pieces of ciphertext generated from the same ey ( Tipton and Krause, 2007 ). The two-time pad ( Boneh andictor, 2016 ) problem shows the insecurity of a stream cipher hen the same stream cipher key is reused. In this situation,

he ciphertexts generated from two messages; m 1 and m 2

rom a key s :

1 ← − m 1 � G (s ) and c 2 ← − m 2 � G (s ) (1)

here G ( s ) shows the key-stream, can be XORed to recover 1 �m 2 ( Diesburg et al., 2008 ):

1 � c 2 = (m 1 � G (s )) � (m 2 � G (s )) = m 1 � m 2 (2)

Not surprisingly, English text contains enough redundancy hat given m 1 �m 2 the adversary can recover both m 1 and m 2

n the clear ( Boneh and Victor, 2016 ). For instance, Diesburg t al. (2008) showed that English plaintexts can be automati- ally extracted from two-time pads via the simple application

f a Bloom filter ( Bloom, 1970 ). To avoid any birthday collision, an upper bound on the

umber of key-stream blocks that can be generated from a sin- le key is assigned based on the block size ( McGrew, 2002 ). Fornstance, for modern block ciphers, like AES, in which has a lock size of 128, the birthday bound is 2 64 blocks, which cor- esponds to a whopping 1 million petabytes of data ( Gueron

nd Lindell, 2017 ), which is far from practical to be breakable Biryukov et al., 2010; McGrew, 2002 ). For proof of this bound-ry, we refer to the security margin defined by Bellare et al.’s revious results ( Bellare et al., 1997 ) for a block cipher. The at-acker’s capability to distinguish the ciphertext from a random

tream is defined as the advantage function ( Adv ()). There- ore, Adv [ PRF ]() and Adv [ PRP ]() show the advantage of the at-acker to distinguish respectively a pseudorandom function

PRF) and a pseudorandom permutation (PRP) from random.ased on this definition, in a block cipher with l bit-length of ipher size:

dv [ PRF ](t, q ) ≤ Adv [ P RP ](t, q ) + q 2 2 −l−1 (3)

Where q is the number of known plaintext blocks; t indi- ates the time used in the attack, and the advantage of the at- acker to distinguishing X from random is denoted as Adv [ X ].y assuming Adv [ PRF ](t, q ) = α and l = 128 for AES, it can bessumed that Adv [ P RP ](t, q ) = 0 since AES cannot be distin-uished from a PRP ( McGrew, 2002 ). Based on this:

=

α · 2 64 . 5 (4)

Therefore, the adversary’s advantage is limited to α, if the enerated key-stream blocks are less than 2 64 ( McGrew, 2002 ).espite this theoretical boundary, the actual amount is less

n reality. The standard NIST recommendation is to stop us- ng a key when the probability of leakage, which is an ad- antage to the adversary, exceeds 2 −32 . Thus, after encrypt- ng 2 48 blocks (i.e., 2 32 messages of length 2 16 ), keys must behanged ( Gueron and Lindell, 2017 ). An O

2 TR message is en-rypted with an AES-128 in the counter mode. In each data

Page 11: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0 237

message, a value of the counter, ctr , is selected such that aunique triple ( key A , key B , ctr ) can be used ( Goldberg et al., 2005 ).In a practical view, the standard implementation of AES-128uses a 96-bit IV, and thus collisions occur in the IV with a prob-ability 2 −32 after encrypting only 2 32 different messages (withfresh random IVs) ( Gueron and Lindell, 2017 ). Therefore, theactual upper bound to use a key to encrypt several messagesin AES-128 in counter mode is 2 32 messages. Consequently,the upper bound of the messages that can safely be retainedin the offline messages queue in the suggested O

2 TR-basedmessaging system is defined as:

k ≤ 2 32 (5)

Wherein k shows the number of messages encrypted withthe same key in a private session. Although this bound seemsunreachable in the offline message case, in our model wesuggested to define a practical threshold (e.g., k = 1024 ) touse an encryption key to do multiple encryption rounds. Bythis limitation, no O

2 TR party can use the same encryptionkey more than k times for multiple messages. Otherwise,sending is paused until receiving a reply or refreshing to anew private session. In this case, the attacker has a limitedamount of ciphertext and achieves a smaller chance for keyextraction.

Unlike the Signal protocol, where the key distributionserver buffers the pre-keys ( Cohn-Gordon et al., 2017 ), in O

2 TRthe required keys are saved in the local memory and are re-freshed in each message handling process. By assuming a safelocal environment that does not have any unauthorized ac-cess, there is no key derivation possibility for the messagingserver. Furthermore, authenticating O

2 TR data packet’s fields(e.g., keyid , next _ dh, and etc.), prevents any unauthorized ma-nipulation during transmission. Based on this, no MitM attackcan be considered by the curious messaging server in the pro-posed model. On the other hand, since no ephemeral keys arereused, the property of PFS is not compromised. Based on thisfact, the attacker has no chance to detect the private sessionkey even by logging the revealed MAC keys. Consequently, anykind of replay attack is not practical to compromise O

2 TR-based messaging system.

To verify the safety of O

2 TR, we exploited the AVISPA

10

cryptographic protocol verification tool. The AVISPA tool pro-vides a suite of applications for the purpose of analyzing for-mal models of the security protocols. AVISPA provides a lan-guage called the high-level protocol specification language(HLPSL) ( Chevalier et al., 2004 ) to describe the security proto-cols and specify their intended security properties, as well asbe used as a set of tools to formally validate them. HLPSL is amodular and role-based language that allows for the specifi-cation of complex control-flow patterns, data-structures, anddifferent intruder models ( Chevalier et al., 2004 ). To imple-ment the AVISPA verification in a virtual environment, weused a SPAN

11 animator, a security protocol animator forHLPSL specifications ( Genet, 2015 ).

10 http://www.avispa-project.org/ . 11 http://people.irisa.fr/Thomas.Genet/span/ .

Basically, SPAN translates the CAS+

12 language into anHLPSL specification and includes a local graphical interfacesimilar to the one of AVISPA. The CAS+ language representsthe implementation of a security protocol and its components(e.g., identifiers, messages, session, and intruder’s knowledgeand goal) in a set of simple phrases and symbols. The evalu-ation of AVISPA on SPAN animator indicates our protocol as asafe security protocol. In that evaluation, it was verified thatboth of the goals of the intruder, which are to detect messagetext and session ID, were unsuccessful. In those attack mod-els, the adversary aims to decrypt the message and extract thesession ID to recover the encryption keys respectively. Basedon our threat model, the adversary’s knowledge is limited toIDs of the sender and receiver and their public keys (in thehandshake stage). Our HLPSL evaluation codes are presentedin Appendix A .

8. Conclusions

In this paper, we extended OTR into a more generalized pro-tocol to provide a secure and efficient communication evenwhen the base network system is disrupted. Our proposedsystem provides both confidentiality and integrity of the mes-sages exchanged between clients with no need for any keydistribution entity. In this model, the curious server can-not compromise the user’s privacy despite the capability ofmessage retention. We analyzed the possible security threatsand showed that the proposed system is secure against suchthreats. To evaluate the safety of O

2 TR, we proved its secrecyusing the AVISPA tool implemented on a SPAN animator.

While the OTR protocol has a significant limitation in asyn-chronous messaging, the O

2 TR-based system can effectivelybe deployed in both synchronous and asynchronous mes-saging environments. To retrieve any offline emergency mes-sages, O

2 TR uses a mechanism to regenerate the session keys.In this case, the proposed model guarantees to retrieve anyundelivered messages due to a lost connection or a sessioninterruption. Our experiments showed its complete capabilityto handle offline messages in various conditions. We notedthat O

2 TR does not impose significant processing penaltiesto clients in its communication system. Furthermore, O

2 TRprovides an efficient session resumption, which is about 34%faster than creating a new private session in OTR.

For future work, we plan to develop our messaging systemto provide immediate and secure messaging communicationsystem. To this end, we are designing a model to speed upthe handshake process of O

2 TR. Eventually, our secure andreliable communication system will immediately provide asecure connection between clients and emergency servicecenters.

Appendix A. HLPSL evaluation code for O

2 TR

To evaluate the security of O

2 TR protocol, we modeled O

2 TRprotocol using AVISPA. Fig. A.9 describes a model for the pro-tocol between client A and client B in O

2 TR. Fig. A.10 describesa model for the session and environment in O

2 TR.

12 http://people.irisa.fr/Thomas.Genet/span/CAS _ manual.pdf/ .

Page 12: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

238 c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

Fig. A.9 – Client A and B in O

2 TR.

Page 13: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0 239

Fig. A.10 – Session and environment in O

2 TR.

R E F E R E N C E S

Alexander C, Goldberg I. Improved user authentication in

off-the-record messaging. In: Proceedings of the ACM

workshop on privacy in electronic society, WPES ’07. ACM; 2007. p. 41–7 . http://doi.acm.org/10.1145/1314333.1314340 .

Bai W , Kim D , Namara M , Qian Y , Kelley PG , Mazurek ML . An

inconvenient trust: user attitudes toward security and

usability tradeoffs for key-directory encryption systems. In: Proceedings of the twelfth symposium on usable privacy and

security (SOUPS 2016); 2016. p. 113–30 .Bellare M, Desai A, Jokipii E, Rogaway P. A Concrete Security

Treatment of Symmetric Encryption. In: Proceedings of the thirty-eighth annual symposium on foundations of computer science, FOCS ’97. IEEE Computer Society; 1997. p. 394 .http://dl.acm.org/citation.cfm?id=795663.796360 .

Biryukov A , Dunkelman O , Keller N , Khovratovich D , Shamir A . Key Recovery attacks of practical complexity on AES variants with up to 10 rounds. In: Proceedings of advances in

cryptology, twenty-ninth annual international conference on

the theory and applications of cryptographic techniques, EUROCRYPT; 2010. p. 299–319 .

Bloom BH. Space/time trade-offs in hash coding with allowable errors. Commun ACM 1970;13(7):422–6 .http://doi.acm.org/10.1145/362686.362692 .

Boneh D., Victor S. A graduate course in applied cryptography.

https://crypto.stanford.edu/dabo/cryptobook/draft _ 0 _ 3.pdf; 2016. Version 0.3.

Borisov N , Goldberg I , Brewer E . Off-the-record communication, or, why not to use PGP. In: Proceedings of the ACM workshop

on privacy in the electronic society, WPES ’04. ACM; 2004. p. 77–84 .

Channa MI , Ahmed KM . Emergency response communications and associated security challenges. Int J Netw Secur Appl 2010;2(4):179–92 .

Chevalier Y , Compagna L , Cuellar J , Drieslma PH , Mantovani J ,Mödersheim S , Vigneron L . A high level protocol specification

language for industrial security-sensitive Protocols. Proceedings of workshop on specification and automated

processing of security requirements, SAPS’04, 2004 .Cohn-Gordon K , Cremers C , Dowling B , Garratt L , Stebila D . A

formal security analysis of the signal messaging protocol. In: Proceedings of IEEE european symposium on security and

privacy (EuroS&P); 2017. p. 451–66 .Daghmehchi Firoozjaei M , Lee SM , Kim H . O2TR: Offline

Off-the-Record (OTR) messaging. In: Proceedings of the eighteenth world conference on information security applications, WISA 2017; 2017a. p. 110–20 .

Daghmehchi Firoozjaei M , Yu J , Choi H , Kim H . Privacy-preservingnearest neighbor queries using geographical features of cellular networks. Comput Commun 2017b;98:11–19 .

Di Raimondo M, Gennaro R, Krawczyk H. Secure off-the-record

messaging. In: Proceedings of the ACM workshop on privacy

Page 14: O2TR: Offline OTR messaging system under network disruption · on an XMPP/Jabber platform. We also proved the secrecy of O 2 TR using the AVISPA automated verification tool. The rest

240 c o m p u t e r s & s e c u r i t y 8 2 ( 2 0 1 9 ) 2 2 7 – 2 4 0

D

F

G

G

G

L

L

M

M

M

M

M

P

R

R

R

S

S

T

X

MtocS

dsE

SjaBs

MSt

ds

Smsn

JgmtSIhaai(

LtpM2

HCCcnptaapo2

drs

in the electronic society; WPES ’05. ACM; 2005. p. 81–9 .http://doi.acm.org/10.1145/1102199.1102216 .

iesburg SM, Meyers CR, Lary DM, Wang AA. When cryptography meets storage. In: Proceedings of the forth ACM international workshop on storage security and survivability, StorageSS ’08. ACM; 2008. p. 11–20 . http://doi.acm.org/10.1145/ 1456469.1456472 .

rosch T , Mainka C , Bader C , Bergsma F , Schwenk J , Holz T . How

Secure is TextSecure?. In: Proceedings of the IEEE European

symposium on security and privacy; 2016. p. 457–72 .enet T. A Short SPAN+AVISPA Tutorial. Research Report. IRISA;

2015 . https://hal.inria.fr/hal-01213074/file/main.pdf.oldberg I, Goulet D, Bergen J. Off-the-Record Messaging Protocol

version 3. 2005. https://otr.cypherpunks.ca/Protocol- v3-4.1.1.html . Last accessed on 2017.4.28.

ueron S, Lindell Y. Better Bounds for Block Cipher Modes of Operation via Nonce-Based Key Derivation. Cryptology ePrint Archive, Report 2017/702; 2017. https://eprint.iacr.org/2017/702 .

iu H , Vasserman EY , Hopper N . Improved Group Off-the-Record

Messaging. In: Proceedings of the twelfth ACM Workshop on

privacy in the electronic society, WPES ’13. ACM; 2013. p. 249–54 .

ustgarten SD. New threats to client privacy. Monitor Psychol. 2016;47(1):66 .http://www.apa.org/monitor/2016/01/ce-corner.aspx .

arlinspike M. Advanced cryptographic ratcheting. Open

Whisper Systems; 2013. https://whispersystems.org/blog/advanced-ratcheting/ .

arlinspike M, Perrin T. The X3DH Key Agreement Protocol. Open

Whisper Systems; 2016. https://signal.org/docs/specifications/x3dh/x3dh.pdf.

cGrew DA. Counter mode security: analysis and

recommendations. Proceeding of the fifty-fifth Internet Engineering Task Force (IETF), 2002. https://pdfs.semanticscholar.org/2c94/ f83c8b30bf2da92bf711a73e30c843969199.pdf.

oscaritolo V, Belvin G, Zimmermann P. Silent Circle Instant Messaging Protocol, Protocol Specification. 2012;Silent Circle Engineering 1.0.

ujaj A. A comparison of secure messaging protocols and

implementations. Master’s thesis, University of Oslo; 2017. https://www.mn.uio.no/ifi/english/research/groups/psy/ completedmasters/2017/Aulon _ Mujaj/ aulon _ mujaj _ msc _ comparison _ secure _ messaging _ protocols _ implementations _ 2017.pdf.

errin T, Marlinspike M. The double ratchet algorithm. https://signal.org/docs/specifications/doubleratchet/ doubleratchet.pdf; 2016.

astogi N , Hendler J . WhatsApp security and role of metadata in

preserving privacy. In: Proceedings of the twelfth

international conference on cyber warfare and security, ICCWS; 2017. p. 269–74 .

eitblatt M, Foster N, Rexford J, Schlesinger C, Walker D. Abstractions for network update. In: Proceedings of the ACM

SIGCOMM conference on applications, technologies, architectures, and protocols for computer communication; SIGCOMM ’12. ACM; 2012. p. 323–34 .http://doi.acm.org/10.1145/2342356.2342427 .

osler P, Mainka C, Schwenk J. More is less: on the end-to-end security of group chats in signal, WhatsApp, and Threema. https://eprint.iacr.org/2017/713.pdf; 2018.

chröder S, Huber M, Wind D, Rottermanner C. When SIGNAL hits the fan: on the usability and security of state-of-the-art secure mobile messaging. Proceedings of the first European

workshop on usable security, 2016 .http://eprints.cs.univie.ac.at/4799/ .

hirvanian M, Saxena N, George J. On the pitfalls of end-to-end encrypted communications: a study of remote key-fingerprint

verification. In: Proceedings of the thirty-third annual computer security applications conference, ACSAC 2017. ACM; 2017. p. 499–511 . http://doi.acm.org/10.1145/3134600.3134610 .

ipton HF , Krause M . Information security management handbook, vol. 1. 6th ed. Boston, MA, USA: Auerbach

Publications; 2007 .u X, Broustis I, Ge Z, Govindan R, Mahimkar A,

Shankaranarayanan NK, Wang J. MAGUS: minimizing cellular service disruption during network upgrades. In: Proceedings of the eleventh ACM conference on emerging networking experiments and technologies, CoNEXT ’15. ACM; 2015. p. 21:1–21:13 . http://doi.acm.org/10.1145/2716281.2836106 .

ahdi Daghmehchi Firoozjaei is a postdoc research fellow in

he Department of Computer and Information Security, College f Software & Convergence technology, Sejong University. He re- eived a B.S. degree in telecommunication engineering from the cientific-Applied Faculty of Post and Telecommunication, a M.S.egree in cryptology from Imam Hossein Comprehensive Univer- ity, Tehran, Iran, and his Ph.D. degree from the Department of lectrical and Computer Engineering, Sungkyunkwan University,uwon, Korea in 2000, 2005 and 2018, respectively. In 2006, he

oined the Telecommunication Company of Mazandaran (TCM) s a network expert until 2014. His research interest focuses on

lockchain, network security and privacy preserving in the online ervices.

inChang Kim is a Ph.D. student in the Department of Computer cience and Engineering, College of Information and Communica- ion Engineering, Sungkyunkwan University. He received his M.S.egree in business administration from Sungkyunkwan Univer- ity, Seoul, Korea, in 2009. Since 2006, he has been working in theoftware Content Research Laboratory of Electronics and Telecom- unications Research Institute (ETRI). His research interests are

ecurity engineering, mobile security, IoT Security, and artificial eural network.

aeSeung Song is an associate professor, leading the Software En- ineering and Security group (SESlab) in the Computer and Infor- ation Security Department at Sejong University. He is holding

he position of oneM2M Test Working Group Chair, IEEE ComSoc tandards for IoT Architectures Research Group Chair, and TTA

oT/M2M Convergence Special Project Gror oup Vice Chair. Prior to is current position, he worked for NEC Europe Ltd. between 2012 nd 2013 as a leading standard senior researcher. At that time, he ctively participated in IoT related R&D projects such as the Build- ng as a Service (BaaS) FP 7 project and IoT/M2M standardizations i.e., ETSI TC M2M and oneM2M). From 2002 to 2008, he worked forG Electronics as a senior researcher leading a 3GPP SA standard

eam. He received a Ph.D. at Imperial College London in the De- artment of Computing, United Kingdom in 2011. He hold BS and

S in Computer Science from Sogang University, respectively in

000 and 2002.

youngshick Kim is an assistant professor in the Department of omputer Science and Engineering, College of Information and

ommunication Engineering, Sungkyunkwan University. He re- eived a B.S. degree from the department of Information Engi- eering at Sungkyunkwan University, a M.S. degree from the De- artment of Computer Science at KAIST and a Ph.D. degree from

he Computer Laboratory at University of Cambridge in 1999, 2001 nd 2012, respectively. After completing his Ph.D., he worked as post-doctoral fellow in the Department of Electrical and Com- uter Engineering at the University of British Columbia. He previ- usly worked for Samsung Electronics as a senior engineer from

004 to 2008. He also served as a member of DLNA and Coral stan-ardization for DRM interoperability in home networks. His cur- ent research interest is focused on social computing and usable ecurity.