Ask Your Question
0

How i can create s-box 4 by 4

asked 2020-12-23 00:24:21 -0600

koroz91 gravatar image

updated 2020-12-23 00:24:37 -0600

Hi

How i can create s-box 4 by 4

Thanks

edit retag flag offensive close merge delete

Comments

Define s-box...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-12-23 01:37:36 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-12-23 06:47:24 -0600

rburing gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-12-23 00:24:21 -0600

Seen: 44 times

Last updated: Dec 23 '20