Ghonaim2013 Article AnImprovementOfChaos-basedHash PDF
Ghonaim2013 Article AnImprovementOfChaos-basedHash PDF
Ghonaim2013 Article AnImprovementOfChaos-basedHash PDF
(2013) 5:179–185
DOI 10.1007/s12293-013-0113-7
Received: 24 June 2012 / Accepted: 23 March 2013 / Published online: 10 April 2013
© Springer-Verlag Berlin Heidelberg 2013
Abstract In this paper, the chaos-based hash function is digital signature algorithms, integrity check and data origin
analyzed, then an improved version of chaos-based hash authentication. Hashing is a basic technique for information
function is presented and discussed using chaotic neural net- security and the cryptographic strength of a hash function is
works. It is based on the piecewise linear chaotic map that commonly evaluated through the resistance to collision. So, a
is used as a transfer function in the input and output of the secure hash function must resist collision attacks. Collisions
neural network layer. The security of the improved hash func- exist if we find two distinct messages hashing to the same
tion is also discussed and a novel type of collision resistant hash value [1,2].
hash function called semi-collision attack is proposed, which Chaotic system is characterized by sensitive dependence
is based on the collision percentage between the two hash on initial conditions, control parameters, pseudo-randomness
values. In the proposed attack particle swarm optimization and ergodicity that meets the classic Shannon requirements
algorithm is used to define the fitness function parameters. of confusion and diffusion, which are of great importance
Finally, numerical and simulation results provides strong col- in cryptography. Therefore, cryptographic hash functions
lision resistance and high performance efficiency. have attracted much attention for cryptology, in partic-
ular for data integrity and message authentication codes
Keywords Artificial neural networks · Particle swarm [3,4].
optimization · Hamming distance · Semi-collision attack · Many hash functions-based based chaos have already
Chaotic neural network been proposed and addressed [3,5–7]. In [5] a chaos-based
algorithm for parallel keyed hash function construction
1 Introduction is proposed, theoretical analysis and computer simulation
indicates that the proposed algorithm can satisfy the per-
Cryptographic hash functions are primitives of fundamental formance requirements of hash function and its attack is
importance for a wide range of applications such as efficient presented by Wang et al. in [6], the security of this the
algorithm was analyzed and the problem of the weak keys
W. Ghonaim · N. I. Ghali is discussed. In [7] an algorithm for parallel keyed hash
Faculty of Science, Al-Azhar University, Cairo, Egypt function construction based on chaotic neural network is
e-mail: [email protected] proposed and its attack is presented in [3] and both theo-
N. I. Ghali retical analysis and experimental results show that the par-
e-mail: [email protected] allel keyed hash function is not secure against the forgery
attack.
A. E. Hassanien (B)
Information Technology Department, FCI, On the other hand, evolutionary computation algorithms
Cairo University, Gizah, Egypt are stochastic optimization methods that involve algorithmic
e-mail: [email protected] mechanisms inspired by natural evolution and social behav-
ior. These methods have been proven to be efficient and
S. Banerjee
Birla Institute of Technology, Mesra, India effective. They also can handle problems that involve dis-
e-mail: [email protected] continuous objective functions and disjoint search spaces.
123
180 Memetic Comp. (2013) 5:179–185
A commonly encountered paradigm of such method is rule [11]. Each particle has fitness value which is calculated
Particle Swarm Optimization (P S O) [8]. Several hash func- by using fitness function and searches the point that mini-
tion attacks have been proposed in this area. In [1] an mizes the fitness function. A particle ith is represented with
attack to the BLOKE and BRAKE hash functions, which a position vector Pi = (Pi1 , Pi2 , . . . , Pi D ) and the velocity
are weakened versions of the SHA-3 candidate BLAKE is vector Vi = (Vi1 , Vi2 , . . . , Vi D ). At the beginning the entire
proposed. In [2] the collision problem of a chaos-based hash particle’s positions and velocities are generated randomly
function is investigated, the simulation and theoretical analy- then the velocity and position of a particle are updated at t
sis including the birthday attack and a study of the mes- time according to the following rules represented by Eqs. (1)
sage symmetry indicated that the proposed algorithm is not and (2) respectively.
secure.
Xiao in [9] proposed a parallel hash function construc- Pid (t + 1) = Pid (t) + Pid (t + 1) (1)
tion based on chaotic maps with changeable parameters. In Vid (t + 1) = w × Vid (t) + C1 R1 (Pbestid − Pid (t))
this paper, an improvement for chaos-based hash function +C2 R2 (Gbestd − Pid (t)) (2)
is proposed and discussed using chaotic neural networks.
It is based on the piecewise linear chaotic map that uti- where Vmax < Vid ≤ Vmax , and i = 1, 2,…, ps. Where ps
lizes as a transfer function in the input and output of the denotes the population size, w is the inertia weight which has
neural network layer. The security of the improved hash the effect of improving the convergence of search by reduc-
function is discussed and a novel type of collision resis- ing the speed as time progresses. Pbest is the best previous
tant hash function called semi-collision attack is proposed, solution of the ith particle that is recorded, Gbest is the
which is based on the collision percentage between the two best particle among the whole population, constants C1 and
hash values. In the proposed attack, particle swarm optimiza- C2 are weighting factors, which pull each particle towards
tion algorithm is used to define the fitness function parame- Pbest and Gbest positions. While R1 and R2 are two ran-
ters and address the problem of finding the set of optimal dom values in the range [0, 1] [12].
plain-text from a message search space which has minimum
hamming distance. Finally numerical and simulation results
2.2 Neural network
provides strong collision resistance and high performance
efficiency.
Artificial neural networks ( AN N s) have been developed
The rest of this paper is organized as follows: Sect. 2 gives
as generalizations of mathematical models of biological
an overview of particle swarm optimization, neural networks
nervous systems. In a simplified mathematical model of
and and chaotic maps. Sect. 3 describes chaos-based hash
the neuron, the effects of the synapses are represented by
function original algorithm, an improved and proposed hash
connection weights that modulate the effect of the associ-
function using chaotic neural network and the simulation
ated input signals, and the nonlinear characteristic exhib-
comparison between them. Sect. 4 introduces the proposed
ited by neurons is represented by a transfer function. There
semi-collision attack. Experimental results are discussed in
are a range of transfer functions developed to process
Sect. 5. Finally, conclusion and future work are presented in
the weighted and biased inputs, among which four basic
Sect. 6.
transfer functions widely adopted for data processing are
illustrated in Fig. 1, where R B F is the radial basis func-
tion network. The neuron impulse is then computed as
2 Preliminaries the weighted sum of the input signals, transformed by
the transfer function. The learning capability of an artifi-
This section briefly provides an introduction for particle cial neuron is achieved by adjusting the weights in accor-
swarm optimization, neural networks and chaotic maps. dance to the chosen learning algorithm. In this paper we
deploy the features of AN N s in order to improve the effi-
ciency and the convergence speed of the original algorithm.
2.1 Particle swarm optimization
AN N s are one typical network which could be considered
as a computational model inspired by the natural neurons
Particle swarm optimization (P S O) is a population-based
[13,14].
optimization technique proposed by Kennedy and Eberhart
[10] in 1995 that exploits a population of individuals to search
promising regions of the function space. The population is 2.3 Chaotic maps
called swarm and the individuals are called particles, each
particle is a solution to the problem and moves through the chaos is a phenomena that has deterministic underlying rules
search space with an adaptable velocity according to a certain behind irregular appearances. Chaotic system has several
123
Memetic Comp. (2013) 5:179–185 181
significant features, such as sensitive dependence on ini- hash length value. Padding process as the first step, in
tial conditions, pseudo-randomness, irregular, deterministic, which the original message with arbitrary length is padded
nonlinear, and ergodicity. These features characterize excel- with several bits. A block of size 64 bits is appended;
lent properties of diffusion and confusion, which are of great this block contains the length of the original message
importance in cryptography. Cryptographic hash functions before padding. The padded message is divided into 8
play an important role for data integrity and message authen- bit elements with number of a multiple of 127, each
tication [3]. of which is then translated into its corresponding ASCII
Since there are some bottlenecks in conventional hash code value then all of the ASCII code values (deci-
function constructions, the recently proposed chaos-based mal values) are assigned to m i j where (i = 1, 2, . . . ,
hash functions exhibit an attractive design direction. Both n − 1; j = 1, 2, . . . , 127), sequentially and respectively.
Chaotic Asymmetric Tent (C AT ) map and Chaotic Piece- Expansion process as the second step, in which the mes-
wise Linear (C P L) map are involved in the original algo- sage m is expressed in a matrix M. The matrix M is com-
rithm as refered in [9]. (C AT ) and (C P L) map are presented posed of matrix m, ri (i = 1, 2, . . . , n), and c j ( j =
as a one-dimensional chaotic map in Eqs. (3) and (4) respec- 1, 2, . . . , 127), more details for calculating ri and c j in [9].
tively. Let M = (M1 , M2 , . . . , Mn ) = (m i, j )(i = 1, 2, ...., n; j =
xi 1, 2, ...., 128), where Mi denotes the ith row elements of
α 0 ≤ xi ≤ α
xi+1 = f (xi , α) = 1−x (3) expanded message M, each element in M is of size of 8 bits.
1−α α < x i ≤ 1
i
Finally, the hash value is obtained by iterating both C AT and
where xi ∈ [0, 1] and α ∈ (0, 1) are the iteration trajectory C P L.
value and the parameter of the chaotic asymmetric tent map,
respectively [7].
⎧x 3.2 The improved chaotic neural network (C N N ) hash
⎪
⎪ β
i
0 ≤ xi < β function
⎪
⎪
⎪
⎨ xi −β
0.5−β β ≤ xi < 0.5
xi+1 = f (xi , β) = 1−β−xi (4) A two-layer neural network is used, which consists of both
⎪
⎪ 0.5 ≤ xi < 1 − β
⎪
⎪ 0.5−β the input and output layer. For each ith block two layer
⎪
⎩ 1−xi neural network is applied using the same transfer function
β 1 − β ≤ xi ≤ 1
and different structure parameter as described in algorithm
where xi ∈ [0, 1] and β is the control parameter and belongs (2). The input layer has eight neurons and each neuron
to (0, 0.5). has different parameters including the weights of j neuron
W I( j−1)×16+1 , W I( j−1)×16+2 ,....., W I( j−1)×16+16 and the
input data m i,( j−1)×16+1 , m i,( j−1)×16+2 ,..., m i,( j−1)×16+16
3 The proposed chaotic neural network hash function which are transformed into the output data I =[I1 , I2 , ..., I8 ].
Due to our transfer function the output of the input
3.1 The chaos-based hash function layer is a real number between 0 and 1 which is fed
into the output layer. The output layer has four neu-
There are substantial number of steps in the original algo- rons, the structure parameters of the each neuron is
rithm as described in algorithm (1), where H L is the different.
123
182 Memetic Comp. (2013) 5:179–185
Algorithm 1 The chaos-based hash function original algo- 12: Compute the output of input layer Ii , i = 1, 2, ...., 8 using
rithm Eq. (14), where the transfer function f is the piecewise linear
Input: The original message chaotic map with parameter Q I , and τ is the iteration bench-
mark and equal 50, B1 = [W Ii,1 , W Ii,2 , . . . , W Ii,16 ] and A1 =
1: Calculate m, where m is the output of padding process for original
[m i,(i−1)×16+1 , . . . , m i,(i−1)×16+16 ].
message
2: Calculate M, where M is the output of expansion process of m
3: for each block Mi , i=1 to n do Ii = f τ (mod(A1T × B1 + B I, 1), Q I ) (14)
4: for each sub block m i, j ∈ Mi , j=1 to 128 do
13: Compute the output of output layer Ok , k = 1, 2, 3, 4 using
5: Iterate the chaotic C AT t1 times with initial value x0 and change-
Eq. (15), where the transfer function f is the piecewise linear
able parameter α, where
chaotic map with parameter Q O, A2 = [I1 , I2 , . . . , I8 ] and B2 =
j [W Ok,1 , W Ok,2 , . . . , W Ok,8 ].
t1 = × m i, j (5)
HL
m i,128
x0 = 256 , j =1
(6) Ok = f τ (mod(A2T × B2 + B Ok , 1), Q O) (15)
C P L(m i, j−1 ), j = 1
i j 14: Transform Ok , k = 1, 2, 3, 4 into the corresponding binary for-
α=( + )/2 (7)
n HL mats, then extract 32-bit of each to generate the corresponding Hi .
6: Iterate the chaotic C P L map t2 times with initial value x0 and Hi = (O1 )32 (O2 )32 (O3 )32 (O4 )32 (16)
changeable parameter β, where
Output: Total hash value H =⊕ Hi , i = 1, 2, ...., n
j
t2 = (1 − ) × m i, j (8)
HL
x0 = C AT (m i, j ) (9)
α 3.2.1 Simulation and experiments results
β= (10)
2
7: end for The first simulation and experiments have been carried out
8: end for to test and validate the proposed hash function, using the
Hash value generation key = (x0 , α, u 0 ) = (0.7654, 0.6, 0.3), where x0 , α are two
9: Calculate Hi , where Hi is round of C P L(m i, j ) to its nearest integer
secret keys that are used in expansion process. Four statis-
0 or 1
10: Calculate H (M), where H (M) = H1 ⊕ H2 ....Hi .... ⊕ Hn tical measures are used, which are mean changed bit num-
Output: Hash value H ber B, standard deviation of the changed bit number S B,
mean changed probability P, and standard deviation of mean
changed probability S P. They are defined in [15] as the
following:
Algorithm 2 The improved chaotic neural network C N N
1
N
hash function algorithm B= Ti , i = 1, 2, ....., N (17)
Input:The original message
N
i=1
1: Call the original chaos-based hash function algorithm(1)
1 N
SB =
2: Assign the weights and basis of the input and output layer
3: Let the set of input layer weights W Ii, j = C P L(m i, j ) (Ti − B)2 (18)
N −1
4: Iterate chaotic C P L map t times with initial value x0 and changeable i=1
parameter β B
P= × 100 % (19)
t = τ + 39 (11) 128
N
2
a < 0.5
1 Ti
β=
a,
(12) SP = − P × 100 % (20)
1 − a, a > 0.5 N −1 128
i=1
5: Compute a = mod( u20 + i−1 4 , 1), x 0 is the last state of C P L map. Here, N is the total number of tests and Ti denotes number
6: Let x(51) is set as the bias B I .
7: Let x(52) is set as transfer function parameter Q I . of changed bits in the ith test.
8: Let x(j), j=53, 54, ......, 84 are set as the weights W Ok = [W Ok,1 , Table 1 shows the performance of the improved hash func-
W Ok,2 , ......, W Ok,8 ], k=1,2,3,4 tion, while Table 2 shows the comparative analysis with the
9: Let x(j), j= 85, 86, 87, 88 are set as the biases B O1 , B O2 , B O3 , original hash function [9], using the same message with hash
B O4
10: Let x(89) is set as transfer function parameter Q O. value length H L = 128 and the number of tests N which are
Hash value generation equal to 256, 512, 1,024, and 2,048. Based on the obtained
11: Convert each sub-block m i, j into the corresponding decimal format. results, it can be concluded that the improved chaotic neural
m i, j network hash function shows the best statistical performance
m i, j = (13)
256 results compared to the original one. In addition, we observe
that the mean values of B and P in our proposed hash
123
Memetic Comp. (2013) 5:179–185 183
Table 1 Statistical analysis results of the improved algorithm distance is minimized, the best particle position is called the
N B P(%) SB S P(%) optimal guessed plain text m ∗ and the corresponding hash
value is called the optimal guessed hash value h ∗ , then the
256 63.50 49.61 5.4 4.92 collision percentage is computed using Eq. (21).
512 64.64 50.1 5.40 4.95
(H L − H D) × 100
1,024 63.89 49.91 5.60 4.94 Collision Percentage = % (21)
2,048 63.93 49.94 5.59 4.94 HL
Mean 63.99 49.88 5.49 4.94 where H L is the hash length, H D is the hamming distance
between h and h ∗ . Algorithm (3) shows the P S O based semi-
collision attack on the parallel C N N .
Table 2 Statistical analysis results of the original algorithm
N B P(%) SB S P(%)
Algorithm 3 P S O based semi-collision attack
256 63.85 49.89 8.002 6.25 Input: Set the initial population randomly and set the initial condition
512 63.84 49.87 7.39 5.78 values
1,024 63.65 49.72 8.02 6.27 1: for each particle i = 1: ps
2: Calculate the hash value for each particle h i using the parallel C N N
2,048 63.57 49.66 7.4 5.80
function
Mean 63.73 49.79 7.71 6.03 3: Compare h i with the correct hash value h
4: Evaluate the fitness function for each particle
Table 3 Analysis of the computational time 5: Update the particles positions and velocities
6: end for
N Log(To ) Log(Ti ) Log( T ) 7: Record Gbest position as optimal guessed plain text m ∗
8: Record the optimal guessed hash value h ∗
256 8.0097 7.9445 5.2470 9: Compute the collision percentage between h, h ∗ using equation (21)
512 8.7078 8.6394 5.9915 Output: Collision percentage
1,024 9.3759 9.2399 7.3132
123
184 Memetic Comp. (2013) 5:179–185
5 Experimental results and analysis To validate the performance of the above attack, some
experiments have been carried out for three different plain
The simulation and experiments have been carried out with texts of different size D. In each time we use the same num-
Pentium I V Processor and 2 G B R AM and Matlab version ber of iteration I in order to determine the optimal guessed
7.0. Various experiments are carried out in this work using plain text which is corresponding to the optimal hamming
three different plain texts, using the same number of iteration distance. Tables 4, 5, 6 show the collision percentage with
(P S O epochs) I , where I equals 100, 200, 500 and 1,000. the optimal hamming distance of three different experiments
In each experiment semi-collision attack on the plain text is using three correct plain text, which are usernameeforme of
applied to measure the security of the chaotic neural network. dimension D = 14, chaosisakindof of dimension D = 14,
In our experiments P S O parameters set as C1 = C2 = and hashisabasictechniqueforinformationsecurity of dimen-
2, initial inertia weight = 0.9 and final inertia weight = 0.4. sion D = 43.
The maximum velocity Vmax of the algorithm was set to From the obtained results we got that the chaotic neural
4. The size of population ps was taken equal to 24. The network using P S O is used to search for the optimal guessed
dimension of the problem D depends on the length of the plain text which has minimum hamming distance that satis-
correct plain text. fies a high collision percentage. Figure 2 shows the number of
iteration against the collision percentage in the three experi-
Table 5 Experiment-2 where C P is the collision percentage ments. From the obtained results, although optimal guessed
plain text is very different from the correct plain text, the
I Optimal Guessed Optimal Optimal
two hash values are relatively close together. It can be con-
plain text (H D) (C P) (%)
cluded that, there exists a high collision percentage and its
100 mpskrpqvroumyk 43 65 value increases according to the increase of the number of
lmqrqrtnmthvom 45 iteration. This means that the parallel C N N hash function is
xtrnbmvopepmrm 45 insecure against semi-collision attack.
200 fhpkpslgurlxjc 43 66
zmnqzjijssiftn 44
rmjhtemlloooreo 44 6 Conclusion and future work
500 inpmskorsisngv 43 67
kgfmbizxksmgsg 43 Chaotic neural network is adapted for constructing a par-
rjevvjkiqtjpen 42 allel hash function to improve the efficiency and speed up
1,000 krionrtiitnspn 40 68 the chose-base hash function algorithm. In this paper P S O
ilplbphspniprj 43 is applied to attack chaos based hash function algorithm.
okepnejiiqlknq 41 In addition, this paper analysis the chaos based hash func-
tion, and based on that an improved version of chaos-based
100 whxmxjihlmfqpmqlqqkimnnomfqohutiirjlfqllisx 47 64
tzcddaivfqeqkninavmfrtjtpjofpmdsikrrjpkvmpf 46
jtplrfojitnpqohlovoqlhmpqkrlshkqmzkomokfnhr 46
200 olfsekrlkkjyjllxddsttduwvqmmpkhfkwjkmlqetil 45 66
gnrhwmjisfixowwnpawhgxhntkqpqhdxrppnggoxewx 44
dlonowmutpevlhjelvtefpthsvsiyqxnthsfdtlfsum 41
500 krsnoolwnrmfbjjklrrhltwpphilloriqleowfqmlgk 42 68
mtujsmtpnicltmopfqwmjmuhntlfmggrhonqjljnoil 41
wfktnisqdfhnhefgkoutgjmalppmwepxprdomjoilmm 40
1,000 dkisrxjkoipklkdfjmltyrnkmgiknmngdleojcaikst 42 69
vsifomhkltlottrmqmndtpfzjtvuelqojgmhnpenpfq 41
qlxcncmshopnoqhjjqhghsqumglyumiqjalrnhergvj 38
123
Memetic Comp. (2013) 5:179–185 185
hash function is presented and discussed using chaotic neural 2. Wang S, Li D, Zhou H (2012) Collision analysis of a chaos-based
networks. A novel type of collision resistant hash function hash function with both modification detection and localization
capability. Commun Nonlinear Sci Numer Simulat 17:780–784
called semi-collision attack is also proposed, which is con-
3. Wang X, Zhao J (2010) Cryptanalysis on a parallel keyed hash func-
ceived on the collision percentage between the two hash val- tion based on chaotic neural network. Neurocomputing 73:3224–
ues. In the proposed attack, we incorporate P S O algorithm 3228
to define the fitness function parameters. Finally numeri- 4. Xingyuan W, Guoxiang H (2011) Cryptanalysis on a novel image
encryption method based on total shuffling scheme. Optics Com-
cal and simulation results provides strong collision resis-
mun 284(24):5804–5807
tance and high performance efficiency. Experimental results 5. Xiao D, Liao X, Deng S (2008) Parallel keyed hash function con-
show that parallel C N N hash function is insecure against struction based on chaotic maps. Phys Lett A 372:4682–4688
the defined attack with a high collision percentage using 6. Wang X, He D, Cao Y (2009) Cryptanalysis on a parallel keyed
hash function based on chaotic maps. Phys Lett A 373:3201–3206
three different plain texts with different dimensions. It can be
7. Xiao D, Liao X, Wang Y (2009) Parallel keyed hash function
concluded that a strong relation exists between the number construction based on chaotic neural network. Neurocomputing
of iteration and the percentage of collision. Different hash 72:2288–2296
function characteristics may demonstrate diversified colli- 8. Laskari EC, Meletiou GC, Stamation YC, Vrahatis MN (2005)
Evolutionary Computation based Cryptanalysis: A first study. Non-
sion values. Hence, the future work will be more concerned linear Anal 63:823–830
with extending this approach for addressing other hash func- 9. Xiao D, Li Y, Deng S (2011) Parallel Hash function construction
tions and try to tune the parameters of P S O to improve the based on chaotic maps with changeable parameters. Neural Comput
hash function attack so that perfect collision value can be Appl 20:1305–13012
10. Kennedy J, Eberhart RC (1995) Particle swarm optimization. Pro-
obtained. P S O based cryptanalysis has gained much atten- ceedings of the IEEE International Conference on Neural Networks
tion due to its fast convergence rate. An immediate exten- IV:1942–1948
sion of P S O-based cryptanalysis scheme could be used for 11. Shahzad W, Siddiqui AB, Khan FA (2009) Cryptanalysis of Four-
breaking the key employed in simplified-advance encryp- Round DES using Binary Particle Swarm Optimization. Genetic
and Evolutionary Computation Conference (G ECC O), pp 1757–
tion standard (S − AE S). The cost function is derived using 1758
letter frequency analysis. The creative inclusion is to apply 12. Ghonaim WA, Ghali NI, Hassanien AE, Abraham A (2011)
cipher text-only attack for an S − AE S encryption system, Known-plaintext attack of DES-16 using Particle Swarm Optimiza-
where the key can be obtained in a minimum search space tion. Nature and Biologically Inspired Computing (N a B I C), pp
12–16
compared to the Brute-Force attack. Further key Experi- 13. Abraham A (2005) Artificial Neural Networks. Handbook of Mea-
mental results could be solicited and establishes that P S O suring System Design
and its other variants can be used as an effective tool to 14. Cathy W (1997) Artificial neural networks for molecular sequence
attack the key used in S − AE S. The more hybridization analysis. Comput Chem 21:237–256
15. Wang Y, Wong KW, Xiao D (2011) Parallel hash function con-
of intelligent techniques (e.g. Rough set with P S O or gran- struction based on coupled map lattices. Commun Nonlinear Sci
ular P S O may yield better but optimal percentage of colli- Numer Simulat 16:2810–2821
sion.
References
123