Encryption of SMS Using Playfair Technique Alharith Abdulkareem Abdullah College of science, University of Babylon. Babil, Iraq.
[email protected]
Wail Yas Nassir Laser and Optoelectronics Engineering Dept., University of Technology Baghdad, Iraq.
[email protected]
Abstract The function of the research is to design an integrated system for the encryption and decryption of SMS messages. The system was designed using "Java 2 Micro Edition" language which is the third part of Java language used in mobile applications. The function is to build special procedures for sending messages in addition to encryption and decryption. The technique of playfair ciphering was used as a first stage encryption for the message sent; the system was tested fully on mobile devices like Nokia or Samsung and the message was ciphered through ZAIN and ASIACELL net. The message was delivered and deciphered successfully to the original message.
Keywords: message, encryption, Playfair 1. Introduction The mobile is one of the communication forms which depend on wireless communication through a net of transmission towers distributed over a specific area. The mobile phone has now replaced the computer as the device most used for the sending of e-mails and is also used more widely than the traditional camera for the capturing of images. The security or the system is vital for the confidence of the messenger who must be guaranteed that the positions and situations are not violated. Security systems that protect computer networks between countries have changed during the 20th century. Initially, the security of electronic communications was not important because most of the stored information was not very confidential. However, as the value of stored information increases in value, so too does the sophistication of those who want to access the information illegally and sell it on to others who need it. Security then is more important now than it has ever been but the cost for securing an efficient protection system is also extremely high, as we shall see. Stories of bank clerks who used electronic links to transfer money to a personal account or electronic intruders who managed to insert messages to a TV channel using satellites are familiar examples of breaches in computer security systems. The problems of security we face today are numerous and include the challenges that come with shared computers and computer networks. All communication channels must be safeguarded, including those that are not connecting individual computer systems and those that have communication nets with a host computer.[1] Such is the nature of all modern communication channels and connecting media that ordinary physical protection against those who wish to break security is useless. The only way to make the protection stronger is by using cryptography in communication channels. Nevertheless, there is a danger that the many users employing the same resources will allow information to be leaked to an enemy who can use it. [2] The mechanism of access control for the computer must guarantee correct connection between the different user programs and processors. And if illegal access occurs, this access must be stopped and the operating system must register it. Cryptography has a long history and encryption strategies have been used to protect information for more than 400 years. In the 20th century encryption played a crucial role during the World War I and World War II. In fact, it has been an essential part of military and diplomatic
affairs through the ages, safeguarding government secrets and strategies. Now, as computers have become more widely used since the 1960s, encryption is even more decisive in protecting information.[2] Much work was done by the IBM company to adopt methods to encrypt information through DES (Data Encryption Standards) and the system was an active tool in protectin financial information. The encryption is simply a secret method of writing by transforming plaintext to an encrypted one using a special cipher. The basic idea behind encryption is to hide information in order to ensure that unauthorized persons cannot access or read it. The process of transforming the readable text to an encrypted one is called encryption or hiding. Similarly, the process of transforming the encrypted text to the original one is called decryption. The message can be a stream of bits, a text file, a picture, video or sound and is called pipeline text while an encrypted one is called c: cipher text. The language which was used to design the system is java language and in the beginning it was used as an ordinary programming language but because it is reliable and strong, most of the programmers used it to developed their programs trying to use it in many applications network and mobilephone.[3] So the SUN company suggested applying, allocating it to many techniques and when the Sun generated (J2ME) to program small devices, most of the international companies adopted it, abandoning the c++ language, because J2ME was easy ,interesting, and with a strong design. even the numbers of devices (mobiles) using java is more than the the number of computers using the system. And the Symbain who was producing the operating system in mobiles decided to use J2ME technologies and the operating system Symbain was generated which works with most mobiles Nokia, SonyEricsson. [3]
2. Related Work There are practical messaging services already in use that have taken some measures for security. Most of these messaging services rely on mobile network access security and Internet security technologies. The GSM authentication center (AUC) is used to authenticate each Subscriber Interface Module (SIM) card that attempts to connect to the GSM network. The authentication of the SIM depends on a shared secret key between SIM card and the AUC. This secret key is embedded into the SIM card during manufacture, and it is securely replicated into the AUC. The problem with GSM MAP is that it is an unencrypted protocol allowing employees within the mobile operator’s network to eavesdrop or modify SMS messages [4]. The only encryption involved during transmission is the encryption between the base transceiver station and the mobile terminal. Technologies used in mobile networks and the Internet do not cover each other. Thus, there is no end-to-end security. For mobile users and service providers, it is wiser to build an add on an end-to-end security layer on top of the network layer. In literature, most solutions use symmetric key cryptography to provide secure messaging. Croft et al make use of an approximated one-time pad scheme to encrypt SMS messages between two mobile phones [4]. Lo et al [5] point out the limitation in this mechanism – It does not ensure end-to end encryption between the two mobile phones because there is a decryption occurring within the mobile network so that another one-time pad can be created for the receiving phone to decrypt the message. Chikomo et al [6] propose a mobile banking security scheme which uses SMS as one means of this service. They design a secure SMS protocol to protect SMS communication. The scheme employs symmetric cryptography. The key used for encryption is generated from the one-time password entered by the user. The one-time passwords are only known by the server and the user. The server stores the onetime password in its database. The password is indexed by the account identifier and the sequence number. Thereafter, the server uses the retrieved password as the decryption key to decode the encrypted contents. If the decryption is successful, then the used one-time password is discarded and the server’s sequence counter for that account gets incremented by the value of 1.The authors claim the scheme provides confidentiality, integrity, authentication, and non-repudiation to mobile banking service using SMS. However, this scheme does not solve user-to-user secure communication problem.[7]
The encryption of SMS Using Playfair Technique. The idea of playfair cipher was first proposed by Charles Wheatstone in 1854 , but bears the name of Lord Playfair who promoted the use of the cipher. The technique encrypts pairs of letters (digraphs), instead of single letters as in the simple substitution cipher and rather more complex Vigenère cipher systems then in use. The Playfair is thus significantly harder to break since the frequency analysis used for simple substitution ciphers does not work with it. Frequency analysis can still be undertaken, but on the 600 possible digraphs rather than the 26 possible monographs. The frequency analysis of digraphs is possible, but considerably more difficult – and it generally requires a much larger ciphertext in order to be useful. [8]
3. Theory The best-known multiple-letter encryption cipher is the Playfair, which treats diagrams in the plaintext as single units and translates these units into cipher text diagrams. This cipher was actually invented by British scientist Sir Charles Wheatstone in 1854, but it bears the name of his friend Baron Playfair of St. Andrews, who championed the cipher at the British foreign office. [9] The Playfair algorithm is based on the use of a 5 x 5 matrix of letters constructed using a keyword monarchy. M
O
N
A
R
C
H
Y
B
D
E
F
G
I/J
K
L
P
Q
S
T
U
V
W
X
Z
Table 1. Playfair table. [9] In this case, the keyword is monarchy. The matrix is constructed by filling in the letters of the keyword (minus duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix with the remaining letters in alphabetic order. The letters I and J count as one letter as a table (1). Plaintext is encrypted two letters at a time, according to the following rules: 1. Repeating plaintext letters that are in the same pair are separated with a filler letter, such as x, so that balloon would be treated as ba lx lo on. 2. Two plaintext letters that fall in the same row of the matrix are each replaced by the letter to the right, with the first element of the row circularly following the last. For example, ar is encrypted as RM. 3. Two plaintext letters that fall in the same column are each replaced by the letter beneath, with the top element of the column circularly following the last. For example, mu is encrypted as CM. 4. Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and the column occupied by the other plaintext letter. Thus, HS becomes BP and EA becomes IM (or JM, as the enciphered wishes). [9] The Playfair cipher is a great advance over simple monoalphabetic ciphers. For one thing, whereas there are only 26 letters, there are 26 x 26 = 676 diagrams, so that identification of individual diagrams is more difficult. Furthermore, the relative frequencies of individual letters exhibit a much greater range than that of diagrams, making frequency analysis much more difficult. For these reasons, the Playfair cipher was for a long time considered unbreakable. It was used as the standard field system by the British Army in World War I and still enjoyed considerable use by the U.S. Army and other Allied forces during World War II.[10]
Despite this level of confidence in its security, the Playfair cipher is relatively easy to break because it still leaves much of the structure of the plaintext language intact. A few hundred letters of ciphertext are generally sufficient. One way of revealing the effectiveness of the Playfair and other ciphers is shown in Figure (1). The line labeled plaintext plots the frequency distribution of the more than 70,000 alphabetic characters in the Encyclopedia Britannica article on cryptology. [10] This is also the frequency distribution of any monoalphabetic substitution cipher. The plot was developed in the following way: The number of occurrences of each letter in the text was counted and divided by the number of occurrences of the letter e (the most frequently used letter). As a result, e has a relative frequency of 1, t of about 0.76, and so on. The points on the horizontal axis correspond to the letters in order of decreasing frequency. Figure (1) also shows the frequency distribution that results when the text is encrypted using the Playfair cipher. To normalize the plot, the number of occurrences of each letter in the ciphertext was again divided by the number of occurrences of e in the plaintext. The resulting plot therefore shows the extent to which the frequency distribution of letters, which makes it trivial to solve substitution ciphers, is masked by encryption. If the frequency distribution information were totally concealed in the encryption process, the ciphertext plot of frequencies would be flat, and cryptanalysis using ciphertext only would be effectively impossible. As the figure shows, the Playfair cipher has a flatter distribution than does plaintext, but nevertheless it reveals plenty of structure for a cryptanalyst to work with.
Figure1. Relative Frequency of Occurrence of Letters [9]
4. Result The following steps are used to apply the program:
Enter the programming language as in Fig. (2).
Figure 2
To build a project and enter data to it with the project name and the class as in Fig. (3).
Figure 3
Create an empty project file without the code as in Fig.(4).
Figure 4
After seeing the project special files we can go to the source file as in Fig.(5).
Figure 5
Build a new file with the same class name built at the beginning (play.java) and the same extension of the code file as in Fig. (6).
Figure 6
Proceed to the language to test the validity of the code written and execute the program, As in 'build' application we create text “Hello Sudan CS” which will work providing there are no syntax errors. Then we create Run as in Fig. (7).
Figure 7
Now open the application to test the code written previously as in Fig. (8).
Figure 8
Open the beginning of 'playfair' application as in Fig.(9).
Figure 9
Enter the text and by pushing menu we can choose to either cipher or decipher the text as in Fig.(10)
Figure 10
To cipher a written text we push on the cipher menu. For example the text “playfaircipher’’will then appear as “ qkeukfhsdhrfct’’ as in Fig. (11).
Figure 11
To decipher the encrypted text “ qkeukfhsdhrfct’’ use the decipher menu as in Fig.(12).
Figure 12
Now we can display the deciphered text “playfaircipher’’. To close the application, press "Exit" as in Fig. (13).
Figure 13
The application is then transferred to the mobilephone as in Fig. (14).
Figure 14
Change "Jtwi" to "Msa" from target platform as in Fig. (15).
Figure 15
Move the executing file to the mobile Jar file then we execute it inside the mobile. Can now use this application in the mobile on the SMS as in Fig. (16).
Figure 16
5. Conclusion In this paper, we applied the classical Playfair cipher on the mobile phone. The application includes how to execute the techniques on the computer and how to transfer them to a mobile phone. The algorithms governing the encryption and decryption are implemented in Java 2 Micro Edition language. We found that by using this application the proposed cipher is very strong and cannot be broken by any cryptanalytic attack. The analysis can be verified by using a plaintext of any size. The application has proven to be very effective even with low bandwidth or very low storage memory.
6. References 1.
Sing Li and Jonathan Knudsen, "Beginning J2ME: From Novice to Professional", Third Edition, 2005. 2. John Wiley & Sons Ltd, "Chichecter West the Atrium, Southern Gate Mobile Messaging Technologies and Services SMS, EMS and MMS", PO198SQ, England, Sussex, 2005. 3. Martin de Jode, "Programming Java 2 Micro Edition on Symbian OS", 2004. 4. N. Croft, M. Olivier, “Using an approximated One-Time Pad to Secure Short Messaging Service (SMS)”, in Proceedings of the Southern African Telecommunication Networks and Applications Conference (SATNAC), 2005, pp. 71–76. 5. H.Ratshinanga, J. LO, J. Bishop, “A Security Mechanism for Secure SMS Communication”, in South African Institute of Computer Scientists and Information Technologists (SAICSIT), 2004. 6. K.Chikomo, M. K. Chong, A. Arnab, A. Hutchison (2006), “Security of mobile banking”, University of Cape Town, South Africa, Tech. Rep. [Online]. Available: http://pubs.cs.uct.ac.za/archive/ 00000341/01/Security of Mobile Banking paper.pdf. 7. V.Raghavendra Prasad, M.Sunanda and V Maruthi Prasad,” Secure SMS with Identity Based Cryptography in Mobile Telecommunication Networks”, IJCST Vol. 2, Iss ue 4, Oct . - Dec. 2011 8. Smith, Michael Station X: The Codebreakers of Bletchley Park (1998, Channel 4 Books/Macmillan, London) ISBN 0 7522 2189 2. 9. William Stallings, "Cryptography And Network Security", 4th Edition (2005). 10. Simmons, G., "Cryptology Encyclopaedia Britannica", Fifteenth Edition, 1993.