Code Monkey home page Code Monkey logo

boolcrypt's Introduction

BoolCrypt 0.1

BoolCrypt is a Python 3 library for vectorial Boolean functions in cryptography. In particular, it provides the following features:

  • Represent vectorial Boolean functions in ANF, LUT, univariate polynomials and matrices and change one representation to another.
  • List of 3- 4- 5- and 6- bit affine classes and some classes of rotation-symmetric S-boxes.
  • Classify a list of S-boxes according to some cryptographic properties.
  • Find permutations, rotation-symmetric,reduced-size,... binary and non-binary polynomials.
  • Find whether two functions are linear or affine equivalent and count the number of linear or affine self-equivalences.
  • Solve functional equations and linear/affine/CCZ equivalence and self-equivalence problems using SAT solvers.

Most of the functions and classes in BoolCrypt contain many examples of their usage in their docstrings, also available in the online documentation.

BoolCrypt was proposed in Implicit White-Box Implementations: White-Boxing ARX Ciphers, and it is a dependency of whiteboxarx.

Installation

BoolCrypt requires Python >= 3.7 and SageMath >= 9.1. Although BoolCrypt is meant to be used as a Python library, it can also be used in a Sage shell.

Solving functional equations or equivalence problems requires CryptoMiniSat, which can be installed in SageMath by

sage -i cryptominisat

For some functions in boolcrypt/equivalence.py, BoolCrypt requires sboxU v1.0., but with some modifications described in modifications_sboxU.md. A modified version of sboxU is given in the directory sboxU. Then compile the modified sboxU by

cd sboxU/sboxU_cython
sage setup.py build_ext --inplace

boolcrypt's People

Contributors

ranea avatar

Stargazers

Leo Howell avatar  avatar  avatar  avatar  avatar Shawn avatar longcpp avatar Junwei Wang avatar Aleksei Udovenko avatar

Watchers

 avatar  avatar

boolcrypt's Issues

no rule to make target "all-toolchain".stop

hello.
'sage -i cryptominisat' makes error whether in linux shell or in sage shell.

lby@lby-virtual-machine:$ sage -i cryptominisat
make: *** No rule to make target 'all-toolchain'. Stop.
lby@lby-virtual-machine:
$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.5, Release Date: 2022-01-30 │
│ Using Python 3.10.6. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: sage -i cryptominisat
File "", line 1
sage -i cryptominisat
^
SyntaxError: invalid syntax

result cannot be run for a long time

When the incoming parameter of get_all_self_ae in BoolCrypt under sboxu is list (SMS4), the result cannot be obtained for a long time. How long does it normally take to obtain the result

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.