Joint operation in public key cryptography

We believe that there is no real data protection without our own tools. Therefore, our permanent aim is to have more of our own codes. In order to achieve that, it is necessary that a lot of young researchers become interested in cryptography. We believe that the encoding of cryptographic algorithms is an important step in that direction, and it is the main reason why in this paper we present a software implementation of finding the inverse element, the operation which is essentially related to both ECC (Elliptic Curve Cryptography) and the RSA schemes of digital signature.


I. INTRODUCTION
It has already been mentioned that we believe the best protection is achieved by developing our own software. However, this process requires a lot of knowledge, skills, patience and great responsibilities [7], provided that the undisputed cryptic of cryptography itself was previously overcome and that there are courage and willingness to enter more deeply into the matter.
In this paper we want to show that it is possible to implement the inverse element without any softwarehardware facilities (in the arithmetic of large numbers), which is a very important operation in the process of realization of both leading schemes of a public key -ECC and RSA [1] [4] [6].

II. TASK AND AIM
In the arguments for and against in a trial of strength of ECC and RSA, the simple fact that they are performed by the same tools made for operations with large numbers, is usually overlooked. Mathematical bases of RSA and ECC are completely different [1] [5], but they need the same operations: addition, subtraction, multiplication, division, finding the remainder, calculating d from the equation e*d ≡ 1 (mod p) for fixed values of e and p, and more joint auxiliary operations needed for the realization of a digital signature.
When it comes to joint operations, we have opted for finding the inverse element. Therefore, we will present a brief review of the RSA and ECC and point out those steps in algorithms in which it is necessary to calculate the inverse element.
A. Algorithm Key Generation for the RSA Signature Scheme As we can see, for the given public key e and the number ɸ, d should be calculated from the equation in order to get e private key -the most important element of the RSA digital signature scheme, or, in other words, we should find the inverse element of the element e. Sumary: each entity creates an RSA public key and a corresponding private key. Each entity A should do the following [1]: 1. Generate two large distinct random primes p and q, each roughly the same size (see x11.3.2). 2. Compute n = pq and = (p − 1)(q − 1). 3. Select a random integer e, 1 < e <  such that gcd(e, ) = 1. 4. Use the extended Euclidean algorithm ( [2]) to compute the unique integer d, 1 < d < , such that ed 1 (mod ) 5. A's public key is (n; e); A's private key is d As we can see for a given public key e and modulo , we have to find inverse element d-secret key-for RSA digital signature. So, finding the inverse element is very important stage the RSA signature scheme.

B. The shortest of the ECC
Efficient and secure public-key cryptosystems are essential in today's age of rapidly growing Internet communications. Elliptic curve scalar multiplication in particular, which refers to the operation of multiplying a large integer by a point on an elliptic curve, is crucial for both data encryption technology as well as testing the security of cryptographic systems. [5] In reality it's very hard to find k (large number) that k*P=Q where P and Q are given points on an Eliptic curve.(P, Q are public keys, and k is private or secret key) Practicaly we have to solve P+P and P+Q to get thrid point R=P+P or R=P+Q.
To put it simply, in the field, say F p , where p is prime, for two points P(x p ,y p ), Q(x q ,y q ) on an elliptic curve, using chord-tangent-rule, to give the third elipting curve point R(x r ,y r ).
Coordinates of the third point are calculated by the following formulas: x r = ((y q -y p ) / (x q -x p )) 2 -x p -x q , y r =((y q -y p ) / (x q -x p ))(x p -x r )-y p It is obvious that it is very important to find (x q -x p ) -1

III. CODE FOR FINDING THE INVERSE
ELEMENT In the previous paragraph, we pointed out the place and significance of finding the inverse element of a fixed element in the field Fp, where p is a prime. Since our goals are to avoid the general story and to develop the software that can operate in real conditions (with large numbers), in this paragraph we will present the code by which we can solve the equation ed ≡ 1 (mod ɸ) for (arbitrarily) large fixed number ɸ and the fixed e.

A. The Code for Calculating the Inverse Element -Delphi 7 Console Application
In order to calculate the inverse element, it is necessary to encode Binary extended gcd algorithm. For the fixed inputs e and ɸ, wwe will get the output d, and this will be the solution of the modular equation above. B. The unit that serves the program above (III.A) The program above, together with the unit Unit22, can be run as a Delphi 7 console application