A new algorithm for signed binary representation and application in mobile phones

Abstract: Cryptographic protocols become a requirement for many software applications and communication. Therefore, understanding of such protocols is more essential in order to improve them mathematically and in software implementations. Elliptic curve cryptography is one of these protocol, which are highly used nowadays especially in mobile devices due to its small key size and good security level. Despite of these advantages, it is considered as slower than other cryptosystems with the same key size and this revert to the most important operation the scalar multiplication. In this work, we aimed to reduce the computation of this operation by proposing an algorithm considered as faster in comparing to other efficient methods. This algorithm is implemented in mobile device to prove its efficiency.


Introduction
For the computational environment with limited memory such as, mobile devices, wireless sensor nod, etc. The cryptosystem is used as a center part to ensure the security of such wireless communication Elliptic curve cryptography was proved to be more secure than many other cryptosystems such as, RSA AlGamal, when they used the same key size. The most important operation in elliptic curve is the scalar multiplication, it is the operation to compute , where are points on the elliptic curve and r is any positive integer. The use of binary expansion to represent r such that r= is considered as the most common way. Here, rs is an element of a finite digit set Dk. In literature, several methods are proposed to achieve a perfect representation that helps to enhance the performance of ECC and speeding up the scalar multiplication operation. Some of them are based on reducing of the Hamming weight, such as, the recording method []. Some other are based on window representation, which are considered as a generalization of the recoding methods, for example, nonadjacent form (NAF) and Window NAF [9][10][11], mutual opposite form (MOF) and Window MOF [12], and Window fractional methods [13,14].
The complexity of the scalar multiplication operation is also improved by introducing fast composite methods [2,15] as well as, using of coordinates systems instead of affine coordinates [16,17]. It also speeds up through precomputations techniques [18][19][20][21][22]. Some other different approach was through utilizing of customized hardware [23][24][25]. The representation of r is not only limited to binary expansion, it was also represented in large radix. Another method for representing r is known as double base number system (DBNS) [], it is used to improve the performance of scalar multiplication. Combining software together is also helps to improve the scalar operation of EC, this was obvious from the efficiency of EC single scalar multiplication when combining of the optimal methods to solve EC problems. The operations on EC are two types, one is basic and the other is composite as shown in Table 1 [1,[5][6][7][8]. In this paper, we aimed to enhance the EC scalar multiplication by proposing of an efficient algorithm for this purpose, and compare it with other binary representation methods to prove its efficiency.

Preliminaries
This section presents an overview of the material used in this work, for more details and some background in cryptography; we refer the reader to see [22][23][24].
Where, the coefficients F and the discriminant of E is 0.
The discriminant of E given in (1) is defined by;  Let L be an arbitrary extension of F, the set of all points on E is given by: where, is called the point at infinity.
The expression of the Weierstrass equation given in (1) for elliptic curve over the prime field can be simplified as follows: (

)
R and = 4 [19].  where, and λ is the slope of the line L that connecting the points such that: If we have two similar points then its addition operation with itself is defined as = ( ) = 2 E ). It is computed as follows: The inverse of the point ) is defined as ).

Definition 2.3:
The hamming weight of the scalar k is the number of non-zero bits in the signed binary representation, it is denoted by h (k).

The Previous work
The binary representation length of the scalar k and its number of 1's are controlling the efficiency and the cost of the ECSM. There has been extensive research toward achieving of an efficient representation for k. From literature, some of the existing well-known methods are presenting in this section.

Binary method:
The simplest method to represent an integer in (0, 1) bits is called the binary representation. It is To represent the integer k in MOF we follow:
The binary representation has 10 hamming weights and the complementary recoding has 5 hamming weights which saves 5 point addition operation in scalar multiplication.

Non Adjacent Form (NAF)
A non-adjacent form (NAF) proposed in 1951, by Booth [17]. NAF has an optimal traditional a End while

Return
The average number of hamming weight (non-zero bits) in this representation is equal to its length divided by three ( ).
Example 3: Let us take k = 35 to describe the application of algorithm 5 as shown in Table 3.   2. The scalar k is < k < if l (NAF (k)) = l.

Direct Recoding Method (DRM)
A new procedure is called Direct Recoding Method [20] for converting the scalar k into a signed

The Proposed Algorithm
In this section, a new signed binary representation of integers going to present. We introduce the following special algorithm of signed binary representation in order to achieve a unique representation. After implementing this algorithm for every integer, we found that, its output representation is same as MOF representation.

Algorithm 4: Assigned binary representation of a scalar k
Input: A scalar is appositive integer.

Return .
Example 4.1: Initializing the above algorithm for computation the integer k=127 to generate the assigned binary representation k= (1 0 0 0 0 0 0 -1). The expression of this integer k=127 in binary representation is k= (1 1 1 1 1 1 1). The number of the hamming weight that generating by the proposed algorithm is reduced to 2, compared with the binary representation that has 7 hamming weight.

Complexity of the Proposed Algorithm
All traditional algorithms, such as MOF, CRM, DRM and NAF are compared with our proposed algorithm according to the run time for generating the assigned binary representation. Using numbers of the different sizes (bits) are listed in Table 4 to show the run time in seconds. Based on our analysis which is shown in the previous Table 4, the running time computation in the proposed algorithm to generate the assigned binary representation is the least in comparison with the others methods as shown in Figure 3.

Implementation of the Proposed ECC in Mobile Phones with Android OS
The ECC is an efficient cryptosystem with a simple mathematical conclusion and small key size in comparison to other public key cryptosystem. These facilities granted it advantages to be used for securing data in small devices like mobile phones. The proposed ECC that implemented in the previous section is applied on mobile phone with Android Operating System and using Java language programming.

Implementation and Analysis
In this section, the screenshots of the results obtained from the program are depicted. This program implemented by visual basic.net 2013. Due to successful run of the program, the data can be securely transmitted from one device to another in a wireless transfer, such as Bluetooth, Wi-Fi etc.
The program is run on windows platform. This interface is designed to check the number whether it is a prime or not.   Table 5:

MOH-ECC Application
A new application is designed using Java code through Android studio which is a programming language used to build application working in mobile devices. We called this application MOH-ECC, it can be installed on any mobile device working under Android operating system. Figure 8 shows screen shoots for the main window of the proposed Android application that used to encrypt and decrypt text message in English language. It has an easy to use interface that shows how to encrypt an input text message and shows the encrypt text, it also contains another button for the decryption process. Also, there is a button used to calculate the processing time for each operation.

Conclusions
In ECC, the scalar multiplication is the most important operation, while, it is the most expansive operation due to the consuming of time implementation. The speed improvement is a challenge that many researcher try to reach it. The performance of the scalar multiplication is mainly based on the representation of the scalar. In our work, we design and implement a new efficient algorithm called the nested algorithm, which is combined the elliptic curve scalar multiplication and a signed binary representation MOF algorithm. The running time of the nested algorithm has been reduced compared with ECSM based on MOF representation according to the result.
According to the experiment, it is obvious that, the computational time is reduced in comparison to other ECSM methods with the same key size. Also, after applying of the proposed algorithm to build new EC cryptosystem of this system is efficient and can be used in any mobile device working under Android system. It is easy to install and support both common language in our country (Arabic and English). Using large key sizes, we notice that, the computational time for the proposed cryptosystem is acceptable.

Conflict of Interests
The authors declare that there is no conflict of interests.