GithubHelp home page GithubHelp logo

zuc_cryptanalysis's Introduction

zuc_cryptanalysis

环境

python 3.7

运行

python zuc.py

功能描述

针对zuc加密算法的S0和S1盒进行了密码分析,分别进行了差分密码分析和线性密码分析,得到了两个盒的DDT和LAT。实验运行的结果保存在txt文档里。

zuc_s0_DDT.txt保存S0盒差分密码分析的结果,为256*256的表格。

zuc_s0_LAT.txt保存S0盒线性密码分析的结果,为256*256的表格。

zuc_s1_DDT.txt保存S1盒差分密码分析的结果,为256*256的表格。

zuc_s1_LAT.txt保存S1盒差分密码分析的结果,为256*256的表格。

课程问题

Answer why a final key mixing is required by a cipher (you can take Basic SPN as an example) ?

答:如果不进行密钥混合,由于S盒的置换并不是完全随机,导致攻击者可以通过密码分析,如差分密码分析等对输入的密文进行破解。例如SPN的差分密码分析中 ,第二个盒子deltax输入为B(1011,其余盒子输入全为0),则第一轮的S盒输出有8/16的概率为2,密钥混合后,输入为4,第二轮S盒有6/16的概率为6,密钥混合后,输入为2,第三轮S盒有6/16的概率为5,密钥混合后,输入为4,第四轮S盒有6/16的概率为6。如果不进行混合,那么有(6/16)^3*8/16=0.0264的概率,输出为5(0000 0110 0000 0110),如果没有最后一轮的密钥混合,那么攻击者可以利用以上信息,进行密码攻破,密钥混合后,大大降低了这种风险。

zuc_cryptanalysis's People

Contributors

hxx-ustcer avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.