<<

262 The International Arab Journal of Information Technology, Vol. 9, No. 3, May 2012

A Novel Secure Hash Algorithm for Public Schemes

Thulasimani Lakshmanan 1 and Madheswaran Muthusamy 2 1Department of Electronic and Communication Engineering, PSG College of Technology, India 2Department of Electronics and Communication Engineering, Muthayammal Engineering College, India

Abstract: Hash functions are the most widespread among all cryptographic primitives, and are currently used in multiple cryptographic schemes and in security protocols. This paper presents a new Secure Hash Algorithm called (SHA192). It uses a famous secure hash algorithm given by the National Institute of Standard and Technology (NIST).The basic design of SHA 192 is to have the output length of 192.The SHA192 has been designed to satisfy the different level of enhanced security and to resist the advanced SHA attacks. The security analysis of the SHA192 is compared to the old one given by NIST and gives more security and excellent results as shown in our discussion. In this paper the digital signature algorithm which is given by NIST has been modified using the proposed algorithms SHA192. Using proposed SHA192 hash algorithm a new digital signature schemes is also proposed. The SHA192 can be used in many applications such s public key , digital signcryption, , random generator and in security architecture of upcoming wireless devices like software defined radio etc.

Keywords: Data integrity, hash algorithm, digital signature, preimage, message digest, message authentication.

Received December 1, 2009; accepted August 10, 2010

1. Introduction attack (given a message M, find a message MM’ with H(M)=H(M’)). The SHA1 is required for use with the Cryptographic hash function plays an important role in digital signature algorithm as specified in Digital the world of cryptography. They are employed in many Signature Standard (DSS) and whenever a secure hash applications for digital signatures, message algorithm is required. Both the transmitter and authentication data integrity and key derivation. Secure intended receiver of a message in computing and Hash Algorithm (SHA1) specifies which generates verifying a digital signature uses the SHA1. It is condensed of message called message digest. Hash necessary to ensure the security of digital signature functions takes a message of variable length as input algorithm, when a message of any length is input, the and produce a fixed length string as output referred to SHA produces m bits output called Message Digest as hash code or simply hash of the input message. The (MD) [4, 5, 6]. The MD is then used in the digital basic idea of cryptographic hash function is use of hash signature algorithm. Signing the MD using the private code as compact and non ambiguous image of message key rather than the message often improved efficiency from which latter cannot be deduced. The term non of the process because the MD is usually much ambiguous refers to the fact that the hash code can be smaller than the message. The same MD should be as it was uniquely identifiable with the source message. obtained by the verifier using the user public key For this reason it is also called as digital finger print of when the received version of the message is used as the message. input to SHA. The hash functions [1, 2, 3] are classified into keyed In the recent years much progress has been made in and unkeyed hash function; the keyed hash functions the design of practical oneway hashing algorithms are used in the Message Authentication Code (MAC) which is efficient for implementation by both whose specification are dictates two distinct inputs a hardware and software. Noteworthy work includes the message and a secret key. The unkeyed hash function MD family which consist of three algorithms MD2, have there categories hash function based on block MD4, MD5 [2, 4], the federal information processing , modular arithmetic and customized hash standards for secure hash proposed by NIST [5]for the function. The hash functions have oneway property; past few years NIST designed the SHA family which given n and an input M, computing (M)=n, must be produce 160, 256, 384 and 512bit [6, 7, 8, 9]. SHA1 easy and given n. it is hard to compute M such that which produces message digest of 160bits long was H(M)=n. The type of attacks [1] are the the best established of existing SHA hash functions (find two message M=M’ with H(M)=H(M’), the and employed in several widely used security preimage attacks (given a random value Y, find a application and protocols. It has been identified that message M with H(M)=y) and the second preimage A Novel Secure Hash Algorithm for Public Key Digital Signature Schemes 263

security flaws in SHA1 in 2004 [4, 10], namely that a The modified SHA uses the padding algorithm, possible mathematical weakness might exist indicating breaking the message into 512 blocks and adding the that stronger hash function would be desirable. The aim length as a 64 bit number at end. The output of this research is to design a secure oneway hashing transformation is used in a final step to map the n bit algorithm of 192bit to enhance the security and resist to to variable length s m bits results called the MD. The advanced attacks such as preimage, second preimage following operations are used in the processing and all and collision attacks. Certain modifications are of theses acts on 32 bit word. introduced in the existing SHA1 algorithm to improve Λ;AND ¬¬ ; NOT ; V OR ; +XOR , +: mod2 the strength of security. The maximum security ^32 addition depends on the length of message digest generated by R –Right shit by n bits the hash functions which is limited by the size of input to the algorithm. It also shows how the modification is The word size and the number of rounds are same as done with satisfying the properties like compression, that of SHA1. The key characteristics of SHA 192 preimage resistance, and . The algorithm is shown in Table 1. simulation results show that proposed scheme provides Table 1. Key characteristics of SHA 192 algorithms. better security than the existing one. The simulated Word Output results of proposed SHA192 are analysed and used to Block Size Name Size Size Round (Bits) generate modified DSA. (Bits) (Bits) SHA-0 512 32 160 80 SHA-1 512 32 160 80 2. General model of Proposed SHA-192 SHA-192 512 32 192 80 (PROPOSED) The proposed SHA192 algorithm is similar to SHA1 algorithm. The SHA192 algorithm is similar in In order to increase the security aspects of the structure except that it has one an extra 32bit word, say algorithm the number message digest should be F. The elementary functional block processing of increased .To achieve this first, number of chaining message is shown in Figure 1. It is similar to SHA1 variables used initially is increased by one. Due to this message digest function, but it is little slower to execute number of bits generated by message digest is and presumably more secure. It produces a 192 bit considerably increased, which makes SHA1 more message digest as opposed to the 160 of the SHA1. complex in breaking than before. The modified The proposed SHA192 algorithm has three structure of SHA1 algorithm is given in Figure 1. processing steps: preprocessing, iterated processing and output transformation. The preprocessing step involves padding, parsing the padded message into m 3. SHA-192 pre processing bit block and setting initial values to be used in iterated Preprocessing is the step used to prepare the message processing. The iterating process has eighty steps in all before the SHA192 processing step. This contains the and in each step there is a elementary function which three steps: padding, parsing the padded message into calculates a message digest every time and sends it to blocks and setting initial hash values. the next step. And moreover there is no secure hash algorithm that gives a message digest size of greater • Padding the Message: The purpose of padding is to than 160 bits and less than 256 bits, so we have ensure that the padded message is multiple of 512. proposed a new hash algorithm that undergoes a If the length o the message M, is l bits it is append significant change in the elementary function of the the bit 1 to the end of the message followed by k secure hash algorithm and also gives us a message zero bits, where k is smallest, non negative solution digest of length 192 bits. to the equation l+1+k≡448 mod 512. To this append the 64bit block that is equal to the number l written in binary. • Parsing the Padded Message: Parse the message M into N 512 bits of blocks M1, M2……, MN. Each of the Mi parsed into 16, 32bit words Mi0, Mi1,……..Mi15. The message blocks are processed one at a time, beginning with the initials hash values called message digest buffer. • Setting Initial Hash Values: Before the hash function begins, the initial hash value H0 must be set. The hash is 192bits used to hold the intermediate and final results. The hash can be represented as six 32bit words registers Figure 1. Proposed SHA192 elementary function. A,B,C,D,E,F: A=67452301, B=EFCDAB8, 264 The International Arab Journal of Information Technology, Vol. 9, No. 3, May 2012

C=98BADCF, D=10325476, E=C3D2E1F0, images. The algorithm has been tested using a system F=40385172. with a pentium 4 processor and 512MB of RAM. Based on the simulation results, it was found that 4. SHA-192 Processing proposed SHA192 needs more time to generate a message digest when compared with SHA1 because The processing step depends upon expanded message the message digest generated by the pprosed algorithm block and compression function. In order to increase longer than the SHA1. the security level of the algorithm the size message For a simple message M=“abc,” the 8bit ASCII digest produced should be increased .To achieve this message “abc” has length e=24bits and it is given by first, number of chaining variables used initially is “01100001 01100010 01 100011”. It is padded with a increased by 32bits. Due to increase in input value the one “1,” so 24+1+k=448 mod 512 and then k=423 number of bits generated as message digest is also zero bits. Append the 64bit block that is equal to the considerably increased. Secondly the changes have number l written in binary “0000….011000” and then been introduced in round function. In this the number its length are 512bits added message which is shown of XOR operations performed is increased in order to in Table 2. make it more complex and in turn make it more secure. The number of times the round function being called is Table 2. SHA192 pre processing. increased. And the shifting of some of the chaining Padded 64- a b c 423 Zeros variable by 15bits and 30bits in each round. By moving Bits Bits the last block bits to the front followed by other 01100001 01100010 01100011 1 00000….0 0…..1 consecutive bits will increase the randomness in bit change in the next successive routines. The “abc” message has a single (N=1) 512bit The SHA192 hash computation uses functions and block, Parse the 512bits into 16, 32bit words constants previously defined exor operation is M(1), M(2) ,...... M (15) , (in hexadecimal): 61626380 performed after preprocessing is completed each 00000000 00000000 00000000 00000000 00000000 message block is processed in order using the following 00000000 00000000 00000000 00000000 00000000 steps: 00000000 00000000 00000000 00000000 00000018. These 16, 32 bit words are expanded to L 32bit 1. For i=1 to N { prepare the message schedule{}; Wt = Mti 0

C= ROTL30 (B) SHA-1 abc a9993e36 4706816a ba3e2571 7850c26c B= ROTL 15 (A) 9cd0d89d. F=T ba7816bf 8f01cfea 414140de 5dae2223 A=L SHA-192 abc b00361a3 96177a9c }

4. Compute the intermediate hash value H(i): H0(i) = A + H0(i1) (1) The sample text data say, “the quick brown fox H1(i) = B + H1(i1) (2) jumps over lazy dog” is given as input first time and H2(i) = C + H2(i1) (3) second the same data with slight modification i.e., by H3(i) = D + H3(i1) (4) making small change in the word “dog” as “mog” is H4(i) = E + H4(i1) (5) given as input next time. For this it generates the new H5(i) = F + H5(i1) (6) message digest which is entirely differ from the

The output transformation step is modular summation previous one. It shows that for the same data it will used to map the final output of the single compression produce different hash value. This is shown in Table function of n bits to the output length. 4. The proposed algorithm is tested with sample digital image data. The algorithm is tested with given 5. Experimental Results and Analysis digital images to generate the hash value. Some The hashing algorithms SHA1 and a newly proposed sample digital images like bridge images Figure 2 and SHA192 were tested based on the security and time camera man image Figure 3 are taken and hash values needed to generate message digests for the text data and are generated for these images. Similar as text data, A Novel Secure Hash Algorithm for Public Key Digital Signature Schemes 265

images also generate different hash value every time. Table 6. Hash computation SHA1 and proposed SHA192 algorithm for cameraman image. This shows that the proposed algorithm is highly secured The proposed algorithm can also be Hash Hashing Time in Message Digest implemented in hardware [13] so that it can be used in Algorithm Seconds transmission of medical image information system for 7DE2E230 providing authentication. DA78B34E SHA-1 25.563 432D15A3 D053F312 Table 4. Simulation results for text data. 5AD540CD

5CBF9937 Computation Sample Data Message Digest 7CC7F5E4 Time Inseconds A66F4DDE SHA-192 29.570 30A04E2F 2684DDEB 38AFD83C 5518D609 The Quick Brown 7B2A855 EF7218CF 4.4680 Fox Jumps over 2344452E Lazy Dog 2FD5E684 3F5B2678 6. Security Analysis of Proposed Algorithm 51D19353 1F2BEFCF Good hash functions have a strong ability to The Quick Brown 47FB6856 4.4540 Fox Jumps Over withstand all kinds of and attacks that 1BABEC86 Lazy Mog 9C760B1C try to break the system such as bruteforce analysis, 1B 3F 572C statistical analysis and collision attacks. Cryptanalysis of secure hash algorithm focuses on the internal structure of the iterated compression function and is based on attempts to find efficient techniques for producing collisions for a single execution of the compression function. The best way to find a collision pair is by using the . To measure the security strength of the SHA with 192 bit results, finding preimage or second old preimage attacks requires about bit operations and Figure 2. Bridge image. for collisions attack. The preimage and second image of proposed algorithm occurs at different rate Tables 5 and 6 Shows the hash computation time and which is greater than both SHA1. Standard attacks message digest generated for different images taken. on various hash functions are tabulated in Table 7.

Table 5. Hash computation SHA1 and proposed SHA192 Table 7. Attacks on standard hash function. algorithm for bridge image. Hash Author Type Complexity Year Hash Hashing Time in Algorithm Message Digest Algorithm Seconds Chabaud & Joux Collision 2^61(theory) 1998 Near Biham & Chen 2^40 2004 7ABADFF3 SHA-0 Collision 7B769FF8 Biham et al. Collision 2^51 2005 SHA-1 25.063 5F957149 Wang et al. Collision 2^39 2005 37065866 Biham et al. Collision 2^75 2005 SHA-1 63985BD7 Wang et al. Collision 2^63 2005 9CCEB8C1 SHA-192 None None None None A43D689F (Proposed) D343C37B SHA-192 27.703 CF581229 5178B5B9 7. Modified Digital Signature Standard E7BA381A using SHA192 Algorithm

The NIST has proposed the DSSA [11, 12] as the public standard for digital signature. The DSSA words. A Trusted Centre (TC) is assumed in DSSA and the role of TC are to select and use secure hash algorithm with the fixed output length, fixed structure and fixed additive constant publish system parameters for public usage. Digital signatures are used to detect unauthorized modifications to data and to authenticate the identity Figure 3. Cameraman Image. of the signatory. In addition, the recipient of signed

266 The International Arab Journal of Information Technology, Vol. 9, No. 3, May 2012 data can use a digital signature in proving to a third 7.3. Results and Discussions party that the signature was in fact generated by the signatory. This is known as nonrepudiation since the The modified DSA algorithm using proposed secure signatory cannot, at a later time, repudiates the hash algorithm is tested with sample data and the results are given below. signature. The Digital Signature Algorithm (DSA) is described in following sections. Hash message: Input message string to hash: > abc 7.1. DSA Signature Generation The hashed message is A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D, Generating primes p and q, p and q have been obtained: The signature of a message M is the pair of numbers r p=EE72B63E166458A57AC6071F806B36C77258F864211EC55C20EF44 and s computed according to the equations below: 3380B0EE0032BE9D97F012549981DB79216EB60E76472547A66F5F57 5AA9E63A9ACE67B77E6980985EAF81008F7C8C1C35BDA0E914801B4 k r = g mod p) mod q and (8) E86D3145EA4CC0B12FA920C24C7A3F3F77366E2B3FA6F677DF46D5

I C5D266112F291014ED6E5781A9ACC6D7D58E7 s =(k (SHA192(M)+xr)) mod q (9) q= 808DBCD4B8B85BFF6D7AE85EDE83B28641BEF4E9 I For certification purposes, the seed and counter values are: In the above, k is the multiplicative inverse of k, mod seed=1001111111100101110011001001110011100101111110100011011 I I q, i.e., (k k) mod q=1 and 0

>> u2 = ((r’) w) mod q (12) The proposed algorithm works efficiently in v = (((g) u1 (y) u2 ) mod p) mod q (13) generating digital signature for any kind of message. If v=r’ , then the signature is verified and the verifier can have high confidence that the received message 8. Conclusions was sent by the party holding the secret key x corresponding to y. For a proof that v=r’ when M’=M , This paper presents a new secure hash algorithm based r’=r , and s’=s , If v does not equal r’ , then the message on static structure algorithm called Secure Hash may have been modified, the message may have been Algorithm (SHA192). It uses a famous secure hash incorrectly signed by the signatory, or the message may algorithm (SHA1) given by the National Institute of have been signed by an impostor. The message should Standards and Technology (NIST). All NIST, SHA be considered invalid. have a fixed structure, fixed constant and fixed output length. With this structure it can provide many choices for practical applications with different level of e handed security to resist the advanced SHA attacks such as preimage, second preimage and collision attacks. The security analysis of SHA192 is A Novel Secure Hash Algorithm for Public Key Digital Signature Schemes 267

compared to old SHA1 given by the NIST and it gives Computers and Security , USA, pp. 131136, enhanced security and excellent results. The proposed 2006. SHA192 hashing algorithm has been observed to be [12] Rivest R., Shamir A., and Adleman L., “A better than the already existing SHA1 hashing Method for Obtaining Digital Signature and algorithm in terms of the number of brute force attacks PublicKey ,” Communication of needed to break it and moreover it is fast when The ACM , vol. 21, no. 2, pp. 120126, 1978. compared to the other secure hash algorithms. The [13] Sklavos N., Alexopoulos E., and Koufopavlou proposed method has advantage of portability on O., “Networking Data Integrity: High Speed mobile devices, which are currently embed Security Architectures and Hardware Implementations,” enhancement of proposed system is more than the The International Arab Journal of Information existing one but there the time delay is more since it Technology , vol. 1, no. 0, pp. 5459, 2003. generate 192bits of message digest. By using proposed [14] United States Department of Commerce, SHA192 a novel digital signature algorithm has also National Bureau of Standards, Data been proposed. Standard, Federal Information Processing Standards Publication, 1977. References [15] William S., Cryptography and Network Security, Principles and Practice , Prentice Hall of India, [1] Alfred M., Oorschot P., and Vanstone S., 2005. Handbook of Applied Cryptography , CRC press, 1997. Thulasimani Lakshmanan has [2] Bruce S., Applied Cryptography: Protocols, obtained her BE and ME degree Algorithms and Source Code in C , John Wiley from Coimbatore Institute of and Sons, Canada, 1996. Technology, India in 1998 and 2001 [3] Stallings W., Cryptography and Network respectively. She has started her Security Principles and Practices , Prentice Hall teaching profession in the year 2001 Press Upper Saddle River, 2010. in PSNA Engineering College, [4] Goldwasser S., Micali S., and Rivest R., “A Dindigul. At present she is an Lecturer in Department Digital Signature Scheme Secure Against of Electronic and Communication Engineering in PSG Adaptive ChosenMessage Attacks,” Journal on College of Technology, Coimbatore. She has Computing , vol. 17, no. 2, pp. 281308, 1988. published 4 research papers in international journals [5] Ilya M., “Hash Functions: Theory, Attacks, and and 4 papers in International conferences. She is a Applications,” in Proceedings of Microsoft part time research scholar in Anna University Research, Silicon Valley Campus, pp. 122, 2005. Chennai. Her areas of interest are wireless security, [6] National Institute of Science and Technology, networking and signal processing. She is a life “Secure Hash Standard,” Federal Information member of ISTE. Processing Standard 1801, available at: http:/ http://www.itl.nist.gov/fipspubs/fip1801.htm, last Madheswaran Muthusamy has visited 1995. obtained his PhD degree in [7] National Institute of Science and Technology, electronics engineering from “Secure Hash Standard,” Federal Information Institute of Technology, Banaras Processing Standard 1802, available at: Hindu University, Varanasi in 1999 http://www.itl.nist.gov/fipspubs/fip1801.htm, last and ME degree in microwave visited 2002. engineering from Birla Institute of [8] National Institute of Standards and Technology, Technology, Ranchi, India. He has started his teaching “Secure Hash Standard,” profession in the year 1991 to serve his parent “FIPSPUB180www.itl.nist.gov/fipspub/fips180 Institution Mohd. Sathak Engineering College, 1.html, last visited 2003. Kilakarai where he obtained his Bachelor Degree in [9] National Institute of Science and Technology, ECE. He has been awarded Young Scientist “Implementing Cryptography,” NIST SP 800, Fellowship by the Tamil Nadu State Council for available at: http://csrc.nist.gov/publications/ science and technology and Senior Research nistpubs/800211/sp800211_Dec2005.pdf, last Fellowship by Council for Scientific and Industrial visited 2005. Research, New Delhi in the year 1994 and 1996 [10] “New European Schemes for Signatures, respectively. He has published 120 research papers in Integrity and Encryption Project,” available at: International and National Journals as well as http://www.cryptonessie.org, last visited 2000. conferences. His field of interest includes semiconductor [11] Phan R. and Wagner D., “Security Consideration devices, microwave electronics, optoelectronics and for Incremental Hash Function Based on Pair signal processing. He is a senior member of IEEE, Blocking Chaining,” in Proceedings of Fellow of IETE, and IE and member of ISTE.