Omega Network Hash Construction

,


INTRODUCTION
Cryptography is becoming more and more important for ensuring various types of security over insecure connections. Among data security primitives, data integrity check and data origin authentication are the common security services that must be applied in many electronic applications, such as electronic commerce, electronic financial transactions, software distribution, electronic mail, data storage and others. Data integrity check is accomplished through the use of cryptographic hash functions, which operate at the root of many other cryptographic methods in achieving these security services.
The basic operation of a hash function is to transform a variable-size input or message into a fixedlength string called a "hash value" or "message digest." A hash value is generated by a function H of the form H(M) = n, where n is the hash value and M is the variable-length input or message. Hash functions are one-way functions; it is easy to generate the digest n from a given message M, but given only n, it is computationally infeasible to generate M. Hash functions are designed to produce unambiguous and condense message digests that are uniquely identifiable with their source messages. However, the source messages cannot be deduced from the message digests and for this reason, the hash function is sometimes known as a digital fingerprint. The architecture of most hash functions is based on the Merkle-Damgård construction [2,3,5,8] (Fig. 1), which is sequential in nature. This means that when the size of the input increases, the computational time will increase linearly. Each step in the Merkle-Damgård construction processes a message block and returns a vector. The first vector is pre-defined, but the remaining vectors are fully dependent on the previous function's output, which slows down the runtime. This in turn has a major effect on the performance of a hash function, SHA, for example. Therefore, there is a need to enhance the performance and efficiency of hashing.
This research proposes the omega network hash construction as an alternative hashing architecture to the Merkle-Damgård construction. Because of the sequentially and the functions for SHDSA also executed sequentially. The performance is affected; the execution time will increase linearly and reach the highest degree of throughput when the size of input is high. The high speed requirement of SHDSA is highly needed, which is why SHDSA should be parallelized.
Once again, in 2008, Elkamchouchi et. al. [3] proposed another secure and fast algorithm called SFHA-256. This one was specifically designed for SHA-256. It is based on the 3C construction, which is based on the Merkle-Damgård construction. The author claims that the proposed architecture is more secure and performs better than the existing SHA-256. He claims that performance is better because the number of operations performed in a step function is reduced and because the architecture consists of two branches running in parallel. SFHA-256 has fewer processing steps, but it is still secure because each step function contains operations that make it difficult for attackers to analyze SFHA-256. The added operations are simple XOR, addition and shift rotation operations. However, performance still suffers due to the waiting time that occurs during the processing of hash values.
Gauravaram et al. [5] proposed the 3C+ hash construction which is based on the Merkle-Damgård construction. This 3C+ construction is an enhancement of 3C construction where a third internal chain has been added on top of the cascade and accumulation chains of 3C. With this enhancement, the security level of 3C+ is better than both 3C construction and the Merkle-Damgård construction. 3C+ contains more XOR operations which also improves its security. However, in this new algorithm, there exist conditions where the hashing functions are required to wait for the input from the previous hash function. Moreover, the whole construction is sequential. Thus, waiting times can be extremely high in the 3C+ construction.
Mirvaziri et al. [8] came up with an enhancement to the Merkle-Damgård construction by developing a single-length compression function implemented on the Miyaguchi-Preneel block cipher. The architecture has intelligent repetition optimize hash process, which leads to better security. Though the architecture is designed in double levels, it runs sequentially across the message, which means its computation time increases linearly when the input size increases.
In conclusion, most of the proposed architectures run sequentially, which means the computation time increases linearly when the input size increases. Given that multi-core technology and multithreaded programming are common in today's world, these architectures are unacceptably slow.

MATERIALS AND METHODS
Five different sizes of omega network are designed-omega network hash construction 8 (Fig. 2), omega network hash construction 16 (Fig. 3), omega network hash construction 32 (Fig. 3), omega network hash construction 64 (Fig. 3) and omega network hash construction 128 (Fig. 7). They serve as prototypes to determine the optimum size that gives us the best performance when the hash constructs are simulated on dual-core and quad-core processors machines.
As a prototype, SHA-512 algorithm is used as the function for Omega Network Hash Construction. Merkle-Damgård construction run sequentially, SHA-512 algorithm needs only one set of constant values (80 constant 64-bit words which are parts of the cube roots of the first eighty prime numbers [9] ). In Omega Network Hash Construction, the constant values are taken from part of the square root of 2 (√2) and the number of constant value used depends on the number blocks (Table 1).
In the design of Omega Network Hash Construction ( Fig. 2 and 3), the blocks on the left column (Column 1) takes two categories of input-1024 and 512 bits. Both inputs are taken from user messages. Those inputs serve as the initial vector for the SHA 512 function. However, in Merkle-Damgård construction, the initial vector is predefined. Each block of column 2 and above takes the input vector from the XOR of two blocks of digested values from previous column. For example (Fig. 2), block function number F 4 gets its input vector value from the XOR of two digest values of block F 0 and F 2 .
There are some constraints for the design of Omega Network Hash Construction. To start executing the block function's column, it must wait for the previous column to complete its execution before it starts. This is because the block function's column input vector depends on the XOR of digest values of the previous column; so variables dependency does exist in Omega Network Hash Construction. For example, second column of Omega Network Hash Construction can start execute only after the first column completed its execution, because the input vector of second column depends on the XOR of first column digested values.
One round of Omega Network Hash Construction is completed, after XORing the digest values of the last column. This process continues until the entire message is hashed. Finally, to form the final digest value, digest values of every round is XORed. The XOR process is executed sequentially, so that when the size of Omega Network Hash Construction increases, this process will take longer time to XOR the digest value.
If the input message is not enough in terms of the input length to complete one round of Omega Network Hash Construction, the pre-defined message will be used to execute the remaining blocks. The pre-defined message is a non-repeated number, taken from the irrational number √2.   Overall, the executions phase of the different versions of omega network hash construction are similar to each other. The difference is the number of columns and the number of function blocks that form an omega network hash construction. Besides that, the total rounds needed to complete hashing a message are different for these five designs of omega network hash construction.
Simulation and performance evaluation: All designs are simulated in dual core and quad core machines. Section on test design describes the complete test design for this research. Section on performance test explains how to generate the test file and the sizes of test final. Section on security test describes the security test for this research.
Test design: Omega network hash construction is proposed to be an alternative architecture to the Merkle-Damgård construction with the goal of improving the performance of hashing. SHA-512 algorithm is used as our case study in this research. The source code of the SHA-512 function is taken from Olivier Gay version 2007 [10] .
In our test, there are five major designs of omega network hash construction, with different sizes, being simulated on both dual-core processors and quad-core processors. To execute omega network hash construction in parallel, two lines of OpenMP commands are used.
• omp_get_num_procs (): This command is used to get the number of processors in the machine. The command will help us to indicate the number of threads created. Two threads will be created in a dual-core processor and four threads will be created for a quad-core processor, respectively • #pragma omp parallel for schedule (dynamic) ordered private (iCount): This OpenMP command provides the Omega Network Hash Construction's function (SHA-512) to execute parallel schedules orderly from F 1 , F 2 , F 3 , F 4 , F 5 , F 6 , F 7 , F 8 …F n , each thread will execute one function at a time in parallel with the other thread. iCount is a private variable for all the functions The designs are simulated in two types of machine which both are using-Microsoft Windows XP Professional and Visual Studio 2008. The specifications of the machines are as below: • Dual-core processors: Intel (R) core (TM) 2 duo CPU T7300 @ 2.  [6] . DIEHARD, the security test needs 9-10 megabytes of files containing the binary value to produce the test report. There are two types of messages digest value being generated-single block message (Fig. 4) and multiple blocks message (Fig. 5). Each input file is only one bit different for both types of messages. A total of 1,600,000 message files are generated to produce 10 MB binary digested value file. For the single block message, the first byte is "1", followed by 127 "0" (Fig. 4). There are 5 types of messages for multiple blocks-12, 32, 80, 192 and 448 blocks. The number bits of message for Omega Network Hash Constructions are greater than Merkle-Damgård construction because the initial vector for Omega Network Hash Construction is taken from user input (Fig. 5). The test results are written in an output file. The test value '-p' between 0 and 1 indicates a pass for the DIEHARD test.

Performance test:
The performance analysis measures speed up, security level, efficiency and running cost. There are three types of run-time tests: serial run-time (T s ), parallel run-time (T p ) and overhead function (T 0 ). T s is the time elapsed between the beginning and the end of execution time in a serial manner. T p is the elapse time between the moment a parallel computation starts and the moment that the last processor finishes execution. Overhead is calculated by T o = p T p -T s , where p is the number of threads.
Speed up is defined as the execution time of a sequential program divided by the execution time of a parallel program, S = T s /T p , where T s is the sequential time and T p is the parallel time running on n processors [1] . Theoretically, speed up will not exceed the number of processors or threads that is being used.
The efficiency is calculated as E = Speed up/n. This measurement is the fraction of time for which the computer is employed. Ideally, the efficiency should equal to one. But in practice, the efficiency is normally between zero and one, which depends on the degree of effectiveness the processors are being utilized.
Running cost is another measurement we considered in our performance analysis. Cost or (p×T p ) is the product of parallel runtime and the number of processing elements which reflects the sum of the time that each processing element spends to solve a problem.
Performance of omega network hash construction 8, omega network hash construction 16, omega network hash construction 32, omega network hash construction 64 and omega network hash construction 128 are shown in Table 2-6 respectively. Figure 6-15 shows performance analysis of Omega Network Hash Construction simulated on a dual core machine and quad core machine in the line graph format.
Ts (         Ts ( Table 7 and 8 shows the security analysis for multiple block messages.

DISCUSSION
Performance analysis: All sizes of omega network hash construction and Merkle-Damgård construction are simulated on dual core and quad core machines respectively. The features of each machines are describe in the section of Test Design. The amount of RAM of the quad core machine (2.30 GHz 3.00 GB of RAM) is higher than dual core machine (1.99 GHz 2.00 GB of RAM). Thus, execution time for omega network hash constructions and Merkle-Damgård construction which are simulated on the quad core machine is faster than the simulation result on dual core machine.
As mentioned earlier, waiting time and serial time are two constraints exist in the design of omega network hash constructions. The waiting time is higher when the size of omega network hash construction is small. (e.g., omega network hash construction 8). The serial time is higher when the size of Omega Network Hash Construction is large (e.g., omega network hash construction 128). On the other hand, when more threads are created, the communication time or overhead will be higher. Thus, communication time for four threads is higher than two threads. Waiting time, serial time, communication time (overhead) are three factors that affect the performance of omega network hash constructions.
On dual core processors, the execution time among all sizes of omega network hash construction are almost the same with each other. The differences in the execution time among the difference sizes are created by digest XORing process happen in the last column of the design which runs sequentially. When the size of Omega Network Hash Construction increases, it requires longer time to complete the XORing process.
Omega network hash construction 8 runs faster on dual core processors, while omega network hash construction 128 runs slowest on dual core processors. The reason is the communication time between these two threads for omega network hash construction 8 is less than the overhead time of omega network hash construction 128. Omega network hash construction 128 required more time to generate the digest value by XORing the digest value from the last column compare with omega network hash construction 8.
On a quad core machine, the program will automatically generate four threads to run four block functions of omega network hash construction simultaneously. Omega network hash construction 32 runs faster on quad core processors, while omega network hash construction 128 runs the slowest on quad core processors. Omega network hash construction 8 and 16 had similar execution time. However, omega network hash construction 16 is slower than omega network hash construction 8 because the serial execution of omega network hash construction 16 for XORing the digest value requires more processing time. However, both constructions are still slower than omega network hash construction 32. This happens due to the waiting time that exists in omega network hash construction 8 and 16 are higher than omega network hash construction 32; the more number of execution round the more waiting time is required.
Omega network hash construction 128 runs the slowest on dual core and quad core machines. However, it still runs faster than Merkle-Damgård construction on dual core processors but run slower than Merkle-Damgård construction on quad core processors. This is because the serial time to XOR the digest values is higher on both machines but the communication time for four threads are higher than two threads.
There are three types of speed up calculation being presented: The speed up calculation based on (T s /T p ), the speed up based on Amdahl's law and the speed-up based on Gustafson Barsis's law (Table 10). The fastest speed up is achieved by the omega network hash construction 32 with four threads, 1.813 sec, for input file size of 400 MB ( Fig. 7 and 12) and the average speed up is 1.8 sec (Table 9). Based on Amdahl's law and Gustafson Barsis's law, the speed up for omega network hash construction 8 is the highest because the serial execution in omega network hash construction 8 is only 10% for the entire execution. The lowest speed up is by omega network hash construction 128 which consists 50% execution (Table 10). Consequently, the efficiency for Omega Network Hash Construction 32 with four threads is also among the highest ( Fig. 8 and 13, Table 11 and 12).            Running cost is calculated by multiplying the number of threads by the execution time. Therefore, the more the number of processors, the higher the running cost will be recorded for the simulation (Fig. 10 and  15). Thus, the cost of running four threads is higher than that of two threads.
Overall, omega network hash construction 32 runs faster on quad core processors while Omega Network Hash Construction 8 runs faster on dual core processors.
Security analysis: Merkle-Damgård Construction fails one of the security tests-Birthday Spacings. This is because the binary digest value of Merkle-Damgård construction for both cases (single and multiple blocks message) did not fulfill the requirement for Birthday Spacings test. Merkle-Damgård construction generates the lambda equal to 3.000 which is over the maximum lambda setting (2.000) for Birthday Spacings.
For single block of message, all the omega network hash constructions passed the test. On the other hand, Merkle-Damgård construction failed most of the tests except for the craps test ( Table 7).
The second test utilizes multiple blocks of message. All the omega network hash construction passed the test, the test value '-p' for each test lie between 0 and 1. Merkle-Damgård construction failed some of the tests when the block size messages are 12 (failed 8 tests), 32 (failed 7 tests) and 80 (failed 1 tests) ( Table 8). This implies that, Merkle-Damgård construction can only provide better security in term of randomness when the size of message is higher, because bigger size message will produce more equal size of block message and the digest value will be mixed with each other better and therefore produces the better randomize digest value.
To conclude the security analysis, in term of randomness, for omega network hash construction and with Merkle-Damgård construction, it can be deduced that omega network hash construction produces better randomized digest value even though the message is small and passed basic security test-DIEHARD.

CONCLUSION
The main objective of this research is to design a better hash constructions mechanism that can help improve the hash function performance in general. The propose omega network hash constructions were tested on dual core and quad core processors which allowed the block functions to run in parallel. Waiting time and serial time are two major weaknesses for omega network hash construction which affect its performance. For bigger size omega network hash construction, higher degree of serial execution has been recorded (e.g., omega network hash construction 128). While for the smaller size omega network hash construction, higher degree of waiting time has been recorded (omega network hash construction 8). However, in all cases, omega network hash constructions perform better than Merkle-Damgård construction, especially for the omega network hash construction 32 with four threads, which runs the fastest among all the constructions. In terms of security, all sizes of omega network hash constructions passed the basic security test of DIEHARD. On the other hand, Merkle-Damgård construction failed most of the security tests when the input size is small. Based on both of the tests, performance test and random test, the omega network hash construction performs better than the well known Merkle-Damgård construction. Therefore Omega Network Hash Construction is a viable alternative for hash construction, especially when multi-core processors are being considered.