You are on page 1of 6

End-to-End Encrypting Android Phone Calls

I. Burns, K. Gabert, and J. Zheng


Department of Computer Science and Engineering, New Mexico Institute of
Mining and Technology, Socorro, NM, USA
iburns@cs.nmt.edu, kasimir@cs.nmt.edu, zheng@nmt.edu

Abstract Cellular phones are regularly used to discuss manage the security of the communications. If this trusted
sensitive personal and business information. However, little server is the cell phone provider, then the communications
attention is given to the security of these conversations, which will still not be private in our model.
can be particularly important for international businessmen. These solutions also are not implemented in Android
Current encrypted phone call solutions for this problem itself [4]. Instead, all of the current projects start from user
require either an Internet connection for VOIP or a spe- space, as an application available for Android, and add
cialized handset. In this paper, we propose an architecture to encryption there. Starting from user space means that if
encrypt phone calls as an addition to the Android smartphone Android is in control of another entity, such as the phone
operating system. The proposed architecture utilizes TLSPGP network provider, then these solutions will not provide any
to provide strong encryption with a peer-to-peer web of trust. protection [5]. Having Android in control of another entity
is a reasonable assumption since most phone providers will
install a custom Android on each phone sold. Also, these
Keywords: Android operating system, mobile computing, com- solutions are vulnerable to user space malicious software
puter security, encrypted communications. (malware) [4].
The rest of this paper is organized as follows. In next
1. Introduction section, we introduce some background information on se-
As cell phones are becoming more common, they are curity problems during an Andriod phone call, limitations of
being used to communicate numerous types of sensitive existing solutions and related security and privacy protocols.
information: personal banking details, business secrets, and The Andriod radio subsystem is described in Section III. In
personal health information are a few examples. Keeping Section IV, we present our solution for end-to-end encrypting
this information private is extremely important. In the past, Andriod phone calls and discuss some difficulties faced in
encrypted communications have only been accessible to those implementation. Finally conclusions are drawn in Section V.
with vast resources. As technology has moved forward, the
ability to communicate with high-level encryption has be- 2. Background
come a reality for more and more people. Currently, there are 2.1 Security Problems during an Andriod
no means of having encrypted communications in consumer
Phone Call
cell phones which cannot be monitored by the telephone
service provider. 2.1.1 Security Problems in the Android Operating System
To compound this issue, numerous flaws have been pre- The Android operating system takes a pervasive and multi-
sented in the current encryption used by the cellular telephone faceted approach to security, incorporating mechanisms from
providers. These flaws allow any individual with a computer Linux as well as introducing its own security features and
to quickly and easily monitor all cell-phone communications environment. These features include POSIX security mecha-
near them [1]. nisms, sandboxing through the Dalvik JVM, and restricted
This paper presents a method for adding an encrypted com- tasks that require user consent at application install-time.
munications stack to Android. Android-based smartphones Finally, Android devices are distributed with the user (and
are becoming more and more common [2] and present a any installed applications) limited to a non-administrative
unique opportunity to allow individuals and organizations account (the user doesnt have root). Ideally, this prevents
without vast resources to communicate using encrypted com- users from allowing software to make deep changes to the
munication. operating system and therefore limits the abilities of malware.
Adding encryption into Android is not a new idea. Red- Even with this extensive security architecture, Android has
Phone, from Whispersys [3], is a great example of re- a very large number of security-related exploits, including
cent Android-based products which provide encrypted phone exploits granting root permissions [6]. The problem is exac-
calls. However, the current solutions, including RedPhone, erbated by nature of Androids distribution. Although Google
rely on identity-based encryption. Identity-based encryption is in charge of Androids creation, it is distributed by a
is not peer-to-peer and requires a trusted central server to multitude of phone manufacturers and wireless carriers, who
each must provide users with a patch after Google creates it. a product which provides identity based encryption in a user-
This means the lead time between the discovery of an exploit land application using Voice over Internet Protocol (VoIP).
and users receiving a fix can be very long, even if Google While it does support protection against eavesdropping and
responds rapidly. Additionally, the vendors often abandon provides authentication for the communicating party, it is
the patching of phones relatively quickly, leaving some users limited. First, it requires a trusted third party which will
very vulnerable [6]. handle the encryption keys. This becomes a large problem if
there is no third party which should be trusted. The second
2.1.2 Security Problems in Cellular Networks reason that RedPhone does not satisfy the conditions is
A secure phone does little to preserve privacy if it uses because it is a user-space application. This means it is unable
an insecure network. In an effort to preserve privacy, cellular to provide any security assurances about the underlying OS,
radio standards such as GSM include encryption. Unfortu- and it is limited to VOIP as opposed to phone network-based
nately, these encryption schemes have a long history of being calls.
inadequate for dependable privacy protection [7].
2.3 Related Security and Privacy Protocols
The most modern ciphers available for GSM networks are
Kasumi-based encryption schemes (A5/3 for GSM, UEA1 2.3.1 Pretty Good Privacy (PGP)
for UMTS, GEA3 for GPRS [8]) are currently unbroken, but PGP is a form of public key cryptography originally de-
appear somewhat vulnerable. A practical time attack against veloped for use in email [13]. The OpenPGP standard allows
Kasumi exists [9], but does not appear to be workable on the implementation of various asymmetric and symmetric
the overall encryption schemes employed by GSM-based algorithms, including RSA and AES. PGP is structured
networks [8]. around a message-packet format, with encryption for privacy
and digital signatures for integrity [13].
2.1.3 Security Problems in Telephone Networks Where PGP is special among modern encryption schemes
Outside of the handset-to-tower link, cellular networks is its trust model, called the Web of Trust. At its core, PGP
revert to unencrypted traditional phone networks. If the relies of the user to determine whether they trust the identity
infrastructure provider is trusted, this can be a minor problem. of a key. The Web of Trust model is design to aid this
However, when the infrastructure provider is not trusted (such process, without introducing a central authority that can be
as during international business travel), this lack of security compromised. The concept of trust" is deliberately vague so
through the phone network can be a problem. Even when the a user can determine what it means for them. An untrusted
nation controlling the phone network is trusted, the network key still provides privacy, but is unable to provide identity
may not be trustworthy. verification [14].
In 2005, Vodafone Greece disclosed an attack that com-
promised two central office switches. The compromised 2.3.2 Transport Layer Security (TLS)
switches were used to unlawfully wiretap 100 high-level TLS is a very popular cryptographic protocol in
officials in the Greek public and private sectors, including widespread use for numerous Internet applications. The most
the Prime Minister and his wife. The attacking rootkit was widely known of which is HTTPS. It provides symmetric
not discovered until a software malfunction caused a deep key exchange and an integrity check using a keyed Message
investigation into the switch software [10]. Authentication Code [15].
In Italy, both official and unofficial phone intercepts have In traditional TLS, a trusted Certificate Authority verifies
created numerous media scandals and resulted in arrests of the identities of key holders. However, there have been sev-
high-profile officials. These scandals have spurred demand eral recent high profile attacks against the certificate authority
for end-to-end encryption for phones used to discuss sensitive system [16]. Once a certificate authority is compromised the
matters there [11]. entire system breaks down.
The market research firm ABI states that 79% of com- It is possible to use PGP instead of a certificate authority
panies use mobile phones for communications that would be structure in the TLS Handshake Protocol. RFC 6091 imple-
damaging if intercepted, and other studies have indicated that ments such a standard [17]. It allows a Web of Trust au-
the average cost of significant data loss is up to $1.3 million thentication model to be used while providing the commonly
per incident [12]. End-to-end encryption is the only way to available and well studied TLS protocols.
fully address interception concerns [12].
3. Android System Architecture
2.2 Limitations of Existing Solutions In this section we will discuss the Android radio sub-
Encryption has been added to Android phone calls in the system and how it interacts with Android as a whole. The
past. The most notable project to add encryption is a phone information in this section was gathered using the Ice Cream
system denoted RedPhone, by Whispersys [3]. RedPhone is Sandwich source code.
Android is composed of five major components: Applica- ultimately responsible for determining where the audio from
tions, Application Framework, Libraries, Android Runtime, a stream (such as the call audio stream) ends up being played.
and the Linux Kernel [18]. The cellular call system is imple- AudioFlinger does not provide a user-friendly
mented in Android as the Telephony Manager component, a interface at the level Android applications are
subcomponent of the Application Framework. expected to function at. This interface is provided
by android.media.AudioSystem, which
3.1 Android Telephony bridges from the Java-based Application Framework
The Telephony Manager component is a platform- to the native-code-based media system using
dependent component, meaning that for each platform (or android/frameworks/base/media/libmedia.
different mobile phone / tablet) parts of it will have to be The AudioSystem class provides constants for generic
adjusted to work with the potentially proprietary Vendor devices and streams, such as DEVICE_OUT_EARPIECE
Radio Interface Layer (RIL). Figure 1 contains a graphical and STREAM_VOICE_CALL It also provides methods
representation of the various blocks that compose the tele- meaningful to applications that control the media system,
phony component. such as muteMicrophone or setRingerMode.
The RIL interactions start right above the
baseband, which is the firmware specific to the Applications
platform. The file android/hardware/ril/
reference-ril/reference-ril.c contains
functions which are the closest Android gets to interacting Phone
with the GSM network. This file interfaces with the baseband
to perform various GSM actions such as dialing numbers,
hanging up calls, accepting calls, and so on. The RIL library Phone Util
performs callbacks into this file. Those callbacks take the
form
Audio System
onRequest ( i n t request , void * data ,
s i z e _ t d a t a l e n , RIL_Token t )
RIL Audio Flinger
where request contains the action of the request,
and RIL_Token allows for stateful operations. On
the other end of the spectrum, the Android package
Vendor RIL Lib Hardware
com.android.internal.telephony contains vari-
ous classes dealing with controlling the phone. Similar to
the RIL commands, the commands exposed through these Fig. 1: The various blocks of the telephony component used
objects control the phone state, such as acceptCall(), in placing and communicating during a phone call. The blue
rejectCall(), clearDisconnected(), etc. outlined components are found in the Application Framework
layer of Android, the green outlined components are found
3.2 Android Media in the Library layer, and the black outlined components are
The Media components of the Application Framework as found in the Vender layer.
responsible for Androids multimedia support. The audio
portion of this framework is of interest for phone calls.
The basic unit of Android audio is the stream.
3.3 Phone Calls in Android
Streams can be input or output to/from any audio
device and application. The routing of these streams Phone calls in Android are the end result of a collaboration
to various available microphones and speakers is han- between the telephony and media frameworks. They begin
dled by AudioFlinger android/frameworks/base/ when the user interacts with the phone application. When the
services/audioflinger. Presumably to increase plat- user has entered the number to dial and has placed the phone
form independence, AudioFlinger does little direct rout- call, the phone application will issue a request for a phone
ing by default (although it retains the capability to route call with the specified number. This request will propagate
arbitrarily). Instead, it sets a system-wide routing mode down into the vendor RIL. The vendor RIL will then send the
such as MODE_IN_CALL, or MODE_RINGTONE. This request directly to the baseband on the phone. If the phone
routing mode is then passed down into vendor-specific call request was issued correctly then an acknowledgment of
code supporting the media system through the inter- the phone call will immediately be issued.
face defined in android/hardware/libhardware/ The baseband will then make the appropriate cell network
include/hardware/audio.h. The vendor code is then request. Upon success, it will begin transmitting from the
phone speaker and outputting the received voice transmis- for this project. Second, we will discuss where this encryption
sion directly to the speaker. Finally, once a connection is should be placed in the existing Android telephony stack
established, the RIL in Android will receive an onRequest to provide encrypted phone calls to users while preserving
callback and will update the phone application interface the integrity of current Android systems and applications.
appropriately. This interaction can be seen in Figure 2. Finally, some difficulties in implementation the solution are
discussed.
Phone App 4.1 Encryption Scheme
(1) (4) To ensure privacy in the event of a malicious cellular
(2) (3) network provider, we propose using a combination of PGP
and an AES stream cipher. PGP provides a widely-used Web
Telephony Audio System
of Trust which will help authenticate users.
This implementation will follow RFC 6091 [17] which
RIL Audio Flinger describes how to adjust the TLS Handshake Protocol to
use PGP keys. The TLS protocol is a widely-implemented
Vendor RIL Lib Hardware and well trusted protocol providing perfect forward secrecy.
The GNU TLS implementation of the TLS protocol contains
extensions to enabled the use of PGP keys. However, it does
baseband speaker / mic not implement any trust model for these PGP keys [19].
We performed some benchmarking to determine if a target
Android phone could support AES at a speed fast enough for
Fig. 2: The structure of placing a phone call in Android. the purpose of encrypting phone calls. For these benchmarks,
Even though the call is placed in Android, the actual digital we used a Samsung Nexus S running the Android Open
voice stream is set up by the low-level code provided by Source Project version of Ice Cream Sandwich (Android 4.0).
the vendor. (1): Placing a call. (2): Call in progress. (3): Set This phone uses a 1 GHz ARM Cortex A8 based processor,
mode MODE_IN_CALL. (4): Returning back, displaying call and we believe it represents a fairly typical current Android
in progress. device.
We measured performance of AES using 128-bit keys, no
Once the call is established, the telephony system puts the padding, and the cipher in ECB mode. We compare perfor-
phones media system into MODE_IN_CALL. By default, this mance of the Java-based AES implementation (managed")
causes the vendors media code to do something reasonable, using the default provider for javax.crypto in Android and
like routing the call audio stream STREAM_VOICE_CALL. the C implementation of AES in the nettle library (native").
If a bluetooth or wired headset is connected, the vendors The nettle library implements a variety of cryptography
code handles the change in audio routing. algorithms which is also used by GNU TLS. We measured the
Essentially, there is a dumb phone (as compared to a time required (as reported by the system clock) to encrypt 10
smart phone) running alongside Android in an Android megabytes of random data. The results were then reported in
smart phone. Android does not actually perform a phone megabytes encrypted per second. Each test was repeated 10
call itself. Instead, it effectively dials the number through times. The first execution was discarded in which managed
the baseband (dumb phone) and then the baseband will code was slower than subsequent executions.
alert Android whenever it is in a phone call. This leaves all We found the managed implementation of AES produced
of the implementation of the phone components itself up to an average encryption rate of about 3.66 MB/s with a
baseband and outside of the reach of Android. standard deviation of 0.02 and the native implementation
Such an architecture for sending and receiving calls produced an average rate of 8.24 MB/s with a standard
complicates the matter of adding encryption. Most of the deviation of 0.35. Either of these rates is completely sufficient
decision-making components lie in vendor code instead of the for our purposes, where we anticipate the requirement of
Android system. Any encryption scheme must work within encrypting Andriod phone calls to be less than 100 kilobytes
the context of current decisions, routing around and through per second.
existing, proprietary code.
4.2 Details of Implementation
4. End-to-End Encrypting Phone Calls in Implementation of the proposed solution in Android re-
quires a few changes to the operating system. These changes
Android form 3 new subsystems: the Cryptographic Control Module
This section contains our proposed solution to this prob- (CCM), the Cryptographic Module (CM), and the Crypto-
lem. First, we present the recommended encryption scheme graphic Interface (CI). These modules create a tweaked media
stack for encrypted calls, and add a few additional libraries to the original bit-for-bit. If lossy compression is employed
support their functionality. Figure 3 contains an overview of below the encryption, the data will be irrecoverable. Any
the modules interactions during a phone call process. This compression performed by the phone network needs to be
section will detail the changes required to Android in order evaluated. If it is performed in the RIL on the device,
to realize these modules. access to the RILs code will be required for successful
The Cryptographic Module will actually perform the en- implementation.
cryption on the audio stream. It will be added at the system In general, the architecture of the Android system has
Library level. This encryption module will act as a virtual the potential to get in the way. In addition to compression
audio input/output while performing the encryption of the concerns, odd behavior of vendor code may derail implemen-
phone call. Then the module will route the decrypted plain- tation. Correct permissions for all actions need to be located
text audio to the systems original call audio destination and assigned, and there is potential for unforeseen difficulties
which could be the phones ear piece or a peripheral hands- in implementation from the structure of the Android system.
free device. The incoming plaintext from the microphone will The latency of the phone network provides another un-
similarly be encrypted before being passed through to the known. With cellular, wired, and international phone net-
baseband system. works involved, there is the potential for significant latency
The Cryptographic Module requires a library supporting in the transmission system. We expect that TLS will be able
TLSPGP protocol functionality must be added at the system to tolerate whatever latency is present because of its common
Library level. We propose the use of GNU TLS for this use with HTTP. A phone call, however, can be viewed as a
purpose. To support the implementation of the web of trust, real-time application where the encryption and transmission
PGP will also be added to the system libraries. Java Native of data must be mroe timely than web browsing. The length
Interface (JNI) bindings will then be added for the relevant of the handshake is also a concern, especially when the end-
portions of each of these libraries to allow application-level to-end latency of the phone network is high. In the worst
code to interact with the call cryptography system. case, we would expect that the proposed solution will suffer
The Cryptographic Control Module will consist primarily from latency less than satellite phones, which is tolerable for
of adjustments to the AudioSystem and other Application most users.
Framework components of the media and telephony systems. Finally, the battery life of the phone making the encrypted
These adjustments will allow the redirection of the call audio phone calls is a concern. The encryption process will result
stream to the Cryptographic Module. The setParameters in higher CPU utilization and power consumption during a
method of the AudioSystem class enables the CCM to call. The exact effect of this increased power consumption
redirect the call audio stream using high-level constructs on battery life needs to be investigated in future. In general,
understood at the application layer. That is, using constructs somewhat reduced battery life is a necessary trade-off for
such as the CALL_AUDIO_STREAM constant instead of secure calls.
direct references to audio stream data.
The Cryptographic Interface exposes encrypted call and Phone App CI
key management functionality to the user. It consists of
modified Phone and Contacts apps. The Phone apps will (1) (4)
expose enable/disable encryption functionality when a public (2) (3)
key is available, provide indications that a secure or insecure
Telephony Audio System
call is in progress, and allow the user to place secure and
insecure phone calls. The Contacts app will expose the web CCM
of trust functionality and key management, by providing keys RIL Audio Flinger
associated with the users contacts.
Vendor RIL Lib Hardware
4.3 Implementation Difficulties
The implementation of this architecture faces a variety
of challenges. The first is porting the required libraries. baseband speaker / mic
When they are fully implemented in C, this process is
typically straightforward. However, it is difficult to predict
if or where assembly code will be encountered for improved CM
performance. This code is typically targeted at x86 machines,
so switching to ARM-based Android devices can be challeng- Fig. 3: The structure of placing an encrypted phone call in
ing. Android. In this structure, the phone call will have its voice
The implementation also depends on data being sent routed through the encryption module in the Library layer.
through the phone network in a manner that reproduces
5. Conclusion [11] P. Kiefer, Phone taps in Italy spark a rush for cellular
encryption, 2007. [Online]. Available: https://www.nytimes.com/
This implementation will satisfy the conditions required 2007/04/29/technology/29iht-encrypt30.1.5487929.html
to prevent the described adversary model. The encryption [12] S. Bransfield-Garth, Mobile phone calls as a business risk, Network
will be triggered when a GSM phone call is placed and a Security, vol. 2010, no. 9, pp. 411, Sep. 2010. [Online]. Available:
http://linkinghub.elsevier.com/retrieve/pii/S1353485810701148
public key is known for the corresponding contact. Since [13] J. Callas, L. Donnerhacke, H. Finney, D. Shaw, and R. Thayer,
the encryption will be implemented in Android, it will be OpenPGP Message Format, RFC, vol. 4880, 2007. [Online].
resistant to user-land malware present on the phone. Since Available: https://tools.ietf.org/html/rfc4880
[14] M. Lucas, PGP and GPG. No Starch Press, Incorporated, 2006.
the encryption is a modification to Android itself, users [15] T. Dierks and E. Rescorla, The Transport Layer Security
will be motivated to place a custom OS on their phone (TLS) Protocol, RFC, vol. 5246, 2011. [Online]. Available:
which will help prevent attacks from the cell phone service https://tools.ietf.org/html/rfc5246
[16] GlobalSign stops secure certificates after hack claim, 2011. [Online].
provider. Finally, using a combination of PGP and AES will Available: http://www.bbc.co.uk/news/technology-14819257
be sufficient to ensure privacy of phone calls without relying [17] N. Mavrogiannopoulos and D. Gillmor, Using OpenPGP Keys for
on a trusted central authority. Using TLS and PGP will help Transport Layer Security (TLS) Authentication, RFC, vol. 6091,
2011. [Online]. Available: https://tools.ietf.org/html/rfc6091
prevent an implementation lock-in for the cryptography and [18] Google, Inc., Android Documentation,
will allow multiple developers to independently implement http://developer.android.com/guide/.
similar systems interacting on the same network. [19] Free Software Foundation, Inc., Gnu TLS,
http://www.gnu.org/software/gnutls/.
Adding this encrypted radio module and modifying the
radio stack in Android will help provide privacy where
it is desperately needed. By implementing such a system,
attacks on core cellular or telephone infrastructure as well as
specific attacks against individuals will be mitigated. With
truly ubiquitous cell phone use, such a system becomes
exceedingly important.

References
[1] S. Gold, Cracking GSM, Network Security, vol. 2011, no. 4, pp.
1215, Apr. 2011. [Online]. Available: http://linkinghub.elsevier.com/
retrieve/pii/S1353485811700393
[2] Taylor Wimberly, Android growth outpaces iPhone,
http://androidandme.com/2009/08/news/android-growth-outpaces-
iphone/.
[3] Whisper Systems, Mobile Security for Android,
http://www.whispersys.com/.
[4] A. Shabtai, Y. Fledel, U. Kanonov, Y. Elovici, S. Dolev, and C. Glezer,
Google Android: A comprehensive security assessment, Security &
Privacy, IEEE, vol. 8, no. 2, pp. 3544, 2010. [Online]. Available:
http://ieeexplore.ieee.org/xpls/abs\_all.jsp?arnumber=5396322
[5] S. Trapp, M. Whlisch, and J. Schiller, Short Paper: Can Your
Phone Trust Your Friend Selection? in CCS 11: Proceedings
of the 18th ACM conference on Computer and communications
security, 2011. [Online]. Available: http://page.mi.fu-berlin.de/waehl/
papers/tws-spypt-11.pdf
[6] T. Vidas, D. Votipka, and N. Christin, All Your Droid Are
Belong To Us : A Survey of Current Android Attacks,
in USENIX Workshop on Offensive Technologies August 2011,
2011, pp. 110. [Online]. Available: http://mendeley.citizenlab.org/
VidasVotipkaChristin2011.pdf
[7] E. Barkan, E. Biham, and N. Keller, Instant Ciphertext-Only
Cryptanalysis of GSM Encrypted Communication, Journal of
Cryptology, vol. 21, no. 3, pp. 392429, 2008. [Online]. Available:
http://www.springerlink.com/index/ythkwv4gfq0fr5j4.pdf
[8] S. Bellec, The attack against Kasumi cannot
practically be used against the GSM, 2010.
[Online]. Available: http://pro.01net.com/editorial/511353/
the-attack-against-kasumi-cannot-practically-be-used-against-the-gsm/
[9] O. Dunkelman, N. Keller, and A. Shamir, A practical-time
attack on the A5/3 cryptosystem used in third generation GSM
telephony, in Proceedings of the 30th Annual Cryptology Conference
(CRYPTO 2010), no. December 2009, 2010. [Online]. Available:
http://cryptome.org/a5-3-attack.pdf
[10] V. Prevelakis and D. Spinellis, The Athens Affair, Ieee Spectrum,
vol. 44, no. 7, pp. 2633, 2007. [Online]. Available: http:
//ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=4263124

You might also like