International Journal of Theoretical & Applied Sciences, 12(1): 37-42(2020)

ISSN No. (Print): 0975-1718 ISSN No. (Online): 2249-3247 Digital Signatures using RSA Public Scheme Arun Kumar Sharma 1 and Nikhlesh Kumar Badoga 2 1Department of Computer Science & Engineering, NIT Hamirpur, . 2Department of Computer Science & Engineering, Thapar Institute of Engineering and Technology, India. (Corresponding author: Arun Kumar Sharma) (Received 07 April, 2020, accepted 22 June, 2020) (Published by Research Trend, Website: www.researchtrend.net) ABSTRACT: In the era which pertains mainly to information technology, the data travels through various communication channels that are insecure. Security issues of such data are very important. During communication over any network the issues of confidentiality, integrity and authenticity of data arise. The confidentiality is ensured by the methods of whereas the various techniques of digital signatures are used to ensure integrity and authenticity of data. The security issues regarding e-commerce, e-mail, banking, ATM etc. are addressed by the techniques of cryptography. Here, we discuss in detail the RSA public key cryptosystem and the digital signatures using the RSA technique. Further, we explain the digital signature scheme using RSA with the help of an illustration. Keywords: Cryptosystem, Digital Signature, Public Key, , Decryption, Confidentiality, Authenticity, Integrity. signature. Legal status has now been achieved by Digital I. INTRODUCTION signatures. In 1976, Whilfield Diffie and first time RSA Cryptosystem: describe the concept of digital signature, [3, 6, 7, 9, 11, , and Len Adleman at MIT made 13, 19]. The electronic documents are signed using many attempts during entire year in order to create a Digital Signature. Digital signature have similar one-way function which is difficult to inverse, Rivest properties to handwritten signature. Handwritten and Shamir, as computer scientists, proposed a variety of signature are called conventional signature. A potential functions while Adleman, being a mathematic “conventional” signature which is attached to a can, developed first major asymmetric key cryptography document, associates the responsibility of person system and the final result was published in 1978,which pertaining to the signature. A signature is used very is known as RSA cryptosystem. It solves the problem of frequently in everyday life. For example writing a letter, key agreements and distributions, [1, 2, 4, 5, 8, 10, 12, signing a contract, withdrawing money from a bank etc. 15, 17, 18, 20, 21]. In other words, a verified signature on a document, is a The RSA cryptosystem is the most popular and proven sign of , which tells that the document is asymmetric key cryptographic cryptosystem. authentic. Implementation of RSA Cryptosystem: Electronic documents need to be duly signed in most The RSA Cryptosystem involves mainly three steps: situations. For example, electronic bank transactions, Key-Generation , Encryption and Decryption , which electronic contracts and binding electronic mail. The are discussed below. receiver needs to ensure that the message is only from 1) RSA : RSA Cryptosystem uses a the intended recipient and not the third person. In order public key. The message is encrypted with the help of to find required information filtering is utmost essential, public key and is known to everyone. The encryption of see [14, 16]. Electronically signing the message plays a message which is done with the help of public key can be vital role in ensuring the correct sender. In other words, decrypted only using the private key. The keysto be used the authenticity of the sender can be verified or proved for RSA are created using following steps: with the help of . This type of 1. Choose two large prime, , of equal size signature is referred to as Digital Signature. approximately so that the product = × is of In the present era of web-commerce Digital signatures 1024 bits. are of great importance. The provisions have been 2. Calculate = × = − 1 − 1. already made for valid authorization procedure in order 3. Choose an integer ,1< < , so that gcd ( to recognize a Digital Signature similar topaper-based , = 1. Sharma & Badoga International Journal of Theoretical & Applied Sciences, 12 (1): 37-42(2020) 37

4. Calculate the secret exponent , such that ≡ (iv) Selecting signing key , such that gcd( , ) = 1, 1 . 1 < < .

5. The public key is , and the private key is (v) Now we find , such that

, .All the values , , and are kept secret.

(i) is called as the modulus. ≡

(ii) is called as the public exponent or exponent or 1 . encryption exponent. Therefore, the public key is the pair ( , , and private

(iii) is called as the decryption exponent or secret key is ‘ ’. exponent. (I) Singing of RSA Digital Signature: We 2) RSA Encryption: The message is sent to Bob by explain how Alice signs the message .The private Alice using his public key and the private key is key is used by Alice to create a signature of the message kept secret. Bob receives the message which comes as follows: from Alice. The size of the message () must be ≡ , where = 0,1,2, … − 1 less then < . If the message (Plaintext) is large and sends the message (encrypted as ≡ then , it should be divided in blocks. After that and signature toBob. Alice sends message to Bob using public key of which is announced publicly. Steps performed by Sender A :

1. The public key , of the B’s is obtained. 2. The plaintext message is represented as a positive integer .

3. The text ≡ is calculated. 4. The cipher text is sent from C to B. 3) RSA Decryption: Bob receives the message which comes from Alice and Bob uses his private key to decrypt the cipher text message received. Steps performed by Recipient B :

1) The private key , is used to calculate ≡ . 2) The plaintext is extracted from the message representative . Fig. 2. Signing RSA Digital Signature. The whole process of encryption and decryption in cryptography is shown in the following diagram: II. VERIFYING OF RSA DIGITAL SIGNATURE Bob wants to verify the signature ′′. Both and are received by Bob.The copy of message is created by Bob by applying the public key of Alice to signature as follows:

≡ and the value of is compared with the value by Bob. The message is accepted by Bob if these two are

equal. Fig. 1. RSA Encryption and Decryption. (I) RSA Digital Signature: Algorithm: Key Generation : The following algorithm discusses the key generation of RSA digital signatures.

(i) Choose two large prime number and such that . (ii) Now, we find the product of and such that = × . (iii) Now, we calculate = − 1 − 1. Fig: 3. Verifying RSA Digital Signature Scheme.

Sharma & Badoga International Journal of Theoretical & Applied Sciences, 12 (1): 37-42(2020) 38

Verification Criteria: • The message digest of the source information is used Since, ≡ . for deriving the signature. The process to be followed Therefore, for deriving the message digest need to exactly same, ≡ using an identical set of data. becomes • The methods through which the representative ≡ . integers can be derived are different for both signing This gives and encryption. , ≡ III. ILLUSTRATION that is Now we shall explain the RSA digital signature with the = [because ≡ 1 ]. help of following example. The following diagram shows the digital signature Let us take the message “MATHEMATICS”. scheme: STEP 1. Key Generation Let us choose the prime numbers = 47 , = 59 . Therefore, the product of and is = = 4759 = 2773 . Now using Euler’s totient function, we get = = = − 1 − 1. This implies Fig. 4. Digital signature scheme. 2773 = 47 − 159 − 1 Practical Applications: = 4658 = 2668 . (i) The primes and will be considered of equal Now we choose ‘ ’ such that 1 < < and length in bits. gcd , = 1. (ii) Most used practical choices for are and 3, 17 gcd , = 1. . These are called as Fermat primes, 655372 + 1 Let us select = 17 such that 1 < 17 < 2668 and also rarely referred to as respectively. , and gcd (2668, 17) = 1. The operation of modular exponentiation is made faster Now we calculate such that by choosing them. After choosing , it is easier to check ≡ 1 . whether ,−1 = 1 and , − 1 = 1 That is while the primes are being tested and generated in step 1. 17 ≡ 2668 . Values of and that are not able to pass in the test This gives can be reflected instantly. = 157. To calculate the value of , we make use of Extended STEP 2. Conversion of the English Message into the Euclidean Algorithm for computing ≡ , Numerical Values Now we shall write the numerical value of the message also written as ≡ . This is known as “MATHEMATICS” by using the following table: modular inversion. This is not an integer division. The modular inverse is defined as the integer value such Table 1: Representation of Alphabetic and that ≡ 1 . It only exists if and Numerical Value. have no common factors. Alpha (iii) Decryption is similar to signing as far as domain betical A B C D E F G H I J K L M of mathematics is concerned since private key is used by value Numer both of them. Similarly, the same mathematical 0 0 0 0 0 0 0 0 0 0 1 1 1 ical operation is used by both encryption and verification 0 1 2 3 4 5 6 7 8 9 0 1 2 value involving the use of public key. That is, mathematically, Alpha for < betical N O P Q R S T U V W X Y Z value Numer 1 1 1 1 1 1 1 2 2 2 2 2 2 ≡ ical 3 4 5 6 7 8 9 0 1 2 3 4 5 ≡ . value

However, following significant differences of implementation are to be kept in mind:

Sharma & Badoga International Journal of Theoretical & Applied Sciences, 12 (1): 37-42(2020) 39

The numerical value of the message Now “MATHEMATICS” is 1200 1200 ≡ 1414 × 1200 2773 . . This implies We add slack variable “A” to make pair message 1200 ≡ 2497 2773. “MATHEMATICSA” and its numerical value is Therefore, the value of signature for the message packet is = 1200 1907 0412 0019 0802 1800 (say). = = 2497. STEP 3. Signing Process Now we shall take the next pair of the message . We apply the signing algorithm to the message pairs and Thus we have , = 1907 = 157, = find the signature ‘S’ from the message. 2773. We start with message packet , thus we have Therefore, = 1200, = 157, = 2773. ≡ Therefore, becomes ≡ . ≡ 1907 2773 . That is This gives ≡ 1200 2773 . = 0239. Since Now we shall take the third pair to find its equivalent 1200 ≡ 813 2773 . signature value. Thus we have Therefore, , = 0412 = 157, = 2773. 1200 ≡ 813 × 813 2773 , Therefore, this implies ≡ 1200 ≡ 995 2773 . becomes Now ≡ 0412 2773 . 1200 ≡ 995 × 995 2773 This gives gives = 0707. 1200 ≡ 64 2773 . Further, we have the fourth pair of the message to obtain Therefore, its signature value. Thus we have , 1200 ≡ 64 × 64 2773, = 0019 = 157, = 2773. which gives Therefore, 1200 ≡ 1323 2773 . ≡ Now becomes 1200 ≡ 1323 × 1323 2773, ≡ 0019 2773 . which gives This gives 1200 ≡ 566 2773 . S4=1537 Therefore, Now we consider the fifth pair for its equivalent 1200 ≡ 566 × 566 2773 , signature value. Thus we have which gives , = 0802 = 157, = 2773. 1200 ≡ 1461 2773 . Therefore, Now ≡ 1200 ≡ 1461 × 1461 2773 , becomes which gives ≡ 0802 2773 . 1200 ≡ 2084 2773 . This gives Therefore = 0723. 1200 1200 Further, we take the last pair of the message to obtain its ≡ 2084 × 1323 2773 corresponding signature value. Thus we have gives , = 1800 = 157, = 2773. 1200 ≡ 770 2773 . Therefore, Now ≡ 1200 1200 ≡ 770 × 64 2773 becomes gives ≡ 1800 2773 . 1200 ≡ 2139 2773 . This gives Therefore = 0741. 1200 1200 ≡ 2139 × 995 2773 Now we shall show the signature of different packet of gives the message in the following table 1200 ≡ 1414 2773 .

Sharma & Badoga International Journal of Theoretical & Applied Sciences, 12 (1): 37-42(2020) 40

Now we take the second pair to verifying the message. Thus, we have Table 2: Representation of Signature. = 239, = 17, = 2773. Therefore, Message Corresponding Private ModulusValue f Packet Signature ≡ Key Value Packets Value becomes . ≡ 0239 2773 157 2773 = 2497 = 1200 which gives . 157 2773 = 1907 = 0239 Now we consider the third pair of the signature to = 1907 verify the message. Thus, we have 157 2773 = 0707 = 0412 = 0707, = 17, = 2773 Therefore, 157 2773 = 1537 = 0019 ≡ 157 2773 becomes = 0723 = 0802 ≡ 0707 2773 . 157 2773 This gives = 0741 = 1800 . = 0412 Hence, we get signature Now we shall obtain the message of the fourth = 2497 0239 0707 1537 0723 0741 signature packets. Thus, we have from the message. = 1537, = 17, = 2773 STEP 4. Verifying Process Therefore, Now the receiver will verify the obtain signature string ≡ of numerical values. becomes The receiver has the signature string as follows ≡ 1537 2773 . = 2497 0239 0707 1537 0723 0741 This gives . . = = 0019 We start with the first packet of signature . Thus we Further, we take the next pair of signature to obtain its have equivalent original message. Thus, we have

= 2497, = 17, = 2773. = 0723, = 17, = 2773

Therefore, Therefore, ≡ ≡ becomes becomes ≡ 0723 2773 . ≡ 2497 2773 . This gives Since . = 0802 2497 ≡ 1305 2773 . Now we verify the final packet of the signature. Here, we Therefore have 2497 ≡ 1305 × 1305 2773 = 0741, = 17, = 2773. gives Therefore, . 2497 ≡ 403 2773 ≡ Now becomes 2497 ≡ 403 × 403 2773 ≡ 0741 2773 . gives This gives . . 2497 ≡ 1575 2773 = 1800 Now The values obtain of the message packets for the 2497 ≡ 1575 × 1575 2773 , corresponding signatures packets is shown in the which gives following table. . 2497 ≡ 1563 2773 Table 3: Representation of Original Message. Therefore Signature Public Corresponding 2497 2497 ≡ 1563 × 2497 2773 Modulus Packets Key Message Packets gives Value Value Value Value 2497 ≡ 1200 2773. 17 2773 Thus the value of = 2497 = 1200 17 2773 . = 0239 = 1907 = 1200 17 2773 = 0707 = 0412 Sharma & Badoga International Journal of Theoretical & Applied Sciences, 12 (1): 37-42(2020) 41

17 2773 = 1537 = 0019 [8]. Lipton, S. M., & Matyas, S. M. (1978). Making the 17 2773 = 0723 = 0802 digital signature legal--and safeguarded. Data 17 2773 = 0741 = 1800 Communications , 7, 41-52. [9]. Menezes, A. J., Van Oorschot, P. C., & Vanstone, S. Hence, we get a message A. (2018). Handbook of applied cryptography . CRC . press. which is same as the numerical value of the original [10]. Potter, R. J. (1977). Electronic mail. Science , message 195(4283), 1160-1164. “MATHEMATICS”. [11]. Preneel, B., Govaerts, R., & Vandewalle, J. Therefore, the message has been verified by the digital (1989). Cryptographically secure hash functions: an signature. overview . In: ESAT Internal Report, KU Leuven. IV. CONCLUSION [12]. Rivest, R. L., Shamir, A., & Adleman, L. (1978). A method for obtaining digital signatures and public-key In the present scenario we discussed the RSA . Communications of the ACM , 21 (2), Cryptosystem and the Digital Signature schemes. The 120-126. RSA public key cryptosystem is more useful for the [3]. Schneier, B., & Kelsey, J. (1998, January). digital signatures scheme. Further, we explained the Cryptographic support for secure logs on untrusted digital signature scheme and mathematical structure of machines. In USENIX Security Symposium (Vol. 98, pp. RSA. 53-62). REFERENCES [14]. Sharma, A. K. (2018). Content-Based Filtering in MovieRecommendation. International Journal of [1]. Bakhtiari, S., Safavi-Naini, R., &Pieprzyk, J. Electrical, Electronics and Computer Engineering , 7(2): (1995). Cryptographic hash functions: A survey (Vol. 106-109. 4). Technical Report 95-09, Department of Computer [15]. Sharma, A. K. (2019). Design and Mathematical Science, University of Wollongong. Structure of Cryptographic Hash Function SHA-512. [2]. Brickell, E. F. (1989, August). A survey of hardware International Journal of Theoretical & Applied implementations of RSA. In Conference on the Theory Sciences, 11 (2): 41-47. and Application of Cryptology (pp. 368-370). Springer, [16]. Sharma, A. K. (2019). Safety Application in New York, NY. Android. International Journal on Emerging [3]. Buchmann, J. A., Karatsiolis, E., &Wiesmaier, A. Technologies, 10 (1): 234-238. (2013). Introduction to public key infrastructures. [17]. Sobti, R., & Geetha, G. (2012). Cryptographic hash Springer Science & Business Media. functions: a review. International Journal of Computer [4]. Davida, G. I. (1982). Chosen signature Science Issues (IJCSI) , 9(2), 461. of the RSA (MIT) public key cryptosystem . [18]. Stallings, W. (2006). Cryptography and network Department of Electrical and Computer Science, College security, 4/E . Pearson Education India. of Engineering and Applied Science, University of [19]. Stinson, D. R., & Paterson, M. (2018). Wisc. Cryptography: Theory and practice. CRC press. [5]. Diffie, W., & Hellman, M. (1976). New directions in [20]. Stinson, D. R. (2006). Some observations on the cryptography. IEEE transactions on Information theory of cryptographic hash functions. Designs, codes Theory , 22 (6), 644-654. and Cryptography, 38 (2), 259-277. [6]. Forouzan, B. A., & Mukhopadhyay, D. [21]. Trappe, W. (2006). Introduction to cryptography (2015). Cryptography and network security . Mc Graw with coding theory . Pearson Education India. Hill Education (India) Private Limited. [7]. Koblitz, N. (1994). A course in number theory and cryptography (Vol. 114). Springer Science & Business Media.

Sharma & Badoga International Journal of Theoretical & Applied Sciences, 12 (1): 37-42(2020) 42