GithubHelp home page GithubHelp logo

feistel's Introduction

Feistel network

Given input:

main(
    s=(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7),
    p=(0, 4, 1, 6, 2, 6, 3, 7),
    keys=(
        (1,) * 8,
        (1, 0, 1, 0, 1, 0, 1, 0),
        (0, 1, 0, 1, 0, 1, 0, 1),
        (1,) * 8,
    ),
    data=(0,) * 16
)

Output:

ITERATION 0:
0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 0
ROUND KEY: 1 1 1 1 1 1 1 1
2021-12-16 16:18:55,144 - DEBUG - XOR
2021-12-16 16:18:55,144 - DEBUG - 0 0 0 0 0 0 0 0 ^ 1 1 1 1 1 1 1 1 -> 1 1 1 1 1 1 1 1
2021-12-16 16:18:55,145 - DEBUG - 1 1 1 1 | 1 1 1 1
2021-12-16 16:18:55,145 - DEBUG - Substitution
2021-12-16 16:18:55,145 - DEBUG - 1 1 1 1 (15) -> 0 1 1 1 (7)
2021-12-16 16:18:55,145 - DEBUG - Substitution
2021-12-16 16:18:55,145 - DEBUG - 1 1 1 1 (15) -> 0 1 1 1 (7)
2021-12-16 16:18:55,145 - DEBUG - Permutation
2021-12-16 16:18:55,145 - DEBUG - 0 1 1 1 0 1 1 1 -> 0 0 1 1 1 1 1 1
2021-12-16 16:18:55,145 - DEBUG - XOR
2021-12-16 16:18:55,145 - DEBUG - 0 0 0 0 0 0 0 0 ^ 0 0 1 1 1 1 1 1 -> 0 0 1 1 1 1 1 1
REG:  0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
ITERATION 1:
0 0 0 0 0 0 0 0 | 0 0 1 1 1 1 1 1
ROUND KEY: 1 0 1 0 1 0 1 0
2021-12-16 16:18:55,145 - DEBUG - XOR
2021-12-16 16:18:55,145 - DEBUG - 0 0 1 1 1 1 1 1 ^ 1 0 1 0 1 0 1 0 -> 1 0 0 1 0 1 0 1
2021-12-16 16:18:55,145 - DEBUG - 1 0 0 1 | 0 1 0 1
2021-12-16 16:18:55,145 - DEBUG - Substitution
2021-12-16 16:18:55,145 - DEBUG - 1 0 0 1 (9) -> 1 0 1 0 (10)
2021-12-16 16:18:55,145 - DEBUG - Substitution
2021-12-16 16:18:55,145 - DEBUG - 0 1 0 1 (5) -> 1 1 1 1 (15)
2021-12-16 16:18:55,145 - DEBUG - Permutation
2021-12-16 16:18:55,145 - DEBUG - 1 0 1 0 1 1 1 1 -> 1 1 0 1 1 1 0 1
2021-12-16 16:18:55,146 - DEBUG - XOR
2021-12-16 16:18:55,146 - DEBUG - 0 0 0 0 0 0 0 0 ^ 1 1 0 1 1 1 0 1 -> 1 1 0 1 1 1 0 1
REG:  0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1
ITERATION 2:
0 0 1 1 1 1 1 1 | 1 1 0 1 1 1 0 1
ROUND KEY: 0 1 0 1 0 1 0 1
2021-12-16 16:18:55,146 - DEBUG - XOR
2021-12-16 16:18:55,146 - DEBUG - 1 1 0 1 1 1 0 1 ^ 0 1 0 1 0 1 0 1 -> 1 0 0 0 1 0 0 0
2021-12-16 16:18:55,146 - DEBUG - 1 0 0 0 | 1 0 0 0
2021-12-16 16:18:55,146 - DEBUG - Substitution
2021-12-16 16:18:55,146 - DEBUG - 1 0 0 0 (8) -> 0 0 1 1 (3)
2021-12-16 16:18:55,146 - DEBUG - Substitution
2021-12-16 16:18:55,146 - DEBUG - 1 0 0 0 (8) -> 0 0 1 1 (3)
2021-12-16 16:18:55,146 - DEBUG - Permutation
2021-12-16 16:18:55,146 - DEBUG - 0 0 1 1 0 0 1 1 -> 0 0 0 1 1 1 1 1
2021-12-16 16:18:55,146 - DEBUG - XOR
2021-12-16 16:18:55,146 - DEBUG - 0 0 1 1 1 1 1 1 ^ 0 0 0 1 1 1 1 1 -> 0 0 1 0 0 0 0 0
REG:  1 1 0 1 1 1 0 1 0 0 1 0 0 0 0 0
ITERATION 3:
1 1 0 1 1 1 0 1 | 0 0 1 0 0 0 0 0
ROUND KEY: 1 1 1 1 1 1 1 1
2021-12-16 16:18:55,146 - DEBUG - XOR
2021-12-16 16:18:55,146 - DEBUG - 0 0 1 0 0 0 0 0 ^ 1 1 1 1 1 1 1 1 -> 1 1 0 1 1 1 1 1
2021-12-16 16:18:55,146 - DEBUG - 1 1 0 1 | 1 1 1 1
2021-12-16 16:18:55,146 - DEBUG - Substitution
2021-12-16 16:18:55,146 - DEBUG - 1 1 0 1 (13) -> 1 0 0 1 (9)
2021-12-16 16:18:55,147 - DEBUG - Substitution
2021-12-16 16:18:55,147 - DEBUG - 1 1 1 1 (15) -> 0 1 1 1 (7)
2021-12-16 16:18:55,147 - DEBUG - Permutation
2021-12-16 16:18:55,147 - DEBUG - 1 0 0 1 0 1 1 1 -> 1 0 0 1 0 1 1 1
2021-12-16 16:18:55,147 - DEBUG - XOR
2021-12-16 16:18:55,147 - DEBUG - 1 1 0 1 1 1 0 1 ^ 1 0 0 1 0 1 1 1 -> 0 1 0 0 1 0 1 0
REG:  0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0
MSG:	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
RES:	0 0 1 0 0 0 0 0 0 1 0 0 1 0 1 0```

feistel's People

Contributors

kupihleba avatar

Watchers

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