Design and Implementation of a Strong and Secure Lightweight Cryptographic Hash Algorithm using Elliptic Curve Concept: SSLHA-160

Cryptographic hash function assumes a fundamental job in numerous pieces of cryptographic algorithm and conventions, particularly in authentication, non-repudiation and information trustworthiness administrations. A cryptographic hash work takes a commitment of optional tremendous size message and conveys a fixed little size hash code as a yield. In the proposed work SSLHA-160 (a strong and secure lightweight cryptographic hash algorithm), each 512-digit square of a message is first diminished to 256-bit. A cryptographic hash work takes a contribution of discretionary enormous size message and delivers a fixed little size hash code as a yield. In the proposed work SSLHA-160 (A strong and secure lightweight cryptographic hash algorithm), each 512digit square of a message is first diminished to 256-bit and afterward partitioned into eight equivalent block of 32 pieces each and each 32-cycle block is additionally separated into two sub-block of 16-piece each. These two sub-blocks go about as two purposes of an elliptic curve, which are utilized for computing another point which is of 16 pieces. The new point esteems are thusly handled to produce message digest. SSLHA-160 is easy to develop, simple to actualize and displays solid torrential slide impact (avalanche), when contrasted with SHA1, RIPEMD160 and MD5. Keywords—Cryptography hash function; message digests; authentication; elliptic curve concepts


I. INTRODUCTION
Authentication is a significant idea in information security, and one method of accomplishing this by utilizing hash function. A Hash function is a mathematical function that maps a message of variable size into a small-length esteem called message digest. Message digest is likewise alluded to as a synopsis of the information or unique mark of the information. One direction hash function is a variation of the message authentication code. A single direction hash function, otherwise called a message digest, is a numerical function that takes a variable-length input string and converts it into a small-length arrangement that is computationally hard to alter-that is, going in back direction is impossible create the information from the hash. Hash code is created from all the pieces of the message any blunder in the message can without much of a stretch be distinguished from hash code as little change made in the message brings about huge modification in the hash code. Message confirmation and gadget verification can be accomplished through this hash code or message digest. Likewise message verification is said to secure the respectability of a message, for example the message that is gotten is showing up in a similar frame as send by the sender with no alteration done by clients with vindictive aim. With digital signature well source of messages can be verified. At the point when responsibility for computerized signature mystery key is bound to a particular client, a substantial digital signature gives an affirmation that the message was send by the right client. Sender validation gets significant in monetary and in light weight scenario. This paper is coordinated as follows. Area 2 gives a diagram of cryptographic hash capacities. In Area 3, proposes a strong and secure lightweight cryptographic hash algorithm SSLHA-160, planned dependent on elliptic curve ideas. Area 4 presents results and conversations. The investigation of SSLHA-160 is talked about in Area 5. Area 6 closes by indicating the straightforwardness of calculation.

II. OVERVIEW OF CRYPTOGRAPHIC HASH FUNCTION
Hash functions are as of now alluring subject of examination. Especially data security area consistently searches for new ways to deal with plan the safe hash capacities. There are endless hash works that have been created like (Venkateswara Rao Pallipamu, K Thammi Reddy,

D. The SHA Family
The Secure Hash Algorithm (SHA) was developed by the National Institute of Standards and Technology (NIST) and published in 1993. A revised version was issued as FIPS PUB 1809-1 in 1995 [5] [6]. This is generally referred as SHA-1. SHA is based on the MD4 algorithm. SHA works by taking care of a message as a bit string of length under 2 64 pieces, and creating a 160-piece hash esteem known as a message digest. Various version of SHA are SHA-0 (first form, but had loop hole [21], SHA-1 made by National Security Agency but had cryptographic flaw, SHA-2 and SHA-3 [16], [17], [18].

III. STRONG AND SECURE LIGHTWEIGHT CRYPTOGRAPHIC HASH ALGORITHM USING ELLIPTIC CURVE
(SSLHA-160) The proposed calculation is named as SSLHA-160. This calculation SSLHA-160 (A strong and secure lightweight cryptographic hash algorithm) accepts a message as contribution with a most extreme length of under 2 64 pieces and creates a 160-piece message digest as yield [10], [11]. First the info message is divided into squares of 512 pieces. This 512 pieces is taken as info, at that point the information is diminished from 512-digit squares to 256-bit blocks. The Hash code creation function acknowledges two sources of info which are 512 pieces square of the message and the initialize MD buffer (fastening variable 160-bits). The cycle comprises of the accompanying advances:

A. Append Cushioning Pieces
The message is cushioned so its length is consistent to 448 modulo 512 (length = 448 mod 512). Cushioning is constantly done, regardless of whether the message is of wanted length. Hence, the quantity of cushioning pieces is in the scope of 1-448. The cushioning comprises of a solitary 1 followed by the important number of 0's.

B. Append Length
A square of 64 pieces which contains the length of the message (prior to cushioning) is affixed to the message. This square is treated as an unsigned 64-bit number (most huge byte first).

C. Initialize MD Cushion
A 160-piece cushion is utilized to hold transitional and end-product of the hash work. The support can be spoken to as five 32-digit registers (S0, S1, S2, S3 and S4) .These registers are instated to the accompanying 32-bit numbers (Hexadecimal qualities): S0 = 67 45 23 01 S1 = ef cd ab 89 S2 = 98 ba dc fe S3 = 10 32 54 76 S4 = c3 d2 e1 f 0 These qualities are same as the underlying vector estimations of SHA-1 which are normalized by Federal Information Processing Standards Publications (FIPS PUBS). These qualities are put away in big endian design, which is the main byte of a word in the low-address byte position.

D. Processes Message in 512-Bit Blocks
The Hash code generation method comprises of five sub function. This part is named (H SSLHA -160) in Fig. 1 and its rationale is appeared in Fig. 2. Fig. 1 portrays the general preparing of message to create a message review [7]. The result of the initial two stages (after add cushioning pieces and attach size) outputs a message that is a number multiple of 512-piece long. The extended message is spoken to as the grouping of 512-cycle blocks X0, X1,X2 …X L-1 , so the complete size of the extended message is L × 512 pieces (L = the quantity of 512 bit blocks), that is the consequence of different of sixteen 32-bit blocks. Here K speaks to the genuine length of the message in pieces; "IV" is the underlying vector which is utilized to introduce the five 32cycle registers (S0, S1, S2, S3 and S4). VC1, VC2, … VCq… and VC L-1 speak to instate MD(carry vector) which holds middle of the road and eventual outcome of the Hash work, individually. Each round takes two information sources one 512-cycle block (Xq) of the message and a 160 piece convey vector (VCq). Toward the finish of the Lth stage produces 160 piece message digest. At first the given message is isolated into 512-digit blocks, and each square is passed to Hash Code creating function (H SSLHA ) as a contribution alongside the 160piece vector.  The Hash work (H ASSH 160) rationale is: Alteration function(A fn ) changes over the given 512-bit block into altered 256-digit block.
Concatenation function(C fn ) changes over the given 160piece vector into CONCATENATED 256-bit vector. 32-digit XOR operation(XOR op ) performs XOR procedure on each 32-pieces of changed 256-bit block and concatenated 256-bit vector.
Segregation and Modification operation(Sop) isolates the 256-bit block into 8 sub-block of 32-bits each and then each 32 bit block is separated into four 8-bit block, after that it modifies each eight bit block. This process is repeated for all 32 bit block.   Sop = 256-bit square can be isolated into 8 sub squares of 32-bits each and then each 32 bit block is separated into four 8-bit block, after that it modifies each eight bit block..
The qualities (xx1, yy1, xx2, and yy2 as appeared in Fig. 3) are changed over into whole numbers followed by computing a new point on elliptic curve. The above process is redone for remaining seven 32-bit block and the end result is 8 sub block each of 16 bits. Now each of this 8 sub block each of 16 bit is altered ,the first 8-bit of first block is XOR with a 8-bit sub block which are all zeros, the result is stored in first 8-bit sub block. The second 8-bit sub block of first block is added with first 8-bit sub block and result is stored in second 8-bit sub block and the process is repeated for all 8-bit sub block. The result is formatted 128 bit block. Now adjacent sub block each 16 bits are added which results in a sub block of 32 bit and we get four 32 bit sub block. By performing some mathematical operation on above four computed 32 bit sub block and then XOR them results in the fifth 32 bit sub block. This five 32 bit sub block when joined amounts to 160 bit and when added with initialized MD buffer forms the hash code. This 160 bit hash code will be the input to next 512 bit of message i.e. it will act as initialize MD buffer for next 512 bit of the input message. The last 160 bit code generated from last 512 bit of message will be the final hash code which will act as authentication code. www.ijacsa.thesai.org a) Alteration function(A fn ): Each 512-bit block of information is separated into 64 sub-blocks involving 8-pieces of each sub-block. One brief exhibit of size 8 (Tempx8[ ]) is taken and instated with zeroes. The modification work comprises of two sub functions as demonstrated as follows: Sub-function-1: Initially, the above aftereffect of Tempx8[ ] is XOR with the initial 8-pieces of the 512-bit block of message to create the initial 8-pieces of adjusted message. In resulting step this Tempx8[ ] is augmented by 1 and is XOR with the following 8-pieces of the message to create the following 8-pieces of altered message as spoken to in Fig. 4. Sub-function-2: The above result is again divided into sub block of 8 bits and 1st 8-bit sub block and middle 8-bit sub block after bitwise complimenting(~) are XOR and the result is again bitwise complimented(~) and stored in a separate array(W2). The above process is repeated for second 8-bit sub block and middle plus one 8-bit sub block and result is stored in second part of separate array(W2). This is repeated for all remaining 8-bit sub block. The result is 512 bit block is reduced to 256 bit block. The modified message as depicted below: int ModInp(vector<int> m, int n) { int i,j=0,p,q,k1,T=0; p=n; n*=64; The 160-piece Initial Vector (IV) is one of the contributions to the hash code creation function (H SSLHA ). It tends to be extended to 256-bits by connecting all underlying vector esteems in roundabout way, which is called Concatenated Vector (VC). The connection cycle is appeared in Fig. 5. c) 32-bit XOR operation (XORop): XOR activity is performed on initial 32-bit sub-squares of altered 256-cycle block and extended 256-bit block. For this first four 8-bit block are expanded and added so that it becomes 32 bit block. Then this 32-bit block is XOR with first 32-bit of expanded or initialize MD buffer of 256-bit block. This process is repeated for rest of the bits of modified 256-bit and expanded 256-bit block. The result is 256-bit block as shown below:

d) Segregation and Modification Operation(Sop):
Each 32-digit square of the above outcome is additionally partitioned into 2 sub-squares of 16-bits each. Then each 16bit block is separated into two 8-bit sub block, each of these eight bits are modified that is First the four bits are taken from the 8-bit value starting from least significant position then it is XOR with a variable1(km) whose value is zero, the result is kept in a variable2(km1) also the value of variable1(km) is updated i.e. it is given the value of variable2(km1). After completing the above step again from 8-bit value(input), four bits starting from most significant bit is stored in variable3(km2) and variable 3 is altered by performing a XOR www.ijacsa.thesai.org with variable1(km). The input i.e. 8-bit value is recomputed by storing the value of variable3(km2)(four bits starting from least significant position) in four bits starting from most significant position and next four bit of initial eight bit(input) stating from least significant position gets the bits from variable2(km1) (four bits starting from least significant position) so this way the 8-bit of input is modified . The same procedure is adopted for remaining three 8-bit values generated from 32 bit that is

e) New Point (on elliptic curve) Estimation Work (NPfn):
Each 32-bit block is separated into two sub blocks of same length. These sub blocks act as two points of a elliptic curve which are used in new point estimation in elliptic curve [8], [9], [15] as shown in Fig. 3. First by using two points slope of line is calculated the this slope value (M) is used in the calculation of new X and Y axis point on elliptic curve. The resultant new point is 16 bit value i.e X axis is 8 bits and Y axis is 8 bits so both taken together is 16 bit sub block. A total of 8 16-bit sub block are generated after new point calculation. Now this new points are modified by performing XOR on new points. Each 8-bit sub block is XOR with its adjacent 8-bit sub block except first 8-bit sub block which is XOR with a 8 bit sub block of all zeros. After above operation adjacent sub blocks are added in such a way that it becomes 32 bit sub block. Repeating this, results in four 32-bit sub block. Slope of line in elliptic curve (for Real) is calculated as where (xx1,yy1) and (xx2,yy2) are points on elliptic curve. New point on elliptic curve for reals are calculated using the following formula x3(new point) = (slope(λ))2 -xx1 -xx2 and y3(new point) = slope(λ) * (xx1-xx2) -yy1 the above formula is for the case when x1 != (not equal to) x2 (this is assumed that x1 is not equal to x2) f) Output: The 160-bit hash code is obtained by attaching four 32 bit sub block obtained in above process and the final 32-bit sub block is obtained by using the above four 32-bit sub block as shown below: 160-bit message digest = A + B + C + D + E All hexadecimal numbers are replicated into convey vector (or instate MD cushion), which is the message overview of a given message (if the message size is 512-bit block) in any case the above cycle is rehashed until the last 512-digit square of the message. Table I representation of input message before padding in hexadecimal and Table II representation of input message after padding in hexadecimal.  g) Alteration function (Afn): Tempx8 = 0 implies a brief exhibit instated with zeroes. XOR activity is performed on every 8-digit square of above advance with Tempx8 by one. First letter(I) decimal value 73 and hexadecimal equivalent is 49. Now 73 is XOR with Temp8 as shown below 73 binary form is 01001001 and temp8 is 00000000 so modified first8bit block is 01001001 ^ 00000000 = 01001001. Now Temp8 is incremented by 1 so it becomes 1 and next input decimal value is 32 and hexadecimal equivalent is 20. So the second 8-bit block is modified by XOR it with Temp8 i.e. 00100000 ^ 00000001 = 00100001(decimal equivalent 33) this is the value of second 8-bit sub block and Temp8 is incremented and XOR with third 8-bit sub block value and the process continues till last 8-bit sub block of 512-bit block.
Once the 512-bit block of message is altered it again subjected to modification i.e. the first 8-bit sub block value is complimented and XOR with complimented (mid+1)8-bit sub block value, the result is again complimented and stored in a separate array(W2). Then the second 8-bit sub block value is www.ijacsa.thesai.org complimented and XOR with complimented (middle+2)8-bit sub block value, the result is complimented and stored in the second location of array(W2) and the process continues for rest of 8-bit sub block value till first half of input message(after first step). The result is 512 bit block is reduced to 256 bit block. The modified message as depicted: The Alteration Step result  Fig. 6. This process is repeated for all 32 bit block. The Result is    where in A1 , B1 , A2 , B2 and result A3 , B3 are real numbers. The result A3 and B3 each of 16-bit sub block are altered, then adjacent A3 and B3 are added so that they amount to 32 bit and added with S0(initialize MD buffer) in circular manner to get first 32-bit of hash code of nth 512 bit of message. The process is repeated for other three 32-bit part of hash code. The last 32-bit of hash code is derived by performing some mathematical operation i.e. first 32-bit block A is bitwise complimented(~), the second 32-bit block B is bitwise left shifted by 5 bit, the third 32-bit block C is bitwise complimented(~)and the fourth 32-bit block D is first bitwise right shifted by 5 bit and then bitwise complimented(~) then all A,B,C and D are XORed as shown below.
For ex: If Elliptic curve new point is (8,12), then the binary form is and its modified form is shown below 8 in its binary form is 00001000 12 in its binary form is 00001100. 8 cycle XOR operation is as per the following: Step 1: Let AA1 be a array of size 8 and duplicate these qualities into AA1.
Tempx8 [ ] = {0, 0, 0, 0, 0, 0, 0, 0}; Step 3: Perform XOR operation on every 8-bits of AA1 and Tempx8: Step 4: Above operation results in 128 bits i.e. 8 sub block of 16 bits. Here two adjacent sub block are taken and added in such a way that the result is 32 bit sub block. the process is shown. The above process results in four 32-bit sub block. By using this four 32-bit sub block fifth 32 bit sub block is computed which is shown below: The result for the message -I am from Jabalpur working hard for kits singapur‖ is 3217f843 (AA) 53d9a622 (BB) ec1e23ad (CC) 1a7f09c6 (DD) 6c89d1e0 (EE) After computing AA , BB , CC , DD , EE , this values are added with individual 32 bits of initialize MD buffer (S0 , S1 , S2 , S3 , S4 ) to generate the new expended value for next 512 bit of the given message. The process is shown below AA = S0 = S0 + AA; BB = S1 = S1 + BB; CC = S2 = S2 + CC; DD = S3 = S3 + DD; EE = S4 = S4 + EE; AA, BB , CC , DD , EE values generated for last 512 bit of the given message will be the hash code for authentication.
The hash code for the message -I am from Jabalpur working hard for kits singapur‖ is d3cef4e1 0a4cb54f 84d900ab 1a7f09c5 97a1d6d1 IV. RESULTS AND DISCUSSION SSLHA-160, RIPEMD 160, MD5 and SHA-1 when implemented in and run on windows 7 32bit, processor 2.00 Giga Hz with 2 GB of internal memory.
Input String: -The student tried hard but failed in the exam‖.
When the given message is slightly changed, this results in huge alteration in the yield due to the avalanche effect, which is a property of Hash function. For example, when the word exam is changed to rxam i.e. a single letter is changed this produces a hash code which differs from the original hash code by 92 bit out of 160. www.ijacsa.thesai.org Input String: -The student tried hard but failed in the rxam‖.
Output (Hash Code): fab3ee1b facc7548 dc39da9e  0afec9be be86d00b   293967e0 :0010 1001 0011 1001 0110 0111 1110 0000  fab3ee1b : 1111 1010 1011 0011 1110 1110 0001 Table III shows the message digest produced by four algorithm (SSLHA160, SHA-1, RIPEMD160 amd MD5) for the message -The student tried hard but failed in the exam‖. The aftereffect of Table III is utilized for computing avalanche impact appeared in above Fig. 8. Table IV shows the adjustment in message digest when the message in Table III is modified for example exam is supplanted with dxam, SSLHA-160 produces a message digest with change of all hexadecimal qualities aside from 9,6 and c(starting from left shown in intense), SHA-1 yield is a hash code with change of all hexadecimal qualities aside from 5,7,e,f and 5(starting from left shown in intense) and RIPEMD 160 produces a message digest with change of all hexadecimal qualities aside from 8 and 5(starting from left shown in strong) and Table V shows the adjustment in hash code when the message in Table III is modified for example exam is supplanted with fxam, SSLHA-160 produces a message digest with change of all hexadecimal qualities aside from 2 and e(starting from left appeared in striking), SHA-1 yield is a hash code with change of all hexadecimal qualities aside from 3(starting from leftshown in intense) and RIPEMD 160 produces a message digest with change of all hexadecimal qualities aside from b,0,0 and 5(starting from left shown in strong). So on an average SSLHA-160 shows similar result when any character is changed. The result is better than SHA160 and RIPEMD160 as shown in Fig. 10. V. ANALYSIS OF SSLHA-160

A. Security Analysis
The hash work SSLHA-160 means to satisfy essentially two targets, one is solid avalanche impact and another is one way property (for example irreversible property of hash work). The difference in a digit will mirror the difference in the hash code by performing XOR activities as referenced in Alteration capacity and XOR activity. In any case, XOR is straight, and doesn't forestall differential assaults. Yet, change of single piece mirrors a great deal of progress in hash code (for our example 81 bit is changed). The one way property or irreversibility property of hash value is achieved by new point (on elliptic curve) estimation work as referenced in Section V. The One way property is clarified underneath: The yield of Section IV Segregation and modification activity (Sop) Each 32-cycle square of the above outcome is additionally partitioned into 2 sub-squares of 16-bits each. Each 16-bits are modified i.e. it is separated into 8-bit each then this 8-bit is altered, then this 8-bits goes about as a point in the elliptic curve, for example initial 8-bits go about as Xpivot worth and second 8-bits go about as Y-hub esteem. The with the this four 8-bit values a new point on elliptic curve is calculated , this new point is of 16-bits again it is partitioned into two 8-bits sub block and each 8-bit sub block value is modified. A similar system is followed for every one of the 32-bit blocks. Above way is adopted for calculating new point of remaining sub blocks and then modify it, after modifying the adjacent new point are added such that they becomes 32-bit sub block. Repeating the process for rest of modified new point's results in four 32-bit numbers. By using this four 32bit sub block i.e. performing some mathematical operation and XOR them results in fifth 32-bit sub block. The outcome is linked and changed over to hexadecimal structure. In this way, it shows the single direction(one way) property of SSLHA-160 hash calculation.
Assaults not related with the calculation are: Irregular assault-The likelihood of breaking this calculation is 1/2160, the quantity of trails and the expected values are the vital boundaries of this assault.
Birthday assault-The idea driving birthday assault came from a well-known issue from probability theory, which is called birthday paradox. By utilizing this idea assault on hash capacity can be outlined. On the off chance that the length of the Message digest is 160 pieces, at that point there are 2160 prospects. The Cryptanalyst produce two examples which are P1 and P2 from digest, the estimated likelihood of two examples is as per the following: Assaults related on the calculation are: Meet-in-the-middle assault-is a variant of the birthday assault, here aggressor endeavors to locate any two q1 and q2 with the end goal that their hash esteems are equivalent to y = h (q1) = h (q2). This assault is identified with discovering two people with a similar birthday. Let x be the probability that two person birthday are equal and x! be the probability that the birthdays are not equal. Then the probability is defined as Now suppose that there is only one person, then the probability that his birthday is not same with any one is 1. If there are two person then the probability that they have birthdays on different dates are 1 * 364/365(considering year to be of 365 days). Similarly if three persons are there then the probability that they have birthday on different dates is 1 * 364/365 * 363/365. If we calculate for 9 persons i.e. the probability that nine person have birthday on different dates are: 1 * 364/365 * 363/365 * 362/365 ------9Person When multiplied we get around 0.9 i.e. 90% which means that the probability that out of nine person two persons having birthday on same date is 10%. Going in the same way when we calculate probability for 23 person having birthday on different dates we get around 49.9% and the probability that two persons out of 23 having birthday on same date will be greater than 50%. One expects lower probability as there are 23*22/2 = 253 pairs of persons.
The birthday paradox can be utilized for assaulting hash capacities. An enemy produces q1 varieties of a sham message and q2 varieties of a veritable message; n is the quantity of Remedying block assault -The analyzer takes a message and its hash code on which he attempts to change the block a few times and notices the summary(digest) remaining parts same or not.
Differential assault -The rule of an assault is the investigation of social contrasts among information and yield. An impact happens if the difference is zero.

B. Performance Analysis
These three calculations SSLHA-160, SHA1 and MD5 were tried for comparison dependent on the execution time necessities as shown in Fig. 11, Fig. 12 and Fig. 13. All the calculations have been actualized in C/C++ and run on windows 7 32-bit, CPU 2.00 GHz with 2 GB of internal memory. With the aftereffects of the analysis, it was discovered that SHA1 and MD5 requests more execution time than SSLHA160 to create hash code.
The result in above Fig. 14 demonstrates time taken by three algorithm (SSLHA160, SHA1, and MD5) for generating message digest for the message -I am from Jabalpur working hard for kits singapur‖.

VI. CONCLUSION
The necessity for new hash plans is expanding to make security viewpoints solid, for example, validation, message honesty and secrecy as for present status of web as web conditions are much of the time evolving. The specialists in cryptography should invest solid energy to concoct better plan measures utilizing which long haul and powerful security can be given by hash capacities. The proposed hash work, A strong and secure lightweight cryptographic hash algorithm (SSLHA-160) is created utilizing elliptic curve ideas which is contrasted with different cryptographic hash capacities. The center qualities of SSLHA-160 are XOR activities, bitwise compliment , bitwise left and right shift and new point estimation(for elliptic curve), which bring about solid nonlinear avalanche impact, expanded dispersion in yield and make differential assaults troublesome. Consequently it is safer and simple.