Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 440 https://internationalpubls.com Some Results of Data Encryption and Decryption using Euler’s Totient Function Gobburi Rekha1, V. Srinivas2 1 Department of Humanities and Sciences, Malla Reddy College of Engineering and Technology 2 Department of Mathematics, Osmania university Article History: Received: 10-05-2024 Revised: 20-06-2024 Accepted: 02-07-2024 Abstract: In this paper, we discuss about the Hill Cipher cryptosystem, the RSA public-key cryptosystem, developed by Rivest, Shamir, Adleman for text encoding and decoding. To encrypt and decrypt the message, we use the Euler Phi-function, congruences, and matrix multiplication. Further, we employ two keys for coding and decoding. Introduction: In present, computer networks, internet and mobile communications are important and inevitable part of our society and security of information from hackers is a big task. One of the most widely used applications for information security is Cryptography. Usually in Hill cipher there are two keys, of which one acts as encryption key and the other one acts as decryption key. In this paper we discuss about Hill Cipher using only one key for data encryption and data decryption. Further, we extend our result with dual encryption and decryption process which is explained by using the RSA public key cryptosystem and Hill Cipher and they together execute a powerful cryptosystem to secure the data. Objectives: The purpose of this paper is to obtain and compare the result of data encryption and data decryption using: β€’ A matrix which is invertible. β€’ A matrix which is Involutory. β€’ An RSA cryptosystem which is applied for Hill Cipher where the matrix is Involutory. Methods: Using Hill Cipher and thereafter Hill Cipher - RSA together we have encrypted and decrypted the data under modulo 255. Results: The text message is converted to coded message and then original message is retrieved by using the three different techniques. Conclusions: As the paper involves two stages of encryption and decryption where public key and private key which are unthinkable by the third parities, the security of information is highly appreciable. Keywords: Cryptography, Congruence, Euler-Phi function, Hill Cipher, RSA cryptosystem and matrix, ASCII code. 1. Introduction In present, computer networks, internet and mobile communications are important and inevitable part of our society and security of information from hackers is a big task. One of the most widely used applications for information security is Cryptography. Usually in Hill cipher there are two keys, of which one acts as encryption key and the other one acts as decryption key. In this paper we discuss Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 441 https://internationalpubls.com about Hill Cipher using only one key for data encryption and data decryption. Further, we extend our paper with dual encryption and decryption process which is explained using the RSA public key cryptosystem and Hill Cipher cryptosystem which together execute a powerful cryptosystem technique to secure the data. This paper extends the result of [1] by using involutory matrix for RSA cryptosystem. 2. Standard Definitions Plain Text: The message which is to be converted for the purpose of security. Cipher Text: The message which is in unreadable language. Encryption: Encryption is a form of data security in which information is converted to ciphertext. Decryption: Decryption is the process of converting encrypted data into recognizable information. Hill Cipher: Invented by Lester S. Hill which is a polygrahic substitution cipher based on linear algebra. Involutory Matrix: Any square matrix, A which satisfies the condition 𝐴2 = 𝐼. Linear Congruence: A linear congruence is a congruence relation of the form ax ≑ b (mod m) where a, b, m ∈ 𝑍 +and m > 0. A solution is an integer x which makes the congruence relation true and x is a least residue (mod m) (that is, 0 ≀ x ≀ mβˆ’1). RSA: The Rivest-Shamir-Adleman (RSA) encryption algorithm is an asymmetric encryption algorithm. Asymmetric encryption uses a key pair that is linked to encrypt and decrypt data. A public key is generated and made available to everybody, while the private key is kept confidential and known only to the person who generated the key pair. Euler -Phi function: Euler’s phi (or totient) function of a positive integer n is the number of integers in {1,2, 3..., n} which are relatively prime to n which is denoted βˆ…(𝑛). Let n be the product of two individual primes p and q. Let us define K = (n,p,q,e,d):ed≑1(mod(βˆ…(𝑛)). We define ek(x) ≑ xe(mod n) and dk(y) ≑ ye(mod n) where p, q and d are used as public keys. 3. Methods In this we discuss three different methods for encryption and decryption of the data. Method I: Using Invertible matrix β€’ Let us consider nxn invertible matrix say A in which the matrix A acts as an encryption key and its inverse acts as a decryption key. β€’ Convert the original plain text into numbers using the ASCII values and arrange the numbers in matrix form say P. β€’ Let E≑AP (mod 255). β€’ Now, on converting the numbers in the matrix E into alphabets and symbols we get the encrypted message which is to be sent. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 442 https://internationalpubls.com β€’ To decode the message which is sent by the sender, let us convert the alphabets and symbols in the matrix E into numbers. β€’ Let D ≑ π΄βˆ’1𝐸 (mod 255), we get the original plaintext. Method II: Using Involutory matrix β€’ Now we shall continue the explanation of encrypting and decrypting the data by using an involutory matrix where we use only one key for encryption and the same key for decryption. β€’ Let us consider a nxn involutory matrix say A which acts as an encryption and decryption key. β€’ Convert the plaintext in numbers using the latest ASCII values and arrange the numbers in matrix form say P. β€’ Let E = AP, adjusting the values under modulo 255 we get the encrypted message. β€’ Hence, after converting the numbers in E into symbols under the ASCII values, we get the Cipher text. β€’ To decode the message let us write E in matrix form and multiply by the key A. β€’ Let D = AE. Since, A is an involutory matrix where 𝐴2 = 𝐼 which can also be written as 𝐴 = π΄βˆ’1. β€’ Now, adjusting the values of D under modulo 255 we can retrieve the original text. Method III: Dual encryption and decryption of data using Euler’s totient function in Hill cipher β€’ Let us consider a nxn involutory matrix say A such that 𝐴2 = 𝐼 β€’ Convert the plaintext in numbers using the latest ASCII values and arrange the numbers in matrix form say P. β€’ Let E = AP, adjusting the values under modulo 255 which gives the first stage of encryption. β€’ For further safety purpose let us encrypt E using RSA cryptosystem we define ek(x) ≑ xe(mod n). β€’ To decrypt the message using RSA cryptosystem we define dk(y) ≑ ye(mod n) which gives the first stage of decryption. β€’ Arrange the above decrypted codes in the form a matrix say M and multiply by π΄βˆ’1 we get D. β€’ On adjusting the values of D under modulo 255 we can retrieve the original text. 4. Results To see how the methodology works, let us consider the following illustrations. Illustration I: Let the plaintext to be sent to the receiver by the sender is β€œEstimation”. Using the ASCII values convert the alphabets into numbers β€œ=34, E = 69, s = 115, t = 116, i = 105, m = 109, a =97, t = 116, i = 105, o = 111, n = 110 and” = 34. Encryption: Let P = [ 34 69 115 105 109 97 105 111 110 116 116 34 ]. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 443 https://internationalpubls.com Let A = [ 1 0 βˆ’1 1 βˆ’1 0 βˆ’1 1 βˆ’1 ] be an invertible matrix. Therefore, π΄βˆ’1 = [ 1 0 βˆ’1 1 βˆ’1 0 βˆ’1 1 βˆ’1 ]. Let E = AP. E = [ 1 0 βˆ’1 1 βˆ’1 0 βˆ’1 1 βˆ’1 ] [ 34 69 115 105 109 97 105 111 110 116 116 34 ]. E ≑ [ βˆ’71 βˆ’42 5 βˆ’71 βˆ’40 18 βˆ’34 βˆ’71 βˆ’128 82 0 βˆ’34 ] (mod 255). E =AP = [ 184 213 5 184 215 18 221 184 127 82 0 221 ]. On converting the numbers in matrix E into symbols we get ΒΈΓ•ENQRΒΈΓ—DC2 NULݸDELÝ which acts as the cipher text. Decryption: Let the cipher text be transformed into numbers under the ASCII values. Let E = [ 184 213 5 184 215 18 221 184 127 82 0 221 ]. Now let D = π΄βˆ’1E. D = [ 1 0 βˆ’1 1 βˆ’1 0 βˆ’1 1 βˆ’1 ] [ 184 213 5 184 215 18 221 184 127 82 0 221 ]. D ≑ [ βˆ’221 βˆ’186 βˆ’140 βˆ’405 βˆ’401 βˆ’158 βˆ’405 βˆ’399 βˆ’145 βˆ’139 βˆ’139 βˆ’221 ] ( mod 255). D = [ 34 69 115 105 109 97 105 111 110 116 116 34 ]. The matrix D is same as that of matrix P. Therefore, on converting the numbers of matrix D into alphabets we get the message as β€œEstimation”. Illustration 2: Let the message to be sent is β€œTaste of life” using the ASCII values covert the alphabets into numbers as β€œ= 34, T = 84, a = 97, s = 115, t = 116, e = 101, space = 32, o = 111, f = 102, space = 32, l = 108, I = 105, f = 102, e = 101 and’’=34. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 444 https://internationalpubls.com Encryption: Let P = [ 34 84 97 101 32 111 108 105 102 115 116 102 32 101 34 ] Let A = [ βˆ’5 βˆ’8 0 3 5 0 1 2 βˆ’1 ] be an involutory matrix such that 𝐴2 = 𝐼. 𝐴2 = [ βˆ’5 βˆ’8 0 3 5 0 1 2 βˆ’1 ] [ βˆ’5 βˆ’8 0 3 5 0 1 2 βˆ’1 ] = [ 1 0 0 0 1 0 0 0 1 ]. Therefore E = AD E = [ βˆ’5 βˆ’8 0 3 5 0 1 2 βˆ’1 ] [ 34 84 97 101 32 111 108 105 102 115 116 102 32 101 34 ] E = [ βˆ’978 βˆ’676 βˆ’1373 607 412 846 128 43 217 βˆ’1391 βˆ’836 855 508 218 146 ]. Adjusting the values under modulo 255. E ≑ [ βˆ’978 βˆ’676 βˆ’1373 607 412 846 128 43 217 βˆ’1391 βˆ’836 855 508 218 146 ] (under mod 255). We get E = [ 42 89 157 97 157 81 128 43 217 139 184 90 253 218 146 ]. On converting the numbers in E into alphabets we get *YοΏ½β€ΉΒΈaοΏ½QZý€+Γ™Γšβ€™ Which acts as Cipher text. Decryption: Let the cipher text be transformed again into numbers under the ASCII values. Let E = [ 42 89 157 97 157 81 128 43 217 139 184 90 253 218 146 ]. Now let D = AE. D = [ βˆ’5 βˆ’8 0 3 5 0 1 2 βˆ’1 ] [ 42 89 157 97 157 81 128 43 217 139 184 90 253 218 146 ]. D ≑ [ βˆ’986 βˆ’1701 βˆ’1433 611 1052 876 108 360 102 βˆ’1415 βˆ’2944 867 1817 101 544 ] ( under mod 255). D = [ 34 84 97 101 32 111 108 105 102 115 116 102 32 101 34 ]. On converting the numbers of matrix D into alphabets we get the message as β€œTaste of life”. Illustration3: We continue the result by applying hill cipher and RSA cryptosystem simultaneously. Now let us discuss the illustration which includes dual encryption and decryption of involutory matrix using Euler Totient function. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 445 https://internationalpubls.com Step 1: Let A be a square matrix of order 3x3 which is an involutory matrix. Let A = [ 4 3 3 βˆ’1 0 βˆ’1 βˆ’4 βˆ’4 βˆ’3 ] then A2 = [ 4 3 3 βˆ’1 0 βˆ’1 βˆ’4 βˆ’4 βˆ’3 ] [ 4 3 3 βˆ’1 0 βˆ’1 βˆ’4 βˆ’4 βˆ’3 ] =[ 1 0 0 0 1 0 0 0 1 ]. Step 2: Transform each plaintext into a column vector B by taking the ASCII values. Let us consider the message to be encrypted as Now or Never. P = 78 111 119 32 111 114 32 78 101 118 101 114 which is written in matrix form as P = [ 78 111 119 111 114 32 101 118 101 32 78 114 ]. πŸπ’”π’• stage of encryption Step 3: To encrypt the message, multiply the plaintext matrix P by matrix A to form the matrix E = [AP] (modulo 255). E = AP = [ 4 3 3 βˆ’1 0 βˆ’1 βˆ’4 βˆ’4 βˆ’3 ] [ 78 111 119 111 114 32 101 118 101 32 78 114 ]. E ≑ [ 948 1140 875 βˆ’179 βˆ’229 βˆ’220 βˆ’1059 βˆ’1254 βˆ’907 704 βˆ’146 βˆ’782 ] (mod 255). E = [ 183 120 110 76 26 35 216 21 113 194 109 238 ]. Step 4: For further safety we will code the cipher text E into another text with the help of Euler -Phi function: E = [ 183 120 110 76 26 35 216 21 113 194 109 238 ]. πŸπ’π’… stage of encryption Now we use RSA encoding system in the matrix E E= (183 120 110 194 76 26 35 109 216 21 113 238). For further safety let us consider three primes where N = P *Q* R Let P = 11, Q = 13, R= 17 where N = 2431 Therefore, βˆ…(N) = (P βˆ’ 1) βˆ— (Q βˆ’ 1) βˆ— (R βˆ’ 1). = 10.12.16 =1920. ≑1921 = 113*17. Assume the enciphering proponent to be k then the recapture element the individual integer j fulfilling the congruence kj ≑ 1 mod (βˆ…(N) . Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 446 https://internationalpubls.com Here k = 113 and j = 17 To code N we require each part of N to be an integer less than 2431 Let us find encrypted value for the first element 183 ≑ 183 mod 2431 1834 ≑ 443 mod 2431 1838 ≑ 1769 mod 2431 18316 ≑ 664 mod 243 18332 ≑ 885 mod 2431 18364 ≑ 443 mod 2431 Therefore,183113 ≑ 1509 mod 2431. Now, we find for 120 ≑ 120 mod 2431 1204 ≑ 562 mod 2431 1208 ≑ 2245 mod 2431 12016 ≑ 562 mod 2431 12032 ≑ 2245 mod 2431 12064 ≑ 562 mod 2431 Therefore, 120113 ≑ 1803 mod 2431. Similarly, we get the remaining elements as 110113 ≑ 1419 mod 2431 194113 ≑ 1520 mod 2431 76113 ≑ 1385 mod 2431 26113 ≑ 1131 mod 2431 35113 ≑ 2109 mod 2431 109113 ≑ 109 mod 2431 216113 ≑ 1542 mod 2431 21113 ≑ 21 mod 2431 113113 ≑ 1303 mod 2431 238113 ≑ 816 mod 2431. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 447 https://internationalpubls.com Therefore, the total coded message sent by the sender is: (1509 1803 1419 1520 1385 1131 2109 109 1542 21 1303 816). To decode the coded message the receiver uses RSA cryptosystem. Step 5: Now we will decode the message by using recapture element j = 17. πŸπ’”π’• stage of decryption Now, let us decode the coded values First, we find 1509 ≑ 1509 mod 2431 15092 ≑ 1665 mod 2431 15093 ≑ 1262 mod 2431 15094 ≑ 885 mod 2431 15095 ≑ 846 mod 2431 Therefore,150917 ≑ 183 mod 2431. 1803 ≑ 1803 mod 2431 18032 ≑ 562 mod 2431 18033 ≑ 1990 mod 2431 18034 ≑ 2245 mod 2431 18035 ≑ 120 mod 2431 Therefore, 180317 ≑ 120 mod 2431. Similarly, we get the remaining elements as 141917 ≑ 110 mod 2431 152017 ≑ 194 mod 2431 138517 ≑ 76 mod 2431 113117 ≑ 26 mod 2431 210917 ≑ 35 mod 2431 10917 ≑ 109 mod 2431 154217 ≑ 216 mod 2431 2117 ≑ 21 mod 2431 130317 ≑ 113 mod 2431 81617 ≑ 238 mod 2431 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 448 https://internationalpubls.com Now the decoded message after introducing RSA is M = ( 183 120 110 194 76 26 35 109 216 21 113 238). Step 6: Now, we shall apply the hill cipher cryptosystem for M which is obtained in step 5. πŸπ’π’… stage of decryption Let us write M in the form a matrix. M = [ 183 120 110 76 26 35 216 21 113 194 109 238 ]. Now we can recapture the text by using inverse matrix 𝐷 = π΄βˆ’1𝑀 D = [ 4 3 3 βˆ’1 0 βˆ’1 βˆ’4 βˆ’4 βˆ’3 ] [ 183 120 110 76 26 35 216 21 113 194 109 238 ]. ≑ [ 1608 621 884 βˆ’399 βˆ’141 βˆ’223 βˆ’1684 βˆ’647 βˆ’919 1817 βˆ’432 βˆ’1926 ] (mod 255). = [ 78 111 119 111 114 32 101 118 101 32 78 114 ] which is equal to matrix P. Hence, the total decoded message is P = (28 14 15 23 27 15 18 27 14 5 22 5 18 29 27 27) retrieved as Now or Never. 5. Conclusion The present paper involves three different methods to encrypt and decrypt the message where the first two methods involved Hill cipher using invertible matrix and involutory matrix. Whereas, the third method involves two stages of encryption and decryption where public key and private key which are untraceable by the third parities, as it is involves large prime numbers which provides security of information. References [1] Mohiuddin Ahmed and Md. Ashik Iqbal, (2020). International Journal of Material and Mathematical Sciences, 2(6), 99-103, 2020. [2] Rao, GAV Rama Chandra, P.V. Lakshmi and N. Ravi Shankar. β€œA New Modular Multiplication Method in Public Key Cryptosystem.” International Journal of network Security15.1(2013):23-27. [3] Rao, GAV Rama Chandra, P.V. Lakshmi and N. Ravi Shankar. β€œA Novel Modular Multiplication Algorithm and its application to RSA Decryption”, IJCSI International Journal of Computer Science Issues, Vol.9, Issue 6, No 3, November 2012. [4] B. Persis Urbana Ivy, Purushotam Mandiwa, Mukesh Kumar, (2012). International Journal of Engineering and Computer Science ISSN:2319-7242 Vol1 Issue2 Nov 2012 Page No.63-66. [5] Adhikari M.R and Avishek Adhikari, (2007). Introduction to linear algebra with application to basic cryptography, (New Delhi 2007). [6] Koblitz N. (1998). Algebraic Aspects of Cryptography, Springer. [7] Cohen H. (1994). A course in computational Algebraic Number theory, Springer. [8] Lester, S.H (1992). Cryptography in an algebraic alphabet. The American mathematical monthly,36:306-312. [9] Rivest R., Adleman L.M and Shamir A. (1978). A method for obtaining digital signature and public key cryptosystems (Comm. Of ACM21(1978)120-126).