{'fraction_non_alphanumeric': 0.021082846679204195, 'fraction_numerical': 0.025437988716222906, 'mean_word_length': 4.467532467532467, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Design of a New Cryptographic Hash Function – Titanium

Received Nov 7, 2017 Revised Jan 29, 2018 Accepted Feb 12, 2018 This paper introduces a new cryptographic hash function that follows sponge construction. Paper begins with outlining the structure of the construction. Next part describes the functionality of Titanium and cipher used. A competition between block cipher and stream cipher is presented and showed the reason of using block cipher rather than stream cipher. Speed performance is calculated and analyzed using state-of-art CPUs.


INTRODUCTION
The usage of the internet connections was confined in communication between peers. With the new technology revolution, the internet connections became widely used for all purposes especially for commerce. The development of the internet and the connection mediums led to reduction in the costs as well as the increase of users and uses. Banks, organization and companies around the world are depending on the internet connections to make their deals. This environment is very fertile for crackers and it is risky for those organizations to keep using the internet with no defense lines since the backbone if their information technology infrastructure is the internet connections. Information security was implemented for this purpose and to protect and immune systems to crack. There are many security procedures to ensure data integrity, confidentiality and availability such as encrypting, digital signatures and MACs. However, hash functions are light powerful ways to protect and verify data. Hash function is non-invertible function and it has two main components. The construction and cipher used. Hash functions should go in one direction such that crackers cannot obtain plain text from final result. It is heavily used in passwords databases in production servers. Hash functions used to verify the integrity of data over peers. It takes arbitrary input size, processes it and produces fixed length output known as "Digest". It should be resist to preimage, second pre-image and collisions. There are several constructions for hash function. Each one of them has its own scheme to produces the digest.
In this paper, Titanium hash function is introduced. It follows sponge construction which has a state width of bitrate and the capacity denoted by "w", "r" and "c" respectively (w=r+c).
Capacity is a security parameter stored in the state matrix and its value is protected from changes over the operations and never affect the bitrate values. The usage of capacity is to split the digest length from the security level of hash function. Bitrate is where the data is being processed. Sponge construction has three stages, absorbing, squeezing and truncation stage. Absorbing is the operation of preparing and inserting data to the blender while squeezing is the operation of building the digest and preparing it to the final stage lastly, truncation is the operation of cutting the digest to rightmost or leftmost. According to Claude's theory, there are two primitives for hash functions, Diffusion and Confusion. Diffusion is to spread the influence of one bit insertion to the message in order to hide the statistical properties of the construction. Confusion is hide the relationship between the input and the output and keep it obscure. To carry out those two primitives, there are three main components. Permutations\Transformations: applying several layers on S-boxes in order to maintain higher diffusion, Logical Functions: The most common arithmetic operation used is XOR. It is not possible to disclose the inputs from a given output after XORing. Titanium hash function is a newly constructed hash function that follows sponge construction and uses SP block cipher. It has a state of 1600bit. Bitrate is 576bit and the capacity is 1024bit. The capacity should be 2 times of bitrate to preserve the basic security criteria. Table1 shows all the hash functions that used a sponge as its construction.

RESEARCH METHDOLOGY 2.1 Block and Stream ciphers
Ciphers should work within rules called mapping function. Data is processed either if it is block mode or stream mode. Stream mode is efficient with large amount of data input when the input length is unknown and it deals with bits rather than a blocks while block cipher is dealing with chunks of data. In terms of costs, block cipher is cheaper to implement and easy to manipulate, on the other hand stream cipher is much harder to implement and verifying outputs but it is faster in executing. The flexibility of block mode allows building anything from stream ciphers to hash functions or MACs. Both, stream and block ciphers look secure enough to use. However in our case, block mode is our choice. Input data is known, thanks to padding rule used, easier to manipulate and add extra operations to the construction without touch its properties.

Sponge construction choice
Sponge construction is an iterated function that operates on fixed size internal states (state width). It goes through three main operations. Firstly, padding rule by adding enough bits to the message to let it fit the construction and initialize the initial value to zeros. Secondly, absorbing by XORing the message blocks into the state then return the first r bits as a part of output and lastly, squeezing phase which is used for finalizing the round as Figure 1 shown below.

Titanium.
Titanium is a new hash function that follows sponge construction. It has 1600bit state. 1024bit for capacity which is a security parameter and 576bit for bitrate where the function will operate. It produces 576bit digest output. The 1024bit capacity is used for security claims such that no attack will be applicable under complexity of 2n with considering the hash performance on microprocessors. Titanium uses SP block cipher. The state width of Titanium is 1600bit, all initialized to zeros distributed in 10*20 matrix state. Each element is one block and four blocks representing one word size.
Bitrate is distributed in 8*9 matrix. There is no different if the distribution was between any numbers of cells since it is blocking and at the end of the operation, the difference will be in the digest distribution with the same security level. For security reasons, length padding has been used. It is to append "1" then zeros until the last number which will be the message length P(m) = (M||P) + 1 + 0 * + mn where mn is the message length. The simplest padding rule is to append zeros to the message, but it is risky to use since collisions in this padding rule could be easily obtained. To harden the padding rule, length padding rule has been implemented.

Function
After padding and preparing the message to the blender, Titanium operates literately using sub-byte, Convert row, shifting and add round key.

Cipher.
SF is a 512bit block cipher. It iterates on four operations: sub-byte, Convert row, shifting and add round key. It is based on AES algorithm with substitution permutation network design. It takes a block of plain text and key of 512bit input and applies its operations on S-boxes to produce the ciphertext as an output. Message block and key are distributed in 4*16 matrix let SP iterates on 24 rounds to produce the final ciphertext. SP operates on 512bit input in the state as Figure 3 shown below. Each state element is one byte and four elements equals one word size as shown below.

Figure 3 SP State
Cipher steps: 1. Sub-byte round. Data location is substituted from S-box. This process repeats on all element's location as shown below in figure 4. 2. Convert Row Round. In this stage each data element is converted to binary form after that reading from right to left then and converted back to hexadecimal values as shown in figure 5. 3. Shifting Round. In this stage, shifting will be performed on the state that was the output from Convert Row Round stage. Two rows will be shifted then, XORed with the mother state as in figure  6.    SF  49  65  36  61  59  45  36  43  100  89  61  79  247  120  90  112  321  167  134  168  694  243  256  212  899  223  256  259  963  243  187  206  5345  1224  1376  1216  7310  1435  1543  1363  Averege  388 395 377

Performance Analysis On Cipher.
Cost of the algorithm is a precious circumstance especially in real time ciphering. The security of algorithm is better with bigger security parameters. However, the cost of implementation will be high and using bigger parameters might be not reasonable. Different file sizes have been tested on the SP algorithm to test its performance. According to SP speed study [reference here], 100KB data takes 79 Milliseconds to encrypt. Comparing it with AES and Blowfish, it is faster on bigger files.

Titanium
Since the capacity will never affect or enter the operations, Titanium is distributed in 10*20 forge 1600 bits matrix to preserve the cipher criteria. Bitrate will be 8*9 and the rest of the elements will be the capacity. Half of the element is spirited out and sub-byte with the elements row from the previous state as Same for the cipher steps. Row is converted to binary values then read from right to left then reconvert it to hexadecimal values. Same operation will repeat for all rows as Figure 9. The state rows are converted to binary form then XORed with the mother state rows. Figure 10 below illustrates the process. Systems needed a small powerful function tool to verify the data over peers without overloading it with operations. One of the best tools to do that is hash function. It has been designed to verify data over peers without overloading servers with many operations. Since there is no key in hashes, in this stage, the state matrix will be XORed with the previous one as Figure 11.

Truncation
After obtaining 576bit output digest, truncation will take its place to produce 512bit final digest after 24 rounds by spiriting out the bitrate to the right most or left most full digest as Figure 11 shown. Since 100KB takes around 79 milliseconds, that means 1KB takes 0.1 milliseconds. With some calculations, 576bit takes around 0.444 milliseconds.