Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 841 https://internationalpubls.com Implementation of R in Cryptographic Algorithms: Integrating Symmetric Matrices and Positive Integer-Valued Functions 1K. Kaleeswari, *2J. Kannan, 3M. Mahalakshmi, 4A. Deepshika, 5Manju Somanath and 6V. Sangeetha 1Part Time Ph.D. Research Scholar, Department of Mathematics, Ayya Nadar Janaki Ammal College (Autonomous, affiliated to Madurai Kamaraj University), Sivakasi – 626124, Tamil Nadu, India. 2Assistant Professor, Department of Mathematics, Ayya Nadar Janaki Ammal College (Autonomous, affiliated to Madurai Kamaraj University), Sivakasi – 626124, Tamil Nadu, India. 3, 4Full Time Ph.D. Research Scholar, Department of Mathematics, Ayya Nadar Janaki Ammal College (Autonomous, affiliated to Madurai Kamaraj University), Sivakasi – 626124, Tamil Nadu, India. 5Associate Professor, PG and Research Department of Mathematics, National College (Autonomous, affiliated to Bharathidasan University), Trichy – 620 001, Tamil Nadu, India. 6Assistant Professor, PG and Research Department of Mathematics, National College (Autonomous, affiliated to Bharathidasan University), Trichy – 620 001, Tamil Nadu, India. *Corresponding Author’s E-mail ID.: jayram.kannan@gmail.com Article History: Received: 20-11-2024 Revised: 22-12-2024 Accepted: 15-01-2025 Abstract: In this paper, algorithms for encryption and decryption are displayed by means of functions 𝑓, 𝑔: ℕ → ℕ and a unique assignment for alphabets. In the process of encryption, a cyclic symmetric matrix is also employed. The algorithms are followed by a few exemplifications for both processes. In the end, separate R programs for encryption and decryption are provided with samples. Keywords: Encryption, decryption, cyclic symmetric matrix, positive integer-valued function. 2010 MSC Subject Classification: 11A25,11T71, 94A60. 1. Introduction The concept of encryption is the process of transmitting the original message in a different form, whereas decryption is the process of converting the encrypted message to its original form. There are a lot of algorithms for doing these processes effectively. This paper possesses such encryption and decryption algorithms. In recent days, researchers have employed various unique terms in their own encryption and decryption algorithms. For example, (Dasdemir, 2011) and (Thiagarajan, 2018) used matrices in algorithms. Basic number theoretical concepts, Fibonacci and Lucas numbers are also used in the algorithms provided in (Taş, 2018) and (Uçar, 2019). Apart from these, the Diophantine equation, an equation over ℤ, whose solutions are to be found in ℤ, is also considered for the conversion of messages into an alternative form. For instance, Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 842 https://internationalpubls.com (Dasdemir, 2011) and (Kannan, 2022) employ the well-known Pell equation and its solutions in recursive matrix form. This study was also developed with the thought of encrypting and decrypting messages by using number theoretic components. (Thiagarajan, 2018) and (Zeriouh, 2019) were utilized as a precursor to its creation. The main theme of this paper is to use positive integer-valued function and a cyclic symmetric matrix corresponding to the message taken. Let 𝑓:ℕ → ℕ be a function defined by 𝑓(𝑛) = { 𝐴 ( 𝑛 + 1 2 ) , 𝑖𝑓 𝑛 𝑖𝑠 𝑜𝑑𝑑 𝐵 ( 𝑛 2 ) , 𝑖𝑓 𝑛 𝑖𝑠 𝑒𝑣𝑒𝑛 where 𝐴(𝑛) is the 𝑛𝑡ℎ smallest element in the set 𝐴 = {3𝑘 + 1: 𝑘 = 0,1,2,⋯ } and 𝐵(𝑛) is the 𝑛𝑡ℎ smallest element in the set 𝐵 = ℕ\𝐴. This is the positive integer-valued function used for the conversion of messages in this paper. Also, the alphabets are assigned uniquely. This article comprises various components, such as sections and subsections. Notations and positions are the major requirements of this paper, and they follow the section “Introduction”. The section “Procedures for Encryption and Decryption” displays the algorithms of encryption and decryption, along with examples in the subsection “Few Exemplifications”. After that, the section “R Code for Encryption and Decryption” is placed. This section provides R programs for both processes with an illustration. Finally, there is a conclusion to this article. 1.1. Notations The following are the basic notations used in this paper: • 𝑊𝑖: 𝑖 𝑡ℎ word in the message to be sent • 𝑛(𝑊𝑖): number of letters in the word 𝑊𝑖 • ℕ: the set of all natural numbers • 𝐴: the set of all natural numbers of the form 3𝑘 + 1, 𝑘 = 0,1,2,⋯ • 𝐵: the set of all natural numbers not in the set 𝐴 • 𝐴(𝑛): 𝑛𝑡ℎ smallest element in the set 𝐴 • 𝐵(𝑛): 𝑛𝑡ℎ smallest element in the set 𝐵 • 𝑓: a positive integer-valued function defined on ℕ by 𝑓(𝑛) = { 𝐴 ( 𝑛 + 1 2 ) , 𝑖𝑓 𝑛 𝑖𝑠 𝑜𝑑𝑑 𝐵 ( 𝑛 2 ) , 𝑖𝑓 𝑛 𝑖𝑠 𝑒𝑣𝑒𝑛 • 𝑔: a positive integer-valued function defined on ℕ by 𝑔(𝑛) = { 𝑛 + 1 2 , 𝑖𝑓 𝑛 𝑖𝑠 𝑜𝑑𝑑 𝑛 2 , 𝑖𝑓 𝑛 𝑖𝑠 𝑒𝑣𝑒𝑛 • 𝑀𝑖: cyclic symmetric matrix for 𝑊𝑖 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 843 https://internationalpubls.com • 𝐼𝑖: identity matrix of order 𝑖 • 𝑅𝑖: 𝑔(𝑛(𝑊𝑖)) 𝑡ℎ row of the cyclic matrix 𝑀𝑖 • 𝐷(𝑅𝑖): diagonal matrix with entries in 𝑅𝑖 1.2. Positions The following is the table for position of alphabets: A B C D E F G H I J K L M 7 13 21 31 43 57 73 91 111 133 157 183 211 N O P Q R S T U V W X Y Z 241 273 307 343 381 421 463 507 553 601 651 703 757 Table 1: Numerical Assignments for Alphabets 2. Procedures for Encryption and Decryption This section covers the steps for the processes of encryption and decryption for a given message. 2.1. Encryption In this encryption process, each word has to be encrypted separately. First, split the message (assume it has 𝑛 words) to be sent into 𝑊1,𝑊2, ⋯ ,𝑊𝑛 (omit spaces). Then do the same steps given below for each 𝑖 (the following steps are provided for the word 𝑊𝑖) (E1) Using the Table 1, find the position for each letter in the word 𝑊𝑖. (E2) Apply the function 𝑓 for each of these numerical positions. (E3) Construct a cyclic symmetric matrix 𝑀𝑖 of order 𝑖 × 𝑖 using the values obtained in (𝐸2). (E4) Calculate 𝑛(𝑊𝑖). (E5) Calculate 𝑔(𝑛(𝑊𝑖)). (E6) Construct the diagonal matrix 𝐷(𝑅𝑖). (E7) Find 𝐷(𝑅𝑖) − 𝑛(𝑊𝑖)𝐼𝑛(𝑊𝑖) , which is the encrypted key. This encrypted key is to be sent as 𝐸𝑖 = (𝑒𝑖1 𝑒𝑖2 ⋯ 𝑒𝑖𝑘𝑖) where 𝑒𝑖𝑘𝑖′𝑠 are the diagonal entries of 𝐷(𝑅𝑖) − 𝑛(𝑊𝑖)𝐼𝑛(𝑊𝑖) . 2.2. Decryption For each 𝑖 do the following steps for the decryption of the encrypted key 𝐸𝑖. (D1) Calculate 𝐶𝑖 = (𝑐𝑖1 𝑐𝑖2 ⋯ 𝑐𝑖𝑘𝑖) = 𝐷(𝐸𝑖) + 𝑘𝑖𝐼𝑘𝑖. (D2) Find 𝑔(𝑘𝑖). (D3) Construct 𝑆𝑖 = (𝑠𝑖1 𝑠𝑖2 ⋯ 𝑠𝑖𝑘𝑖) where 𝑠𝑖𝑔(𝑘𝑖) is 𝑐𝑖1, 𝑠𝑖(𝑔(𝑘𝑖)+1) is 𝑐𝑖2, ⋯ (occurs in cyclic order). (D4) For each 𝑠𝑖𝑗(1 ≤ 𝑗 ≤ 𝑘𝑖), calculate 𝑦(𝑠𝑖𝑗) = 2(𝑠𝑖𝑗−1) 3 + 1. (D5) Replacing 𝑦(𝑠𝑖𝑗) for all 1 ≤ 𝑗 ≤ 𝑘𝑖 by its corresponding alphabet, the required word is obtained. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 844 https://internationalpubls.com 2.3. Few Exemplifications Here are two examples for the above given encryption and decryption processes. Example 2.1. Encrypt and decrypt the message “PRIMES”. Here we have only one word to process. So 𝑊1 = 𝑃𝑅𝐼𝑀𝐸𝑆. Encryption: (E1) (E2) (E3) 𝑀1 = ( 460 571 166 316 64 631 571 166 316 64 631 460 166 316 64 631 460 571 316 64 631 460 571 166 64 631 460 571 166 316 631 460 571 166 316 64 ) (E4) 𝑛(𝑊1) = 6 (E5) 𝑔(𝑛(𝑊1)) = 3 (E6) 𝐷(𝑅1) = ( 166 0 0 0 0 0 0 316 0 0 0 0 0 0 64 0 0 0 0 0 0 631 0 0 0 0 0 0 460 0 0 0 0 0 0 571) (E7) 𝐷(𝑅1) − 𝑛(𝑊1)𝐼𝑛(𝑊1) = ( 166 0 0 0 0 0 0 316 0 0 0 0 0 0 64 0 0 0 0 0 0 631 0 0 0 0 0 0 460 0 0 0 0 0 0 571) − ( 6 0 0 0 0 0 0 6 0 0 0 0 0 0 6 0 0 0 0 0 0 6 0 0 0 0 0 0 6 0 0 0 0 0 0 6) P R I M E S 307 381 111 211 43 421 𝑛 307 381 111 211 43 421 𝑓(𝑛) 460 571 166 316 64 631 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 845 https://internationalpubls.com = ( 160 0 0 0 0 0 0 310 0 0 0 0 0 0 58 0 0 0 0 0 0 625 0 0 0 0 0 0 454 0 0 0 0 0 0 565) The encrypted key is 𝐸1 = (160 310 58 625 454 565) Decryption: Here 𝑘1 = 6. (D1) 𝐶1 = 𝐷(𝐸1) + 𝑘1𝐼𝑘1 = (166 316 64 631 460 571) (D2) 𝑔(𝑘1) = 3 (D3) 𝑆1 = (460 571 166 316 64 631) 𝑠11 𝑠12 𝑠13 𝑠14 𝑠15 𝑠16 𝑠𝑖𝑗 460 571 166 316 64 631 𝑦(𝑠𝑖𝑗) 307 381 111 211 43 421 (D4) The required word is “PRIMES”. Example 2.2. Encrypt and decrypt the message “SHE DRIVES A CAR”. Encryption: The following table presents the encryption process. 𝑊𝑖 SHE DRIVES A CAR (𝐸1) • 𝑆 = 421 • 𝐻 = 91 • 𝐸 = 43 • 𝐷 = 31 • 𝑅 = 381 • 𝐼 = 111 • 𝑉 = 553 • 𝐸 = 43 • 𝑆 = 421 • 𝐴 = 7 • 𝐶 = 21 • 𝐴 = 7 • 𝑅 = 381 (𝐸2) • 𝑓(421) = 631 • 𝑓(91) = 136 • 𝑓(43) = 64 • 𝑓(31) = 46 • 𝑓(381) = 571 • 𝑓(111) = 166 • 𝑓(553) = 829 • 𝑓(43) = 64 • 𝑓(421) = 631 • 𝑓(7) = 10 • 𝑓(21) = 31 • 𝑓(7) = 10 • 𝑓(381) = 571 (𝐸3) ( 631 136 64 136 64 631 64 631 136 ) ( 46 571 166 829 64 631 571 166 829 64 631 46 166 829 64 631 46 571 829 64 631 46 571 166 64 631 46 571 166 829 631 46 571 166 829 64 ) (10) ( 31 10 571 10 571 31 571 31 10 ) (𝐸4) 𝑛(𝑊1) = 3 𝑛(𝑊2) = 6 𝑛(𝑊3) = 1 𝑛(𝑊4) = 3 (𝐸5) 𝑔(𝑛(𝑊1)) = 2 𝑔(𝑛(𝑊2)) = 3 𝑔(𝑛(𝑊3)) = 1 𝑔(𝑛(𝑊4)) = 2 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 846 https://internationalpubls.com (𝐸6) ( 136 0 0 0 64 0 0 0 631 ) ( 166 0 0 0 0 0 0 829 0 0 0 0 0 0 64 0 0 0 0 0 0 631 0 0 0 0 0 0 46 0 0 0 0 0 0 571) (10) ( 10 0 0 0 571 0 0 0 31 ) (𝐸7) ( 133 0 0 0 61 0 0 0 628 ) ( 160 0 0 0 0 0 0 823 0 0 0 0 0 0 58 0 0 0 0 0 0 625 0 0 0 0 0 0 40 0 0 0 0 0 0 565) (9) ( 7 0 0 0 568 0 0 0 28 ) 𝐸𝑖 (133 61 628) (160 823 58 625 40 565) (9) (7 568 28) Table 2. Encryption for “SHE DRIVES A CAR” Decryption: The following table presents the decryption process. 𝐸𝑖 (133 61 628) (160 823 58 625 40 565) (9) (7 568 28) 𝑘𝑖 𝑘1 = 3 𝑘2 = 6 𝑘3 = 1 𝑘4 = 3 (𝐷1) (136 64 631) (166 829 64 631 46 571) (10) (10 571 31) (𝐷2) 𝑔(𝑘1) = 2 𝑔(𝑘2) = 3 𝑔(𝑘3) = 1 𝑔(𝑘4) = 2 (𝐷3) (631 136 64) (46 571 166 829 64 631) (10) (31 10 571) (𝐷4) 𝑠11 𝑠12 𝑠13 𝑠1𝑗 631 136 64 𝑦(𝑠1𝑗) 421 91 43 𝑠21 𝑠22 𝑠23 𝑠24 𝑠25 𝑠26 𝑠2𝑗 46 571 166 829 64 631 𝑦(𝑠2𝑗) 31 381 111 553 43 421 𝑠31 𝑠3𝑗 10 𝑦(𝑠3𝑗) 7 𝑠41 𝑠42 𝑠43 𝑠4𝑗 31 10 571 𝑦(𝑠4𝑗) 21 7 381 (𝐷5) SHE DRIVES A CAR Table 3. Decryption for “SHE DRIVES A CAR” Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 847 https://internationalpubls.com 3. R Code for Encryption and Decryption of Words with Four Letters Figure 1. Code for encryption Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 848 https://internationalpubls.com Figure 2. Continuation of figure 1 Sample Output for Encryption Figure 3. Encryption of ROCK Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 849 https://internationalpubls.com Figure 4. Code for decryption Output for Decrypting “ROCK” Figure 5. Decryption of ROCK Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 9s (2025) 850 https://internationalpubls.com 4. Conclusion This paper presents encryption and decryption algorithms employing positive integer-valued functions and cyclic symmetric matrices. These algorithms are successfully verified by means of examples and R codes for words with four letters. One may extend those R codes for more than four lettered word. Also, this article paves the way to create new such algorithms by effectively changing the arithmetic functions given here. References [1] Dasdemir, A. (2011). On the Pell, Pell- Lucas and modified Pell numbers by matrix method. Applied Mathematical Sciences, 5(64), 3173-3181. [2] Kannan, J., Mahalakshmi,M., & Deepshika, A. (2022). Cryptographic algorithm involving the matrix 𝑄𝑝 ∗ . Korean Journal of Mathematics, 30(3), 533-538. [3] Kannan, J., Manju, S., Mahalakshmi, M., & Raja, K. (2022). Encryption decryption algorithm using solutions of Pell equation. International Journal of Mathematics and Its Applications, 10(1), 1-8. [4] Taş, N., Uçar, S., Özgür, N.Y., & Kaymak, Ö. Ö. (2018). A new coding/decoding algorithm using Fibonacci numbers. Discrete Mathematics, Algorithms and Applications, 10(2), 1850028. [5] Thiagarajan, K., Balasubramanian, P., Nagaraj, J., & Padmashree, J. (2018). Encryption and decryption algorithm using algebraic matrix approach. Journal of Physics: Conference series, 1000(1), 012148. [6] Uçar, S., Taş, N., & Özgür, N.Y. (2019). A new application to coding theory via ibonacci and Lucas numbers. Mathematical Sciences and Applications E-notes, 7(1), 62-70. [7] Zeriouh, M., Chillali, A., & Boua, A. (2019). Cryptography based on the matrices. Bol.Soc.Paran.Mat, 37(3), 75-83.