GithubHelp home page GithubHelp logo

milp_speck's Introduction

milp_speck

The speck_diff_find and speck_line_find are python framework for automatic differential and linear cryptanalysis which are developed based on the method presented in the paper "MILP-Based Automatic Search Algorithms for Differential and Linear Trails for Speck"

The step to generate the LP model:

  1. Open the speck_diff_find.py or speck_line_find.py with IDLE(we run the code on Windows and the python version is 3.2.5)

  2. Enter F5 to run

  3. Input "bar = speck(blocksize); bar.genModel(round)" to get the LP model

  4. Use gurobi optimizer to solve the LP model

  5. Use get_route_from_sol.sh or get_route_from_sol_1.sh to get the differential path

The example

We input “bar = speck(32); bar.genModel(3)” to get the 3 round speck32’s LP model.

The step to use gurobi to solve the LP model

  1. run gurobi

  2. Input "m=read("XXX.lp")" to read model

  3. Input "m.optimize()" to solve

  4. Input "m.write("XXX.sol")" to save the result

References:

Kai fu, Meiqin Wang, Yinghua Guo, Siwei Sun, Lei Hu : MILP-Based Automatic Search Algorithms for Differential and Linear Trails for Speck

milp_speck's People

Contributors

fukai6 avatar pfasante avatar

Stargazers

 avatar DAMPER avatar Yan He avatar  avatar  avatar Shibam Ghosh avatar  avatar Gregor Pintar avatar  avatar HENGA avatar  avatar  avatar Muhammad ElSheikh avatar  avatar Siwei Sun avatar Shawn avatar

Watchers

Gregor Pintar avatar James Cloos avatar  avatar 刘永乐 avatar  avatar

milp_speck's Issues

How to use special differentials

Hello Mr. Kai Fu
How i can give all 32 bit differential to program and get your result for impossible differential? how i can give special differential and get the result for differential analysis?
thanks for your help

Bad magic number error

While running the program speck_diff_find.py, I am getting the following error:
"ImportError: bad magic number in 'MILPSbox': b'l\x0c\r\n'".

The version of Python used to compile MILPSbox.pyc file may be different from mine. Please provide the source code from which you have compiled it so that I can compile it freshly.

three_way_fork needs one more input parameter to show fork number in each round

Regarding to speck_line_find: I think three_way_fork function must have one more parameter to represent the fork number in each round, because in each round two forks are used. At the present, for the same bit positions in the same round but in different fork, we have the same dummy variables, which would not be correct.

unable to run speck_line_find.py

while running the code of speck_line_find.py in windows by following the readme provided in milp_speck-master i am getting the following error. could you please guide.
error

Error when running speck_diff_find.py

Some errors are raised when trying to run speck_diff_find.py (Run on Python Python 3.8.10, Windows).

I "fixed" them the following way:

**replace line 60 for the following:

constraints = constraints + three_way_fork(x3, y1, y0,r)

replace line 106 for the following:

V = getVariables_From_Constraints(C)

replace line 108 for the following:

V = V.union(getVariables_From_Constraints([add_constraint_1]))**

I would like to know if the results are still the ones obtained by the authors with these changes.

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.