Application of Rectangular Matrices: Affine Cipher Using Asymmetric Keys CAUCHY –Jurnal Matematika Murni dan Aplikasi Volume 5(4) (2019), Pages 181-185 p-ISSN: 2086-0382; e-ISSN: 2477-3344 Submitted: September 26, 2017 Reviewed: October 09, 2017 Accepted: May 31, 2019 DOI: http://dx.doi.org/10.18860/ca.v5i4.4408 Application of Rectangular Matrices: Affine Cipher Using Asymmetric Keys Maxrizal1, Baiq Desy Aniska Prayanti2 1STMIK Atma Luhur Pangkalpinang 2Universitas Bangka Belitung Email: maxrizal@atmaluhur.c.id, baiqdesyaniska@gmail.com ABSTRACT In cryptography, we know the symmetric key algorithms and asymmetric key algorithms. We know that the asymmetric key algorithm is more secure than the symmetric key algorithm. Affine Cipher uses a symmetric key algorithm. In this paper, we introduce the Affine Cipher using asymmetric keys. Asymmetrical keys are formed from rectangular matrices. Keywords: cryptography, symmetric key algorithms, asymmetric key algorithms, Affine Cipher using asymmetric keys, rectangular matrices INTRODUCTION Nowadays, cryptography becomes the main option for securing messaging or data over a communications network. In cryptography, the sender encrypts the message (plaintext) into ciphertext. Furthermore, the receiver describes ciphertext into plaintext. Encryption and decryption in cryptography require key algorithm. If the encryption and decryption use a similar key, the algorithm is called symmetric key algorithms. If the encryption and decryption use a different key, it is called asymmetric key algorithm. The asymmetric key algorithm is also known as modern cryptographic systems. One example of an asymmetric key algorithm is RSA [1,2,3,4]. Affine Cipher is one of the cryptographic algorithms that uses a symmetric key algorithm. It including substitution cipher type. In Affine Cipher [5,6], each plaintext encrypted as  modi iC aP b M  and described as a   1 mod i i P a C b M    , with a and b are integers as private keys. Based on the above facts, in this study, we will modify the Affine Cipher using asymmetric keys. We will generate a private key and a public key on Affine Cipher. Asymmetrical keys are formed from rectangular matrices. METHODS This research is a study of literature research. Some properties of asymmetric keys are obtained from [1,2,3,4]. Furthermore, the properties of Affine Cipher is derived from [5,6]. Application of Rectangular Matrices: Affine Cipher Using Asymmetric Keys Maxrizal 182 RESULTS AND DISCUSSION Affine Cipher and Affine Cipher Using Asymmetric Keys In the Affine Cipher [5,6], applied encryption  modi iC aP b M  and descriptions  1 modi iP a C b M    , where a must be invertible on mod M and b is an arbitrary integer. The sender and receiver must save the private key a and b for encryption and description. In this study, we formed               * 1 1 1 1 1 * 1 1 1 1 1 1 1 * 1 1 1 1 1 1 1 1 * 1 1 1 1 1 1 1 1 1 * 1 1 1 1 1 1 1 1 mod mod mod mod mod (1) n n n n n n n n n n n n n n n n n n n n n n n n n n C Y P B M X C X Y P B M X C X Y P X B M X C X B M X Y P P X Y X C X B M                                           If we suppose 1 1n n X Y a    , * 1 1n n X C C    and 1 1n n X B b    , we have the similar decryption as Affine Cipher. Next, we get encryption  * 1 1 1 1 1 modn n nC Y P B M     , with the public key  1 1,n nY B  and description     1 * 1 1 1 1 1 1 1 1 mod n n n n n n P X Y X C X B M           , with the private key  1 nX  . Furthermore, encryption and description above, we call as Affine Cipher Using Asymmetric Keys. Key Generating Algorithm on Affine Cipher Using Asymmetric Keys Steps to generate of keys algorithm:  Choose 1 n X  .  Choose 1n Y  .  Calculate 1 1n n X Y   . If the matrix 1 1n n X Y   has no inverse over mod M , we repeat steps 1) and 2). If matrix   1 1 1n n X Y    exists on mod M , we have one of a public key 1n Y  and private key 1 n X  .  Choose an arbitrary matrix 1n B  . So, we get the public key  1 1,n nY B  and a private key  1 nX  . Security Analysis on Affine Cipher and Affine Cipher Using Asymmetric Keys On Affine Cipher Using Asymmetric Key, apply encryption  * 1 1 1 1 1 modn n nC Y P B M     , with the public key  1 1,n nY B  . If the sender sent the message, the attacker (unauthorized recipients) will get a public key  1 1,n nY B  and ciphertext * 1n C  . However, the attacker would be difficult to describe the ciphertext, because the matrix   1 1n Y   does not exist.             * 1 1 1 1 1 * 1 1 1 1 1 1 * 1 1 1 1 1 mod mod mod 2 n n n n n n n n n C Y P B M C B M Y P P Y C B M                    It means that the plaintext remains safe. Furthermore, we show a comparison Affine Cipher and Affine Cipher Using Asymmetric Keys. Application of Rectangular Matrices: Affine Cipher Using Asymmetric Keys Maxrizal 183 Affine Cipher Affine Cipher Using Asymmetric Keys  Symmetric key.  Asymmetric keys.  The key is an integer.  The key is matrix pair.  Elements on the plaintext and ciphertext one-to-one correspondence (bijective function).  Elements on the plaintext and ciphertext do not one-to-one correspondence ( it is not bijective function). Example Nisca will send a message to Max. Max generate the public key and private key. Key generating algorithm:  Max chooses  1 2 1X  .  He chooses 3 1 4 Y           .  He calculates   3 1 2 1 1 9 4 XY            . Note that 19 mod 26 3  .  He chooses an arbitrary matrix 2 1 5 B           .  Max gets the public key 3 2 1 , 1 4 5                         and private key   1 2 1 . Encryption: Niska received a public key 3 2 1 , 1 4 5                         from Max. She will send “USE” to Max. She converts “USE” to 21-19-5. She encrypts  * 1 1 1 1 1 modn n nC Y P B M     . She gets  *1 3 2 13 1 21 1 mod 26 22 4 5 11 C                                      *2 3 2 7 1 19 1 mod 26 20 4 5 3 C                                      *3 3 2 17 1 5 1 mod 26 6 4 5 25 C                                     Niska gets 13-22-11-7-20-3-17-6-25. She converts and sends “MVKGTCQFY” to Max. Application of Rectangular Matrices: Affine Cipher Using Asymmetric Keys Maxrizal 184 Description: Max received “MVKGTCQFY” from Nisca. He converts 13-22-11-7-20-3-17-6-25. Max knows the public key 3 2 1 , 1 4 5                         and saves the private key   1 2 1 . He describes     1 * 1 1 1 1 1 1 1 1 mod n n n n n n P X Y X C X B M           . He calculates  1 1 3 1 2 1 1 9 4 n n X Y              . He gets   1 1 1 3 n n X Y     . Next, he gets    1 1 13 2 3 1 2 1 22 1 2 1 1 mod 26 21 11 5 P                               1 1 7 2 3 1 2 1 20 1 2 1 1 mod 26 19 3 5 P                               1 1 17 2 3 1 2 1 6 1 2 1 1 mod 26 5 25 5 P                            Max gets 21-19-5. He converts “USE”. CONCLUSION From this study, we obtained several conclusions, including:  We can form Affine Cipher Using Asymmetric Keys.  Affine Cipher Using Asymmetric Keys more secure than Affine Cipher. . ACKNOWLEDGMENTS The research was done well because there is good support from STMIK Atma Luhur Pangkalpinang. Therefore, the author’s thank you for the support of funds and policies that are in STMIK Atma Luhur Pangkalpinang so this research can be done and completed. REFERENCES [1] Khairnar, D.B., and Sandeep, K., " Secure RSA: Pair-Wise Key Distribution Using Modified RSA Algorithm", International Journal of Advanced Research in Computer Science and Software Engineering, vol.6, issue. 4, pp. 383-387, 2016. [2] Puneeth, M., Farha, J. S., Sandhya, N., and Yamini, M., "RSA and Modified RSA Algorithm Using C Programming", International Journal of Advanced Engineering Research and Science, vol.2, issue. 2, pp. 15-20, 2015. Application of Rectangular Matrices: Affine Cipher Using Asymmetric Keys Maxrizal 185 [3] Hussain, A, K., "A Modified RSA Algorithm for Security Enhancement and Redundant Messages Elimination Using K-Nearest Neighbor", International Journal of Innovative Science, Engineering, and Technology, vol.2, issue. 1, pp.159-163, 2015. [4] Deshmukh, S., and Patil, R., “Hybrid Cryptography Technique Using Modified Diffie- Hellman and RSA", International Journal of Computer Science and Information Technology, vol.5, issue. 6, pp. 7302-7304, 2014. [5] Mokhtari, M., and Naraghi, H., "Analysis and Design of Affine and Hill Cipher", Journal of Mathematics Research, vol.4, no. 1, pp. 67-77, 2012. [6] Hussein, L, A., "Internal Affine Stream Cipher", Computer Engineering and Information Technology Journal, vol.1, issue. 1, pp. 1-5, 2015.