In this paper, we show how to obtain suitable differential charactristics for block ciphers with neural networks. We represent the operations of a block cipher, regarding their differential characteristics, through a directed weighted graph. In this way, the problem of finding the best differential characteristic for a block cipher reduces to the problem of finding the minimum-weight multi-path way between two known nodes in the proposed graph. We applied Hopfield network to find the minimum-weight multi-path way. In this technique, the probability of convergence to a local minimum increases when the number of rounds of the cipher increases. We also applied Boltzmann machine to avoid local minima. We applied these techniques to find 3-round, 4-round and 5-round differential characteristics of Serpent block cipher, and repeated the optimization procedures for each characteristics 100 times. With Hopfield network, we obtained suitable results 100, 20 and 1 times for 3-round, 4-round and 5-round of the Serpent respectively. With Boltzmann machine, we obtained suitable results 100, 99 and 30 times for 3-round, 4-round and 5-round of the Serpent respectively. These results show that simulated annealing help avoiding the many local minima of energy function.
We compare the probabilities of our obtained differential characteristics for Serpent with the probabilities of eight differential characteristics previously reported in other papers. The comparison shows that our proposed technique obtains better results in 6 cases, and the same results in 2 cases. We also found a 7-round differential characteristic with a probability of 2-125 with Boltzmann machine. Neglecting the reported Bommerang differential characteristics of Serpent, our obtained 7-round differential characteristic is the first report on a differential characteristic for more than 6 rounds of this cipher. The results of experiments indicate the efficiency of neural networks to find suitable differential characteristics of block ciphers.