International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 5, May - 2013 Symmetric Key Cryptography Algorithm Using Complement For Small Data Security N. Bhaskar Asst.professor, CMR Technical Campus Abstract cryptographic systems to send military messages to his generals. During data transmission between the source and the destination in computer network, the data is exposed to Cryptography is the science of using mathematics to external modifications with malicious intentions. In encrypt and decrypt data. Cryptography enables you to today’s world, most of the means of secure data and store sensitive information or transmit it across code storage and distribution rely on using insecure networks (like the Internet) so that it cannot be cryptographic schemes such as certificates or read by anyone except the intended recipient. While encryption keys. Cryptography is widely used to protect cryptography is the science of securing data, sensitive data from unauthorized access and cryptanalysis is the science of analyzing and breaking modifications while on transit. There are two basic secure communication. Classical cryptanalysis involves types of cryptography: i. Symmetric key and ii. an interesting combination of analytical reasoning, RT Asymmetric key algorithms. Symmetric algorithms are application of mathematical tools, pattern finding, the quickest and most commonly used type of patience, determination, and luck. Cryptanalysts are encryption. Here, a single key is used for both also called attackers. Cryptology embraces both IJE encryption and decryption. There are few well-known cryptography and cryptanalysis. symmetric key algorithms i.e. DES, IDEA, AES, RC2, RC4 etc. In this paper, a new symmetric key algorithm A cryptographic algorithm, or cipher, is a mathematical is proposed. The advantages of this new algorithm are function used in the encryption and decryption process. also explained. A cryptographic algorithm works in combination with a key—a word, number, or phrase—to encrypt the plaintext. The same plaintext encrypts to different Keywords: Information Security, Encryption, ciphertext with different keys. The security of Decryption, Symmetric key, Cryptography, encrypted data is entirely dependent on two things: the Confidentiality, Integrity. strength of the cryptographic algorithm and the secrecy of the key. A cryptographic algorithm, plus all possible keys and all the protocols that make it work comprise a 1. Introduction cryptosystem. During this time when the Internet provides essential communication between tens of millions of people and 2. Brief History of Cryptography is being increasingly used as a tool for commerce, security becomes a tremendously important issue to Cryptography, the science of encrypting and decrypting deal with. There are many aspects to security and many information, dates as far back as 1900 BC when a applications, ranging from secure commerce and scribe in Egypt first used a derivation of the standard payments to private communications and protecting hieroglyphics of the day to communicate.[2] There are passwords. many notable personalities who participated in the evolution of Cryptography. For example, “Julius One essential aspect for secure communications is that Caesar (100-44 BC) used a simple substitution with the of Cryptography. The concept of securing messages normal alphabet (just shifting the letters by 3 positions) through cryptography has a long history. Indeed, Julius in government communications”, [2] and later, Sir Caesar is credited with creating one of the earliest Francis Bacon in 1623, who described a cipher is known today as a 5-bit binary encoding. He advanced it as a steganographic device by using variation in type www.ijert.org 1555 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 5, May - 2013 face to carry each bit of the encoding”. For all the standard named International Data Encryption historical personalities involved in the evolution of Algorithm (IDEA). This algorithm was designed to Cryptography, it is William Frederick Friedman, work more efficiently with “general purpose” founder of Riverbank Laboratories, cryptanalyst for computers used by everyday households and the US government, and lead code-breaker of businesses. Concerned by the proliferation of Japan‟s World War II Purple Machine, who is cryptography, the FBI renewed its effort to gain “honored as the father of US cryptanalysis”. In access to plaintext messages of US citizens. In 1918 Friedman authored The Index of Coincidence response, Phil Zimmerman released his first and Its Applications in Cryptography, which is still version of Pretty Good Privacy (PGP) in 1991 as a considered by many in this field as the premiere freeware product, which uses the IDEA algorithm. work on cryptography written this century. PGP, a free program providing military-grade algorithm to the internet community, has evolved During the late 1920s and into the early 1930s, the into a cryptographic standard because of such US Federal Bureau of Investigation (FBI) widespread use. The initial versions of PGP were established an office designed to deal with the geared towards the more computer literate increasing use of cryptography by criminals. At individual, but to the individual nonetheless. Phil that time the criminal threat involved the Zimmerman could be compared to Henry Ford in importation of liquor. According to a report written his efforts to provide PGP to every home by in the mid-1930s by Mrs. Elizabeth Friedman, a making it free, and therefore, affordable. Today, cryptanalyst employed by the US government like PGP's updated version is offered free to the public. her husband, William F. Friedman, the In 1994, Professor Ron Rivest, co-developer of cryptography employed by bootleggers. Although RSA cryptography, published a new algorithm, cryptography was employed during World War I, RC5, on the Internet. It had been claimed that RC5 two of the more notable machines were employed is stronger than DES. [2] during World War II: the Germans‟ Enigma machine, developed by Arthur Scherbius, and the 3. Cryptography Japanese Purple Machine, developed using techniques first discovered by Herbert O. Yardley. Data that can be read and understood without any RT special measures is called plaintext or clear-text. In the 1970s, Dr. Horst Feistel established the The method of disguising plaintext in such a way precursor to today‟s Data Encryption Standard as to hide its substance is called encryption. (DES) with his „family‟ of ciphers, the „Feistel IJE Encrypting plaintext results in unreadable gibberish ciphers‟, while working at IBM‟s Watson Research called ciphertext. The process of reverting cipher- Laboratory. In 1976, The National Security Agency text to its original plaintext is called decryption. (NSA) worked with the Feistel ciphers to establish FIPS PUB-46, known today as DES. Today, triple- Within the context of any application-to- DES is the security standard used by U.S. financial application communication, there are some specific institututions. Also in 1976, two contemporaries of  Authentication: The process of proving one's security requirements, including: Feistel, Whitfield Diffie and Martin Hellman first introduced the idea of public key cryptography in a identity. (The primary forms of host-to-host publication entitled "New Directions in authentication on the Internet today are name- Cryptography". Public key cryptography is what based or address-based, both of which are PGP, today's industry standard, uses in its software.  Privacy/confidentiality: Ensuring that no one notoriously weak.). In the September, 1977 issue of The Scientific American, Ronald L. Rivest, Adi Shamir and can read the message except the intended Leonard M. Adleman introduced to the world their  Integrity: Assuring the receiver that the receiver. RSA cipher, applicable to public key cryptography and digital signatures. The authors offered to send received message has not been altered in any their full report to anyone who sent them self-  Non-repudiation: A mechanism to prove that way from the original. addressed stamped envelopes, and the ensuing international response was so overwhelming the NSA balked at the idea of such widespread the sender really sent this message. distribution of cryptography source code. In a typical situation where cryptography is used, In the mid-1980s ROT13 was employed by two parties (X and Y) communicate over an USENET groups to prevent the viewing of insecure channel. X and Y want to ensure that their “objectionable material [by] innocent eyes”, and communication remains incomprehensible by soon thereafter, a 1990 discovery by Xuejia Lai and anyone who might be listening. Furthermore, James Massey proposed a new, stronger, 128-bit because X and Y are in remote locations, X must key cipher designed to replace the aging DES be sure that the information she receives from Y has not been modified by anyone during www.ijert.org 1556 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 5, May - 2013 transmission. In addition, she must be sure that the cryptography is provided with Public Key System information really does originate from Y and not only. someone impersonating Y. 4. Types of Cryptography Cryptography is a process which is associated with scrambling plaintext (ordinary text, or cleartext) into ciphertext (a process called encryption), then back again (known as decryption). There are several ways to classify the various algorithms. The most common types are i) Secret Key Cryptography which is also known as Symmetric Key Cryptography and ii) Public Key Cryptography which is also known as Asymmetric Key Cryptography. Fig 1: Cryptography concept In other words, if the same key is used for encryption and decryption, we call the mechanism as Symmetric Key Cryptography. However, if two Cryptography is used to achieve the following different keys are used in a cryptographic goals: mechanism, wherein one key is used for encryption, and another, different key is used for 3.1. Confidentiality decryption; we call the mechanism as Asymmetric Key Cryptography. This is shown in Figure 2 [2]. To ensure data remains private. Confidentiality is usually achieved using encryption. Encryption algorithms (that use encryption keys) are used to RT convert plain text into cipher text and the equivalent decryption algorithm is used to convert the cipher text back to plain text. Symmetric encryption algorithms use the same key for IJE encryption and decryption, while asymmetric Fig 2: Cryptography techniques algorithms use a public/private key pair. 4.1. Secret key cryptography 3.2. Data integrity In secret key cryptography, a single key is used for To ensure data is protected from accidental or both encryption and decryption. As shown in deliberate (malicious) modification. Integrity is Figure 3, the sender uses the key (or some set of usually provided by message authentication code or rules) to encrypt the plaintext and sends the hashes. A hash value is a fixed length numeric ciphertext to the receiver. The receiver applies the value derived from a sequence of data. Hash values same key to decrypt the message and recover the are used to verify the integrity of data sent through plaintext. Because a single key is used for both insecure channels. The hash value of received data functions, secret key cryptography is also called is compared to the hash value of the data as it was symmetric encryption. With this form of sent to determine if the data was altered. cryptography, it is obvious that the key must be known to both the sender and the receiver; that, in 3.3. Authentication fact, is the secret. The biggest difficulty with this approach, of course, is the distribution of the key To assure that data originates from a particular [5]. party. Digital certificates are used to provide authentication. Digital signatures are usually applied to hash values as these are significantly smaller than the source data that they represent. 3.4. Non reputation This gives assurances to the receiver of a message that it actually came from the sender and no one is faking the identity of the sender. This function of www.ijert.org 1557 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 5, May - 2013 everything above and beyond the one byte) are  Output Feedback (OFB) mode is a block cipher Fig 3: Secrete key algorithm discarded. Secret key cryptography schemes are generally implementation conceptually similar to a categorized as being either stream ciphers or block synchronous stream cipher. OFB prevents the ciphers. Stream ciphers operate on a single bit (byte same plaintext block from generating the same or computer word) at a time, and implement some ciphertext block by using an internal feedback form of feedback mechanism so that the key is mechanism that is independent of both the constantly changing. plaintext and ciphertext bitstreams. A block cipher is so-called because the scheme The most common secret-key cryptography scheme encrypts one block of data at a time using the same used today is the Data Encryption Standard (DES), key on each block. In general, the same plaintext designed by IBM in the 1970s and adopted by the block will always encrypt to the same ciphertext National Bureau of Standards (NBS) [now the when using the same key in a block cipher whereas National Institute for Standards and Technology the same plaintext will encrypt to different (NIST)] in 1977 for commercial and unclassified ciphertext in a stream cipher [1].Stream ciphers government applications. DES has been adopted as come in several flavors but two are worth Federal Information Processing Standard 46 (FIPS mentioning here. Self-synchronizing stream ciphers 46- 3) and by the American National Standards calculate each bit in the keystream as a function of Institute as X3.92). DES is a blockcipher the previous n bits in the keystream. It is termed employing a 56-bit key that operates on 64-bit "self-synchronizing" because the decryption blocks [2]. process can stay synchronized with the encryption process merely by knowing how far into the n-bit There are a number of other secret-key keystream it is. Synchronous stream ciphers cryptography algorithms that are also in use today generate the keystream in a fashion independent of like CAST-128 (block cipher), RC2 (block cipher) the message stream but by using the same RC4 (stream cipher), RC5 (block cipher), Blowfish keystream generation function at sender and (block cipher), Two fish (block cipher). In 1997, RT receiver. While stream ciphers do not propagate NIST initiated a process to develop a new secure transmission errors, they are, by their nature, cryptosystem for U.S. government applications. periodic so that the keystream will eventually The result, the Advanced Encryption Standard IJE repeat. (AES), became the official successor to DES in December 2001. Block ciphers can operate in one of several modes;  Electronic Codebook (ECB) mode is the the following four are the most important: 4.2. Public key cryptography simplest, most obvious application: the secret Public or asymmetric key cryptography involves key is used to encrypt the plaintext block to form the use of key pairs: one private key and one public a ciphertext block. Two identical plaintext key. Both are required to encrypt and decrypt a blocks, then, will always generate the same message or transmission. The private key, not to be ciphertext block. Although this is the most confused with the key utilized in private key common mode of block ciphers, it is susceptible cryptography, is just that, private. It is not to be  Cipher Block Chaining (CBC) mode adds a to a variety of brute-force attacks. shared with anyone. The owner of the key is responsible for securing it in such a manner that it feedback mechanism to the encryption scheme. will not be lost or compromised. On the other hand, In CBC, the plaintext is exclusively-ORed the public key is just that, public. Public key (XORed) with the previous ciphertext block prior cryptography intends for public keys to be to encryption. In this mode, two identical blocks accessible to all users. In fact, this is what makes  Cipher Feedback (CFB) mode is a block cipher of plaintext never encrypt to the same ciphertext. the system strong. If a person can access anyone public key easily, usually via some form of implementation as a self-synchronizing stream directory service, then the two parties can cipher. CFB mode allows data to be encrypted in communicate securely and with little effort, i.e. units smaller than the block size, which might be without a prior key distribution arrangement. useful in some applications such as encrypting Figure 4 describes the Public Key Cryptography interactive terminal input. If we were using 1- [3]. byte CFB mode, for example, each incoming character is placed into a shift register the same size as the block, encrypted, and the block transmitted. At the receiving side, the ciphertext is decrypted and the extra bits in the block (i.e., www.ijert.org 1558 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 5, May - 2013  Digital Signature Algorithm (DSA): The algorithm specified in NIST's Digital Signature Standard (DSS), provides digital signature  ElGamal: Designed by Taher Elgamal, a PKC capability for the authentication of messages. system similar to Diffie-Hellman and used for  Elliptic Curve Cryptography (ECC): A PKC key exchange. algorithm based upon elliptic curves. ECC can offer levels of security with small keys comparable to RSA and other PKC methods. It was designed for devices with limited compute power and/or memory, such as smartcards and  Public-Key Cryptography Standards (PKCS): A Fig 4: Public key algorithm PDAs. Public key cryptography depends upon the set of interoperable standards and guidelines for existence of so-called one-way functions, or public-key cryptography, designed by RSA Data mathematical functions that are easy to compute  Cramer-Shoup: A public-key cryptosystem Security Inc. whereas their inverse function is relatively difficult to compute. Let me give you two simple examples: proposed by R. Cramer and V. Shoup of IBM in  Multiplication vs. factorization: Suppose I tell  Key Exchange Algorithm (KEA): A variation on 1998. you that I have two prime numbers, 3 and 7, and Diffie-Hellman; proposed as the key exchange that I want to calculate the product; it should take  LUC: A public-key cryptosystem designed by method for Capstone. almost no time to calculate that value, which is 21. Now suppose, instead, that I tell you that I P.J. Smith and based on Lucas sequences. Can be have a number, 21, and I need you tell me which used for encryption and signatures, using integer pair of prime numbers I multiplied together to RT factoring. obtain that number. You will eventually come up with the solution but whereas calculating the product took milliseconds, factoring will take 5. Proposed Algorithm IJE longer. The problem becomes much harder if I In this section, we propose a new symmetric key start with primes that have 400 digits or so, algorithm that works with binary multiplication and  Exponentiation vs. logarithms: Suppose I tell you because the product will have ~800 digits. division properties. It is restricted to 8-bit registers to store and maintain the binary data. that I want to take the number 3 to the 6th power; again, it is relatively easy to calculate 36 = 729. But if I tell you that I have the number 729 and want you to tell me the two integers that I used, x and y so that logx 729 = y, it will take you longer 5.1. Encryption Algorithm to find the two values. The entire process of encryption algorithm consists Public-key cryptography algorithms that are in use of the following steps. It implements stream cipher today for key exchange or digital signatures technique. include: Step I: Accept the plain text letter.  RSA: The first, and still most common, public key cryptography implementation, named for the Step II: Generate the ASCII value of the letter. three MIT mathematicians who developed it — Ronald Rivest, Adi Shamir, and Leonard Step III: Convert ASCII value into binary format Adleman. RSA today is used in hundreds of [which is 8-bit long, because the number of software products and can be used for key permitted ASCII letters is 256 only, i.e., 2 8 = 256, exchange, digital signatures, or encryption of for eg., the ASCII value 32 can be represented as small blocks of data. RSA uses a variable size 00100000 (underlined zeros are required)].  Diffie-Hellman: After the RSA algorithm was encryption block and a variable size key. Step IV: Do 2‟s complement of that binary published, Diffie and Hellman came up with their number. own algorithm. D-H is used for secret-key key exchange only, and not for authentication or Step V: Reverse the binary number. digital signatures. www.ijert.org 1559 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 5, May - 2013 Step VI: Take 10 as a secret key for encryption. Multiply that key with 2‟s complemented reversed Step I: The cipher text comes as a hexadecimal binary number. format that is 34; this result will be converted into binary format. Step VII: The result comes from multiplication with secret key, the result will be converted into 0 0 1 1 0 1 0 0 hexadecimal format. It gives cipher text. Step II: Take 10 as a secrete key for decryption 5.2. Decryption Algorithm and the result will be divided by the secrete key. Step I: The cipher text comes as a hexadecimal 0 0 1 1 0 1 0 format, the result will be converted into binary format. Step III: Reverse the binary number after divided by secret key. Step II: Take 10 as a secrete key for decryption and the result will be divided by the secrete key. 0 1 0 1 1 0 0 Step III: Reverse the binary number after divided Step IV: Do 2‟s complement of the reversed binary by secret key. number. Step IV: Do 2‟s complement of the binary number. 1 0 1 0 1 0 0 Step V: Convert the 2,s complement result into Step V: Convert the 2,s complement result into decimal format. decimal format. That is 84. Step VI: Take the ASCII value of that decimal format and convert the given ASCII value into Step VI: Take the ASCII value of that decimal alphabet which is original plain text. format and convert the given ASCII value into RT alphabet which is original plain text. 5.3. Practical Example Alphabet is T. IJE 5.3.1. Encryption Step I: Let the accepted letter be “T”. 6. Advantages of Proposed Algorithm 1. This Algorithm implementation and using is very Step II: ASCII value of the letter “T” is 84. simple. 2. There are two reverse and 2‟s complement Step III: The binary value of 84 is 1010100. operations present in this algorithm which would make it more secured. Step IV: Do 2‟s complement of that binary 3. CRC checking in receiving ends is easier. number. 4. This algorithm is most suitable for small amount of data. 0 1 0 1 1 0 0 Step V: Reverse the binary number. 7. Conclusion 0 0 1 1 0 1 0 Cryptography is used to achieve few goals like Confidentiality, Data integrity, Authentication etc. Step VI: Take 10 as a secret key for encryption. of the data which has sent to the receiver from the Multiply that key with 2‟s complemented reversed sender. Now, in order to achieve these goals binary number. various cryptographic algorithms are developed by various people. It has been found that the algorithms which are available at this moment are 0 0 1 1 0 1 0 0 more or less difficult or complex in nature, and of- course it is quite obvious. Because those algorithms Step VII: Whatever the result comes from are used to maintain high level of security against multiplication with secret key, the result will be any kind of forgeries. For a very minimal amount converted into hexadecimal format. The result is 34 of data those algorithms wouldn‟t be cost effective which is ciphertext. since those are not designed for small amount of data. It has been found that the present algorithms 5.3.1. Decryption www.ijert.org 1560 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 5, May - 2013 are more or less difficult or complex in nature and 10. Author not cost-effective. The study aimed at design and implementing a new algorithm to address this issue. Keeping this goal in mind, the proposed algorithm has been designed in a quite simple manner. A single key is used for both encryption and decryption, i.e., it has fallen under secret key cryptographic algorithm. The proposed algorithm is very simple in nature. The entire process depends on binary division, multiplication, 2‟s compliment N. Bhaskar and reverses which give better security. Further, the CRC checking at receiving end is easier. Finally, Asst.Professor we claim that for a small amount data, the CSE Department algorithm works very effectively in very less time. CMR Technical Campus Kandlakoya, Medchal Road 8. Acknowledgement Hyderabad, India. The successful completion of any task would be incomplete without expression of simple gratitude to the people who encouraged our work. Though words are not enough to express the sense of gratitude towards everyone who directly or indirectly helped in this task. I thankful to this organization CMR Technical Campus, which provided good facilities to accomplish my work and would like to sincerely thank to our Management, Director Dr. A. Raji Reddy, Dean Dr. A. Ravi Purna Chandra Rao, HOD K. Srujan Raju, RT my colleagues and parents for giving great support, valuable suggestions and guidance in every aspect of my work. IJE 9. References 1) S. William, Cryptography and Network Security: Principles and Practice, 2nd edition, Prentice-Hall, Inc., 1999 pp 23-50. 2) S. Hebert, “A Brief History of Cryptography”, an article available at http://cybercrimes.net/aindex.html 3) Fundamentals of Computer Security, Springer publications “Basic Cryptographic Algorithms”, an article available at www.itsc.state.md.us/oldsite/info/InternetSecurity/C rypto/CryptoIntro.htm#Algorithms 4) Andrew S Tanenbaum (2003), Fundamental of Computer Networks, 4th Edition, Pearson Education Asia Ltd., ISBN:0-13-046002-8. 5) “Introduction to Public-Key Cryptography”, an article available at developer.netscape.com/docs/manuals/security/pkin/ content.htm 6) K. Gary, “An Overview of Cryptography”, an article available at www.garykessler.net/library/crypto.html 7) Computer and Network security by ATUL KAHATE 8) S. Goldwasser and S. Micali, "Probabilistic Encryption", Journal of Computer and System Sciences, Vol 28, 1994 pp 270-299. www.ijert.org 1561