How i can create s-box 4 by 4
Hi
How i can create s-box 4 by 4
Thanks
Hi
How i can create s-box 4 by 4
Thanks
There is a list of S-Boxes used in cryptographic schemes in the reference manual (including 4x4 ones).
The first one is called Elephant, and can be accessed and used like this:
sage: from sage.crypto.sboxes import sboxes
sage: S = sboxes['Elephant']; S
(14, 13, 11, 0, 2, 1, 4, 15, 7, 10, 8, 5, 9, 12, 3, 6)
sage: S([0,0,0,1])
[1, 1, 0, 1]
You can also create them yourself:
sage: from sage.crypto.sbox import SBox
sage: S = SBox(12,5,6,11,9,0,10,13,3,14,15,8,4,7,1,2)
sage: S.input_size(), S.output_size()
(4, 4)
sage: S([0,0,0,1])
[0, 1, 0, 1]
It is explained on the page S-Boxes and Their Algebraic Representations.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2020-12-23 07:24:21 +0100
Seen: 338 times
Last updated: Dec 23 '20
Define s-box...