Abstract
Traditionally, symmetric key encryption has been computationally intensive, and the balance between security and computation costs has necessitated the use of systems with simpler computations and variable-sized keys. This paper introduces a lightweight technique for symmetric key encryption of text, which utilizes less complex operations such as XOR and permutation matrices. The proposed method encrypts and decrypts text based on the ASCII values of plain text characters, using two symmetric keys to provide security. The use of lightweight and computationally efficient operations like XOR and permutation matrices ensures efficient encryption. One of the advantages of this approach is that it allows for the use of any key size without increasing computational complexity, while also enhancing security. Our statistical findings demonstrate that while increasing input size increases computation complexity, increasing key size does not affect it. Thus, any key size can be used for greater security. In summary, our proposed technique provides a simple, lightweight, and efficient method for data encryption and decryption with enhanced security using variable-sized keys.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Cryptography produces ciphers to secure communication between a sender and recipient, with objectives such as privacy, integrity, and access control. Encryption scrambles messages and decryption transforms them back to plain text. Cryptography algorithms are used to encrypt and decrypt data, with the primary objective of making it difficult to decode without the key. Testing each key combination is the most effective technique, but time-consuming. Cryptography algorithms are usually classified into two groups: symmetric key encryption and asymmetric key encryption.
-
1.
Symmetric key encryption [1] uses a single key for both the encryption and decryption processes, as shown in Fig. 1. The key is first sent via a secure channel to the sender and receiver, and the strength of the encryption depends on the length of the key (in bits). Various techniques are used and researched in different fields for key distribution between the sender and receiver. Examples of symmetric key encryption algorithms include RC2, DES, 3DES, RC5, Blowfish, AES [2,3,4,5], and S-DES.
-
2.
Asymmetric key encryption resolves the issue of key distribution in symmetric algorithms by using different keys for encryption and decryption, as shown in Fig. 2. This method employs two types of keys: private keys and public keys. The original data or plain text is encrypted using the public key to produce a cipher text. When the receiver receives this cipher text, they use their own private key to decrypt it. A private key is also referred to as a secret key since only the intended recipient or an authorized person is aware of it. However, public keys can be kept in open databases where anyone can access them. Examples of asymmetric key encryption methods include RSA [6, 7], Digital Signatures [8], and others [9,10,11,12,13,14,15,16,17].
It is assumed that the encryption and decryption algorithm of a certain cryptography system is known to everyone. The level of security of the cipher text is determined by the secrecy of the key used for encryption and decryption.
The paper is structured as follows: the background work of symmetric and asymmetric key encryption schemes is discussed in Sect. 2, the proposed method is presented in Sect. 3, the performance of the proposed scheme is evaluated in Sect. 4, the security analysis of the proposed scheme is presented in Sect. 5, and the paper is concluded with potential future work in Sect. 6.
2 Background work
Symmetric key encryption has been an important technique for ensuring data security for a long time. Traditional symmetric encryption algorithms such as AES, DES, and 3DES have been widely used, performance of these algorithms discussed by Patel et al. [18]. However, these techniques are computationally intensive and have certain limitations in terms of the key size and complexity. Researchers have developed various lightweight and efficient symmetric encryption schemes to address these limitations. One of the common approaches to achieving lightweight encryption is to use simple operations such as XOR and permutation matrices, which are computationally efficient. For example, the Lightweight Block Cipher family (LBlock, LEA, and Piccolo) are lightweight ciphers that use simple operations such as bitwise XOR and permutation. These ciphers have shown good performance in terms of security and efficiency, making them suitable for resource-constrained devices. Another approach to lightweight symmetric encryption is to use variable-sized keys. The RC5 algorithm is an example of a symmetric encryption scheme that allows for variable key sizes. This technique enhances the security of the cipher by allowing for the use of larger key sizes while keeping computational complexity low. Table 1 shows the variety of symmetric key encryption with their advantages, disadvantages, or limitations.
The proposed technique of symmetric key encryption using lightweight operations such as XOR and permutation matrices, and the use of variable-sized keys is a promising approach for achieving efficient and secure data encryption. The use of ASCII values for encryption and decryption is an added advantage, making it suitable for resource-constrained devices. Various other techniques such as LBlock, LEA, and RC5 have also shown good performance in terms of security and efficiency, making them suitable for use in different applications.
3 Proposed model
The proposed approach begins by transforming characters into their ASCII values before encrypting the plaintext into ciphertext through a series of steps. It utilizes two keys, \(k_1\) and \(k_2,\) as symmetric keys for both encryption and decryption. Although there is no limit on key length, a larger value is preferred for improved security. This algorithm covers the entire ASCII character set. The encryption and decryption methods of the proposed algorithm are discussed in detail in the subsequent steps of the algorithm. The detailed steps for plain text encryption are discussed in Algorithm 1 in the following sections. In Algorithm 1(i), the ASCII characters of a plain text encoded representation are shown. First, the plain text characters \({PT_1, PT_2,\ldots ,PT_l}\) are converted into ASCII decimal values. Next, the encoded numbers \({N_1, N_2,\ldots ,N_l}\) are generated by adding the value 1000 to these converted ASCII decimal values. To create the combined number CN, all the encoded numbers undergo a string concatenation operation. In Algorithm 1(ii), the combined number CN is used as a row matrix along with the encryption key \(K_1\) to generate the encoded ASCII matrix \(\alpha .\) Here, \(k_1\) defines the number of columns in each row. The number of rows in the \(\alpha \) matrix is equal to \(len(CN) \mod K_1,\) where len(CN) represents the length of CN. Any unfilled columns are filled with bogus values. In Algorithm 1(iii), the \(\beta \) matrix is generated with the help of the private key pair \(K_1, K_2.\) In Algorithm 1(iv), the XOR operation is performed between the \(\alpha \) and \(\beta \) matrices, and the resulting matrix is added with the value 1000 to generate the \(\gamma \) matrix. In Algorithm 1(v), row-wise permutation is performed on the \(\gamma \) matrix using the \(\theta \) matrix, which generates the \(\gamma _r\) matrix. The \(\theta \) matrix contains the row permutation sequences for the row-wise permutation operation on the \(\gamma \) matrix. In Algorithm 1(vi), column-wise permutation is performed on the \(\gamma _r\) matrix using the \(\theta ^{\prime }\) matrix, which generates the \(\gamma _c\) matrix. The \(\theta ^{\prime }\) matrix contains the column permutation sequences for the column-wise permutation operation on the \(\gamma _r\) matrix. In Algorithm 1(vii), the ciphertext is generated by first subtracting the value 1000 from each element of the \(\gamma _c\) matrix. The resulting values are then converted into equivalent ASCII characters, which are assigned to ciphers \({C_1, C_2,\ldots , C_{p-1}, C_p},\) where p represents the number of rows in the \(\gamma _c\) matrix and \(q=K_1\) represents the number of columns. Finally, all the ciphers are concatenated to generate the ciphertext CT.
The detailed steps for decrypting the ciphertext are discussed in Algorithm 2 in the following sections. In Algorithm 2(i), the ASCII characters of the decoded ciphertext representation are shown. Here, the ciphertext characters \(CT_1, CT_2,\ldots ,CT_l\) are first converted into ASCII decimal values. The resulting numbers \(CTN_1, CTN_2,\ldots ,CTN_l\) are generated by adding the value 1000 to these converted ASCII decimal values. To create the combined ciphertext number CCN, all the encoded numbers undergo a string concatenation operation. In Algorithm 2(ii), the combined number CCN is used as a row matrix along with the encryption key \(K_1\) to reconstruct the decoded ASCII matrix \(\gamma _r.\) Here, \(K_1\) defines the number of columns in each row. The number of rows are equal to \(len(CCN) \mod K_1,\) where len(CCN) represents the length of the CCN. In Algorithm 2(iii), column-wise permutation is performed on the \(\gamma _r\) matrix using \(\theta '\) matrix, which reconstructs the \(\gamma _c\) matrix. The \(\theta '\) matrix contains the column permutation sequences for the column-wise permutation operation on the \(\gamma _r\) matrix. In Algorithm 2(iv), row-wise permutation is performed on the \(\gamma _c\) matrix using \(\theta \) matrix, which reconstructs the plaintext matrix. The \(\theta \) matrix contains the row permutation sequences for the row-wise permutation operation on the \(\gamma _c\) matrix. In Algorithm 2(v), the private key pair \(K_1\) and \(K_2\) are used to generate the \(\beta \) matrix. In Algorithm 2(vi), the XOR operation is performed between the plaintext matrix and the \(\beta \) matrix, and the resulting matrix is subtracted by the value 1000 to reconstruct the \(\alpha \) matrix. In Algorithm 2(vii), the combined number CN, which is a row matrix, is reconstructed by concatenating the elements of the \(\alpha \) matrix in a row-wise sequence. After that, for each group of combined numbers, the first four elements are concatenated and subtracted by the value 1000. The resulting values are then converted into ASCII character values and stored in variables \({PT_1, PT_2,\ldots ,PT_{p-1}, PT_p}.\) Finally, a concatenation operation is performed to reconstruct the plaintext value. Furthermore, the ciphertext is generated by first subtracting the value 1000 from each element of the plaintext matrix \(\gamma _c.\) The resulting values are then converted into equivalent ASCII characters, which are assigned to ciphers \({C_1, C_2,\ldots , C_{p-1}, C_p},\) where p represents the number of rows in the plaintext matrix and \(q=K_1\) represents the number of columns. Finally, all the ciphers are concatenated to generate the ciphertext CT.
4 Performance analysis
In performance analysis, we observed the computation complexity varying with different parameters and system specifications: The processor is an AMD A8-7410 APU (2.20 GHz), with 8.00 GB (6.91 GB usable) of DDR3 RAM, and a 64-bit Operating System (Windows 10 Pro), x64 based processor. The evaluation of the execution time includes the total time taken for encryption and decryption, as well as the time elapsed for file read and write operations in Java.
Table 2 shows the performance analysis based on sizes of the text file, by keeping the keys \(k_1\) and \(k_2\) fixed, total execution time (including both encryption and decryption) based on given parameter in below.
-
A plain text file is encrypted and then decrypted.
-
\(k_1 = 120\) and \(k_2 = 71.\)
Figure 3 demonstrates that the line graph depicts the execution time of a proposed scheme based on the size of the text file (KB). Increasing the text file’s (KB) size results in a increased execution time.
Table 3 shows the performance analysis based on key size, by Keeping the key \(k_1\) fixed and applying the algorithm on the same file, variation of execution time with key \(k_1\) based on given parameter in below.
-
Size of the plain text file is 34.5 KB.
-
\(k_1 = 120.\)
Figure 4 shows how a proposed scheme’s execution time is represented by a line graph based on the length of the key \((k_1),\) where increasing the length of the key has no effect whatsoever on the execution time.
Table 4 shows the performance analysis based on key size, by Keeping the key \(k_2\) fixed and applying the algorithm on the same file, variation of execution time with key \(k_2\) based on given parameter in below.
-
Size of the plain text file is 34.5 KB.
-
\(k_2 = 23.\)
Figure 5 shows how a proposed scheme’s execution time is represented by a line graph based on the length of the key \((k_2),\) where increasing the length of the key has no effect whatsoever on the execution time.
Table 5 displays execution times for different key lengths of a particular encryption scheme, and the figure shows that the proposed scheme’s execution time is independent of key length. This is a significant advantage compared to other encryption schemes, which often experience longer execution times with longer key lengths. Moreover, the comparison table demonstrates limitations in block size, vulnerability to side-channel attacks, and limited adoption of some encryption schemes. As a result, the proposed scheme may offer better performance and security than these schemes.
5 Security analysis
The proposed algorithm provides high level of security as an attacker would need to know both keys \((k_1\) and \(k_2)\) to decrypt the ciphertext and test all possible combinations. The length of keys is not limited, making it computationally infeasible for an attacker to attempt \(10^{170}\) times even for large key values like \(10^{50}\) and \(10^{120}.\) Using \(k_2\) as an exponent in both encryption and decryption procedures may increase the computing cost, but even for smaller values of keys, larger files will take significantly more time to execute. For optimal security, it is recommended to use keys with large values.
6 Conclusion and future scope
The proposed approach is a lightweight symmetric key encryption technique that uses permutation matrices and XOR operations for encryption and decryption with any key size, without increasing the computation complexity. The performance analysis demonstrated that larger key sizes provide higher security and that the size of the keys is completely independent of the execution time. However, the size of the file affects the execution time, meaning that as the text file size increases, so does the execution time.
The future work of the proposed algorithm includes modifying the functions used to generate the XOR matrix and permutation matrix to enhance the algorithm’s security. Additionally, optimizations can be implemented to improve the speed of encryption and decryption of larger text files. Overall, the approach provides a secure and lightweight encryption technique for textual data and has potential for further enhancements to improve its performance and security.
Availability of data and material (data transparency):
Data available on request from the authors.
Code availability (software application or custom code)
Code available on request from the authors.
References
Bokhari MU, Shallal QM (2016) A review on symmetric key encryption techniques in cryptography. Int J Comput Appl 147(10):43–48
Abdullah AM (2017) Advanced encryption standard (AES) algorithm to encrypt and decrypt data. Cryptogr Netw Secur 16:1–11
Han S-J, Oh H-S, Park J (1996) The improved data encryption standard (DES) algorithm. In: Proceedings of ISSSTA’95 international symposium on spread spectrum techniques and applications, vol 3. IEEE, Mainz, Germany, pp 1310–1314
Knudsen LR et al (1998) On the design and security of RC2. In: International workshop on fast software encryption. Springer, Berlin
Noura M et al (2018) S-DES: an efficient and secure DES variant. In: IEEE middle east and north Africa communications conference (MENACOMM), IEEE, Jounieh, Lebanon, pp 1–6
Milanov E (2009) The RSA algorithm. RSA Laboratories, pp 1–11. https://sites.math.washington.edu/~morrow/336_09/papers/Yevgeny.pdf
Imam R, Anwer F, Nadeem M (2022) An effective and enhanced RSA based public key encryption scheme (XRSA). Int J Inf Technol 14(5):2645–2656
Merkle RC (1990) A certified digital signature. In: Conference on the theory and application of cryptology. Springer, New York
Yassein MB et al (2017) Comprehensive study of symmetric key and asymmetric key encryption algorithms. In: International conference on engineering and technology (ICET), IEEE, Antalya, Turkey, pp 1–7
Hellman ME (2002) An overview of public key cryptography. IEEE Commun Mag 40(5):42–49
Rawat AS, Deshmukh M (2019) Efficient extended Diffie–Hellman key exchange protocol. In: 2019 International conference on computing, power and communication technologies (GUCON), IEEE, New Delhi, India, pp 447–451
Rawat A, Deshmukh M (2020) Tree and elliptic curve based efficient and secure group key agreement protocol. J Inf Secur Appl 55:102599
Rawat AS, Deshmukh M (2020) Communication efficient Merkle-Tree based authentication scheme for smart grid. In: Proceedings of the 2020 IEEE 5th international conference on computing communication and automation (ICCCA). IEEE, Greater Noida, India, pp 693–698
Rawat AS, Deshmukh M (2021) Computation and communication efficient chinese remainder theorem based multi-party key generation using modified RSA. In: Stănică P, Gangopadhyay S, Debnath SK (eds) Security and Privacy: Select Proceedings of ICSP 2020. Springer Singapore
Rawat AS, Deshmukh M (2021) Computation and communication efficient secure group key exchange protocol for low configuration system. Int J Inf Technol 13(3):839–843
Sharma P, Purushothama BR (2023) Cryptanalysis of a secure and efficient Diffie–Hellman based key agreement scheme. Int J Inf Technol 15:1–9
Bhat R, Sunitha NR, Iyengar SS (2022) A probabilistic public key encryption switching scheme for secure cloud storage. Int J Inf Technol 15(2):1–16
Patel K (2019) Performance analysis of AES, DES and Blowfish cryptographic algorithms on small and large data files. Int J Inf Technol 11:813–819
Standard, Data Encryption (1977) Federal information processing standards publication 46, vol 23. National Bureau of Standards, US Department of Commerce, pp 1–18
Daemen J, Rijmen V (1999) AES proposal: Rijndael (version 2). NIST AES website, csrc.nist.gov/encryption/aes
Schneier B (1994) Description of a new variable-length key, 64-bit block cipher (Blowfish). In: Anderson R (eds) Fast software encryption. FSE 1993. Lecture notes in computer science, vol 809. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58108-1_24
Schneier B et al (1998) Twofish: a 128-bit block cipher. NIST AES Propos 15(1):23–91
Anderson R, Biham E, Knudsen L (1998) Serpent: a proposal for the advanced encryption standard. NIST AES Propos 174:1–23
Wu W, Zhang L (2011) LBlock: a lightweight block cipher. In: Lopez J, Tsudik G (eds) Applied cryptography and network security: 9th international conference, Springer, Berlin, Heidelberg, pp 327–344
Hong D et al (2014) LEA: a 128-bit block cipher for fast encryption on common processors. In: Kim Y, Lee H, Perrig A (eds) Information security applications: 14th international workshop, Springer, Cham, pp 3–27
Vasiliadis G et al (2014) PixelVault: using GPUs for securing cryptographic operations. In: Proceedings of the 2014 ACM SIGSAC conference on computer and communications security, Scottsdale, Arizona, USA, pp 1131–1142
Rivest RL (2005) The RC5 encryption algorithm. In: Fast software encryption: second international workshop Leuven, Leuven, Belgium, pp 86–96
Funding
This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Deshmukh, M., Rawat, A.S. Lightweight symmetric key encryption for text using XOR operation and permutation matrix. Int. j. inf. tecnol. 15, 3555–3562 (2023). https://doi.org/10.1007/s41870-023-01407-3
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s41870-023-01407-3