Skip to content

kupihleba/feistel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

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```

Releases

No releases published

Packages

No packages published

Languages