Chapter # USING ELLIPTIC CURVE ENCRYPTION ...

2 downloads 0 Views 246KB Size Report
methods and techniques used for data encryption and decryption. Elliptic curve cryptography, an approach to public key cryptography, is now commonly used in.
Chapter # USING ELLIPTIC CURVE ENCRYPTION AND DECRYPTION FOR SECURING AUDIO MESSAGES

Artan Luma1, Besnik Selimi2, and Lirim Ameti3 1 South East European University, Ilindenska no. 335, 1200 Tetovo, FYR. Macedonia, email: [email protected] 2 South East European University, Ilindenska no. 335, 1200 Tetovo, FYR. Macedonia, email: [email protected] 3 South East European University, Ilindenska no. 335, 1200 Tetovo, FYR. Macedonia, email: [email protected]

Abstract: The security of message transmission is usually a challenge for its participants. Many available programs that work with audio data claim to enable secured communication, but usually do not show the details of the methods used for data encryption. For end users to be confident, it is essential to be aware of the methods and techniques used for data encryption and decryption. Elliptic curve cryptography, an approach to public key cryptography, is now commonly used in cryptosystems. Hence, in this paper we present a method for using elliptic curve cryptography in order to secure audio data communications. Furthermore, we present a tool that implements this method for encrypting an audio file, transmitting it through the network and decrypting the file at the other end. Keywords: audio message, cryptography, decryption, elliptic curves, encryption, privacy, secure transmission

1.

INTRODUCTION

Digital audio transmission is omnipresent nowadays and there is a rising concern about the privacy of communication between parties. A lot of

2

Chapter #

applications in existence today claim they enable a secure audio communication, without divulging the underlying technology, and this makes final users more suspicious about the level of security. For end users to be confident, it is essential to be able to assess the degree of confidentiality of their communication. We present here, a method of encryption/decryption using elliptic curves in order to secure the transmission of voice messages. Public-key cryptosystems [7] as a concept, implemented by a big number of different algorithms, are widely used in modern cryptography. But, known algorithms such as RSA [11] are not suitable for use when dealing with large amounts of data. When dealing with such amount of data, along the privacy concerns, one should also consider the practical performance of algorithms, and thus consider a more efficient cryptographic system. Compared to the encryption of text messages [1], voice messages contain a large amount of data and therefore the aforementioned algorithms are not efficient enough. We propose a cryptosystem that addresses this issue [9]. The elliptic curve cryptography [12] is more than appropriate for achieving the goal. Compared to RSA algorithm, the efficiency of elliptic curve cryptography is stated as follows: “Safety of elliptical curves is based on elliptic curve discrete logarithm problem (ECDLP) which enables ECC to reach the same level of security with RSA for smaller keys and greater computation efficiency. ECC-160 provides security compared with RSA1024 and ECC-224 provides security compared with RSA-2048 [2]”. This fact is sufficient to build our cryptographic system based on elliptic curves, which is the main purpose of this chapter. The rest of this chapter is organized as follows: section 2 describes elliptic curve operations, section 3 describes the usage of these mathematical operations to perform encryption and decryption, section 4 describes the particular audio format (.wav) that we use in our system, section 5 explains the implementation of our system. Finally, the section 6 concludes this chapter and gives future directions.

2.

ELLIPTIC CURVE OPERATIONS

Elliptic curve operations which are relevant to this chapter are: point generation, point addition, point subtraction, point doubling and point multiplication. For these operations to be faster, more accurate and more efficient, an elliptic curve is defined over two finite fields: • Prime field Fp , where p is a prime and • Binary field F2m, where m is a positive integer. We use the prime field Fp. In order to illustrate the point operations, we consider as a use case the following elliptic curve ( = 277):

#. Using Elliptic Curve Encryption and Decryption for Securing Audio Messages =

2.1

+

+ 1

277,



3

(1,1)

Point generation

Elliptic curve operations are defined over the points of the elliptic curve. Therefore we need to generate those points for a selected curve. To generate the points of the elliptic curve we need to perform the following steps: 1. 2. 3.

Calculate 277 for every value of ∈ [0,277) Calculate 277 for each value of ∈ [0,277), 277 = 277 is satisfied, we register the point Each time the condition ( , ).

In the following table, for illustration purposes, we show the generation of points for the values of = 0, 1, 2, 3 4. Let us take = 0, then: = 0 + 0 + 1 277 =1 Now we need to calculate the square of every number between 0 and − 1, i.e. 276, and then we modulate the result with , i.e. 277. In the end, we compare the result with , in our case with 1. The result of these calculations is better depicted in the following table [8]: Table #-1. Point generation. 0 1 0 0 1 1 0 1 2 … … … 0 1 276 1 3 0 … … … 1 3 130 1 3 131 … … … 1 3 147 … … … 4 69 30 … … …

277 0 1 4 … 1 0 … 3 264 … 3 … 69



277 == F T F … T F … T F … T … T …

( , )⟺( , ) / (0,1) / … (0,276) / … (1,130) / … (1,147) … (4,30) …

Our curve is specially selected for illustration purposes so it has 256 points including the point at infinity, and with them we can represent every character of the ASCII table.

4

Chapter #

Elliptic curve operations like point addition, point subtraction, point doubling and point multiplication in the prime field ( ) are defined as follows [3]: 2.1.1

Point addition

Consider two distinct points ! and " such that ! = ( # , # ) and " = $ , $ ). Let % = ! + ", where % = ( & , & ), then ' is the slope of the line through ! and ". The slope ' is calculated as follows: & = (' − # − $ ) & = ('( # − & ) − # ) $− # '=* + $− # If " = −! , i.e. " = ( # , − # ) then ! + " = , , where , is the point at infinity. If " = ! then ! + " = 2 ∙ !, then point doubling operations are used. Also: !+" ="+! In the following, we illustrate the addition of the points ! = (1,130) and " = (4,30). Then, the point %( & , & ) can be calculated as: First ' is calculated: 30 − 130 '= 277 4−1 −100 '= 277 3 1 ' = −100 ∙ 277 3 ' = (−100) ∙ (−92) 277 ' = 9200 277 ' = 59 277 then 277 & = (59 − 1 − 4) = (3481 − 5) 277 & 277 & = 3476 277 & = 152 and finally 277 & = (59 ∙ (1 − 152) − 130) (59 (−151) = ∙ − 130) 277 & 277 & = −9039 = 102 277 & Hence the result of point addition of (1,130) and (4,30) for the elliptic group (1,1) is (152,102). (

#. Using Elliptic Curve Encryption and Decryption for Securing Audio Messages 2.1.2

5

Point subtraction

Consider two distinct points ! and " such that ! = ( # , # ) and " = ( $ , $ ), then ! − " = ! + (−"), where −" = ( $ , − $ ) . As an example, let consider the points ! = (1,130) , and " = (4,30). Then, −" = (4, −30) 277 = (4,247) 277 % = ! − " = ! + (−") % = (1,130) + (4,247) = (131,63) Hence the subtraction of ! = (1,130) and " = (4,30) , i.e. % = ! − " , gives the point % = (131,63) which also lies in our elliptic curve. 2.1.3

Point doubling

Consider a point ! such that ! = ( # , # ), where # ≠ 0. Let % = 2 ∙ !, where % = ( & , & ), then: & = (' − 2 ∙ # ) & = (' ∙ ( # − & ) − # ) 3∙ # + '= 2∙ # ' is the tangent at point ! and is one of the parameters that generates the point !. If # = 0, 2 ∙ ! = ,, where , is the point at infinity. As an illustration, we calculate the point % = 2 ∙ ! for ! = (1,130). Calculation of ': 3∙1 +1 '= 277 2 ∙ 130 4 '= 277 260 1 ' =4∙ 277 260 ' = (4 ∙ 114) 277 ' = 456 277 ' = 179 277 then 277 & = (179 − 2 ∙ 1) 277 & = (32041 − 2) 277 & = 32039 = 184 277 & and finally

6

Chapter #

= (179 ∙ (1 − 184) − 130) 277 (179 (−183) = ∙ − 130) 277 & 277 & = (−32757 − 130) = −32887 277 & 277 & = 76 Hence the result of doubling of the point (1,130) for the group is the point (184,76). &

2.1.4

(1,1)

Point multiplication

We calculate point multiplication by combining point addition and point doubling. The following double-and-add algorithm functions like following: 2 ← 4 567 8 ← 1 9:;6 < − 1 2 ← (2 + 2) =5 > = 1 ;?@A 2 ← (2 + 4) 7@;97A
is the bit with the index 8 [4]. Consider the point 4(1,130) that lies in the curve. Let us take a scalar = 47 , i.e. = (101111) and > = [1,0,1,1,1,1] , then 2 = ∙ 4 , i.e. 2 = 47 ∙ (1,130). The execution of the algorithm will produce the following calculations: 2 = (1,130) 8 = 1,

C

2 = ((1,130) + (1,130)) = 0, /

277

8 = 1 + 1 = 2, 2 = ((184,76) + (184,76))

277

8 = 2 + 1 = 3, 2 = ((60,276) + (60,276))

277

= 1, 2 = ((15,90) + (1,130)) = 1, 2 = ((184,86) + (1,130))

8 = 3 + 1 = 4, 2 = ((67,3) + (67,3)) D

277

= 1, 2 = ((103,73) + (1,130))

8 = 4 + 1 = 5, 2 = ((244,128) + (244,128))

277 277 277

277

#. Using Elliptic Curve Encryption and Decryption for Securing Audio Messages E

= 1, 2 = ((227,102) + (1,130))

7

277

T=(46,106) Hence the multiplication of point 4 = (1,130) with the scalar = 47, in the elliptic group (1,1) gives as a result the point 2 = ∙ 4 = (46,106).

3.

ECC ENCRYPTION AND DECRYPTION

Elliptic curve cryptography can be used to encrypt plaintext messages into ciphertexts. The plaintext message, say F, is encoded into a point 4G from the finite set of points in the elliptic group, ( , H). The first step consists of choosing a generator point, I ∈ ( , H) such that the smaller value of for which ∙ I = , is a very large prime number. The elliptic group ( , H) and the generator point I are made public. Each user selects a private key, J < and computes the public key 4J = J ∙ I. To encrypt the message point 4G for L, M chooses a random integer N and computes the ciphertext pair of points 4O using L′s public key 4Q : 4O = [(N ∙ I)], (4G + N ∙ 4Q )] After receiving the ciphertext pair of points 4O , L multiplies the first point, (N ∙ I) with his private key Q and then adds the result to the second point in the ciphertext pair of points, (4G + N ∙ 4Q ): (4G + N ∙ 4Q ) − ( Q ∙ N ∙ I) = (4G + N ∙ Q ∙ I) − ( Q ∙ N ∙ I) = 4G which is the plaintext point, corresponding to the plaintext message F. Only L , knowing the private key Q , can remove Q ∙ (N ∙ I) from the second point of the ciphertext pair of point, i.e. (4G + N ∙ 4Q ), and hence retrieve the plaintext information 4G [5]. Consider our elliptic curve: = ( + + 1) 277 That is = 1, H = 1, = 277. The elliptic curve group generated by the above elliptic curve is ( , H) = (1,1). Let I = (0,276) be the generator point, so the multiples N ∙ I of the generator point I are (for 1 ≤ N ≤ 277): I = (0,276) ; 2I = (208,105) ; 3I = (72,220) ; 4I = (274,91) ; 5I = (174,74) ; 6I = (84,3) ; 7I = (117,35) ; 8I = (47,157) ; 9I = (146,241) ; 10I = (122,201) . . . . . . . . . . 274I = (121,180) ; 275I = (258,34) ; 276I = (149,188) ; 277I = (175,175) ; If M wants to send to L the message F which is encoded as the plaintext point 4G = (18,158) ∈ (1,1), M must use L's public key to encrypt it. Suppose that L's secret key is Q = 85, then L's public key will be:

8

Chapter #

Q ∙ I = 85 ∙ (0,276) 4Q = (237,15) A selects a random number N , say k = 113 , and uses B 's public key PW = (237,15) to encrypt the message point into the ciphertext pair of points: PX = [(k ∙ G), (PZ + k ∙ PW )] PX = [113 ∙ (0,276), (18,158) + 113 ∙ (237,15)] PX = [(260,67), (18,158) + (253,130)] PX = [(260,67), (68,178)] Upon receiving the ciphertext pair of points PX = [(260,67), (68,178)], B uses his private key nW = 85, to compute the plaintext point PZ as follows: (PZ + k ∙ PW) − [nW ∙ (k ∙ G)] = (68,178) − [85 ∙ (260,67)] (PZ + k ∙ PW ) − [nW ∙ (k ∙ G)] = (68,178) − (253,130) (PZ + k ∙ PW ) − [nW ∙ (k ∙ G)] = (68,178) + (253, −130) because −P = (x ], −y] ) (PZ + k ∙ PW ) − [nW ∙ (k ∙ G)] = (68,178) + (253,147) because −130 ≡ 147 mod 277 (PZ + k ∙ PW ) − [nW ∙ (k ∙ G)] = (18,158) and then maps the plaintext point PZ = (18,158) back into the original plaintext message M [5].

4Q =

4.

AUDIO FILE FORMAT

The purpose of this chapter is to build a cryptosystem based on elliptic curves to secure the transmission of voice messages. We use a common format of audio file, the Waveform Audio File Format (WAVE) [6][10]. The WAVE file format is a subset of Microsoft's RIFF specification for the storage of multimedia files. In this section we examine the integral structure of the RIFF file upon which will be applied encryption and decryption. A RIFF file starts out with a file header followed by a sequence of data chunks (cf. figure 1). A WAVE file is often just a RIFF file with a single "WAVE" chunk which consists of two sub-chunks -- a "fmt" chunk specifying the data format and a "data" chunk containing the actual sample data. The Figure 1 clearly shows that the actual data is stored after the 44-th byte and for illustrative purposes in our implementation we will encrypt only the part of actual data which is stored from the 45-th byte till the end of the file. Although the headers are left in clear, playing such a file produces a meaningless noise.

#. Using Elliptic Curve Encryption and Decryption for Securing Audio Messages The Canonical WAVE file format

4 8 12 16 20 22 24 28 32 34 36 40

Field name

Field size (bytes)

ChunkID

4

ChunkSize

4

Format

4

Subchunk1ID

4

Subchunk1Size

4

AudioFormat

2

NumChannels

2

SampleRate

4

ByteRate

4

BlockAlign

2

BitsPerSample

2

Subchunk2ID

4

Subchunk2Size

4

Data

Subchunk2Size

File offset (bytes) 0

44

9

The “RIFF” chunk descriptor The format of concern here is “WAVE”, which requires two sub-chunks: “fmt” and “data”.

The “fmt” sub-chunk Describes the format of the sound information in the data sub-chunk.

The “data” chunk descriptor Indicates the size of the sound information and contains the raw sound data.

Figure #-1. The structure of .wav file format

5.

IMPLEMENTATION

This section presents a tool that implements elliptic curve cryptography for encrypting an audio file, transmitting it through the network and decrypting the file at the other end. The figure 2 shows the interface that allows to experiment with the tool. It allows the user to define a private key, calculates the corresponding public key and allows sending the public key to the other communicating end. The user may record audio sequences, encrypt them and send the encrypted file. At the receiving end, the application decrypts and plays the audio data.

10

Chapter #

Figure #-2. System interface

5.1

Encryption of voice messages

The voice message is read and its bytes are stored in the array Ori[](Figure 3). The array then is split into two other arrays where the first array Header[] contains the first 44 bytes which represent the header bytes, while the second array WavData[] contains the following bytes which represent the actual data of the voice. Original message

The original message in byte array

*.wav

Encrypted message

The encrypted message in byte array

Ori[]

Header[] 44 byte

*.wav

Enc[]

WavData[] actual voice

MapX[] x coordinates

MapY[] y coordinates

EncX[]

EWavData[] encrypted voice

EncY[]

(kG) (PM + kPB ) Public key

Figure #-3. Encryption process

Header[] won’t be encrypted in order to enable playing the encrypted file. The bytes from WavData[] will be mapped into corresponding points of the elliptic curve and stored in the arrays MapX[] and MapY[].

#. Using Elliptic Curve Encryption and Decryption for Securing Audio Messages

11

The encryption algorithm described in section 3 is applied upon the stored points in the arrays MapX[] and MapY[]. The encrypted points are stored in the arrays EncX[] and EncY[]. The points from EncX[] and EncY[] are mapped back into the corresponding bytes and stored into the array EWavData[]. Header[] and EWavData[] are merged into Enc[] and the content is written in a .wav file. The file represents the encrypted message which plays a meaningless noise, and this way could be securely transmitted through the network.

5.2

Decryption of voice messages

The encrypted voice message is read and its bytes are stored in the array Enc[](Figure 4). The array then is split into two other arrays where the first array Header[] contains the first 44 bytes which represent the header bytes, while the second array EWavData[] contains the following bytes which represent the actual data of the encrypted voice. Encrypted message

The encryped message in byte array

*.wav

Decrypted / original message

The decrypted / original message in byte array

Enc[]

Header[] 44 byte

Dec[]

EWavData[] encrypted voice

MapX[] x coordinates

MapY[] y coordinates

DecX[] (PM + kPB )

*.wav

WavData[] actual voice

DecY[]

(PM + kPB )

Figure #-4. Decryption process

Header[] won’t be decrypted since it represents the original header. The bytes from EWavData[] are mapped into corresponding points of the elliptic curve and stored in the arrays MapX[] and MapY[]. The decryption algorithm described in section 3 is applied upon the stored points in the arrays MapX[] and MapY[]. The decrypted points are stored in the arrays DecX[] and DecY[]. The points from DecX[] and DecY[] are mapped back into the corresponding bytes and stored into the array WavData[].

12

Chapter #

Header[] and WavData[] are merged into Dec[] and the content is written in a .wav file. The file represents the decrypted message which plays the original audio.

5.3

Transmission of voice messages

Transmission of messages is done using standard network protocols. The main path of the system operation is illustrated as follows: Select endpoint IP address

Generator point is selected

Record voice message

Send public key

Encrypt the voice message

Choose a private key

Calculate public key

Send the encrypted message

Figure #-5. System main path operation

To make the system more stable, during transmission of the encrypted voice message, public data related to the message can also be transmitted, which gives flexibility in changing and exchanging keys.

Person A

Person B

Sends the received B’s public key

Sends the received B’s public key

Sends his public key

Sends his public key

Sends the encrypted message

Sends the encrypted message

Transmission instance Header Size

Actual data Data

Figure #-6. Message transmission

The transmission is done in three instances (Figure 6). Every instance consists of two parts: header (the size of the instance being transmitted) and

#. Using Elliptic Curve Encryption and Decryption for Securing Audio Messages

13

the actual data. The size of the message is merged to ensure that all the data is received by the receiver.

5.4

Data Organization

The implemented system stores the audio messages in separate files. The figure 6 shows the overall organization of data used by our system. 1

2

eccVtData

eccVtDataBackup

1.1

1.2

Mymessagess

SPK.ecc

1.1.1

1.1.2

Original 1.1.1.1

Encrypted

1.3

Receivedmessagess 1.2.1

Newmessagess

1.1.2.1

Koha.ecc 1.1.1.2

Ori_*.wav

Enc_*.wav

Decrypted

1.2.3

Keys.ecc 1.1.2.2

1.2.2

Keys.ecc 1.2.1.1

Enc_*.wav

1.2.2.2

Dec_*.wav

Figure #-7. Data organization

Files of type .ecc are files in which are stored voice message details such as: recording time, encryption and decryption keys, transmission time, and similar information.

6.

CONCLUSION AND FUTURE WORK

In this paper we have proposed and implemented a cryptosystem based on elliptic curve cryptography, intended to provide secure transmission of audio messages between communicating parties. This method of encryption is faster than RSA and thus it is more suitable for encrypting bigger amounts of data, as is the case with audio files. The advantage of elliptic curves relies in the fact that using a smaller-length key results in a stronger encryption compared to RSA encryption. Using a similar approach, one can use elliptic curves for encryption of other types of data like image, video, text. Considering the prospect of elliptic curves in terms of cryptosystems, there remain to work on optimizing the provided solution and adapt it for

14

Chapter #

an implementation which will enable secure real time mobile communication with dynamic exchange of user-generated private keys.

REFERENCES 4.

5.

6. 7.

8. 9. 10. 11.

12.

13. 14. 15.

Shoewu, O., and Segun O. Olatinwo. Securing Text Messages using Elliptic Curve Cryptography and Orthogonal Frequency Division Multiplexing. In Pacific Journal of Science and Technology, vol. 14, nr. 2, November 2013, pp. 220-227. N. Gura, A. Patel, A. Wander, H. Eberle, and S. C. Shantz. Comparing Elliptic Curve Cryptography and RSA on 8-bit CPUs. Boston, Massachusetts: 6th International Workshop on Cryptographic Hardware and Embedded Systems, August 2004. D. Hankerson, A. Menezes, S. Vanstone. Guide to Elliptic Curve Cryptograph. SpringerVerlag New York, Inc. 2004. ISBN 0-387-95273-X. Boneh, D., & Franklin, M. (2001, January). Identity-based encryption from the Weil pairing. In Advances in Cryptology—CRYPTO 2001 (pp. 213-229). Springer Berlin Heidelberg. W. Stallings Cryptography and Network Security: Principles and Practices, 2003 :Prentice-Hall Microsoft Corporation (June 1998). "WAVE and AVI Codec Registries - RFC 2361". IETF. Retrieved 2013-12-15. http://tools.ietf.org/html/rfc2361 Diffie, W., and Hellman, M. New directions in cryptography. IEEE Trans. Inform. Theory IT-22, 6 (Nov. 1976), 644-654. Blake, I., Seroussi, G., Smart, N.: Advances in Elliptic Curve Cryptography. London Mathematical Society Lecture Note Series, vol. 317. Cambridge University Press, Cambridge (2005) Artan Luma and Lirim Ameti. ECC Secured Voice Transmitter. Lecture Notes in Engineering and Computer Science: Proceedings of The World Congress on Engineering 2014, WCE 2014, 2-4 July, 2014, London, U.K., pp. 488-491. Library of Congress (2008-09-12). WAVE. Waveform Audio File Format. Retrieved 2013-12-15. http://www.digitalpreservation.gov/formats/fdd/fdd000001.shtml R. L. Rivest, A. Shamir, and L. Adleman. A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM, February 1978, pp. 120-126. Koblitz, N., Menezes, A., & Vanstone, S. The state of elliptic curve cryptography. In Towards a Quarter-Century of Public Key Cryptography, 2000, Springer US, pp. 103123.

Suggest Documents