Code Monkey home page Code Monkey logo

present24-rs's Introduction

Cryptography: Man In The Middle attack on a block cipher

This repository is a Rust implementation of the Attack on 2PRESENT24 C project. The structure of the code is largely the same (and is probably not "idiomatic" Rust), however I managed to achieve single core performance that was marginally better than the C implementation (~10% speedup).

PRESENT24 block cipher specifications

The block cipher implemented in this project is a scaled-down version of PRESENT, a lightweight cipher designed in 2007 by Bogdanov et al. and standardized in the ISO/IEC 29192-2:2019. The version implemented here (PRESENT24) will take an input message of 24 bits and will produce a 24 bits ciphertext.

PRESENT is part of the Substitution-Permutation Network (SPN) ciphers family. It is the second main structure type for designing block ciphers, the other being Feistel Networks.

The concept behind SPN ciphers is simple, each round is composed of three layers:

  • A XOR of the subkey to the register.
  • A substitution to ensure confusion.
  • A permutation to ensure diffusion.

This implementation of PRESENT24 will perform eleven rounds.

Usage

Pre-requisites

  • Rust 2018 edition
  • Cargo

Build

cargo build --release

Execution

Run by specifying the number of threads that you want to use (4 by default).

cargo run --release -- [NB_THREADS]

present24-rs's People

Contributors

dssgabriel 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.