## Security

Moderators: None (Apply to moderate this forum)
Number of posts: 155

This Forum Only

S-box design (input/output) Posted by z4n9ief on 14 Jan 2008 at 6:11 AM
Hello,

On a article of Wikipedia (http://en.wikipedia.org/wiki/Substitution_box ), we can found a example of 6×4-bit S-box (from DES). So this S-box work with a input of 6-bit and and output of 4-bits and of cours we can see that:
input.length > output.length

But I can't imagine a 8×32-bit S-boxes, like in CAST-128 function (http://en.wikipedia.org/wiki/CAST-128) or in Blowfish (http://en.wikipedia.org/wiki/Blowfish_%28cipher%29), when the output length is bigger then the input length.

I you have a example, it should be very helpful.

Zang'
Re: S-box design (input/output) Posted by zibadian on 14 Jan 2008 at 8:34 AM
: Hello,
:
: On a article of Wikipedia
: (http://en.wikipedia.org/wiki/Substitution_box ), we can found a
: example of 6×4-bit S-box (from DES). So this S-box work with a input
: of 6-bit and and output of 4-bits and of cours we can see that:
: input.length > output.length
:
: But I can't imagine a 8×32-bit S-boxes, like in CAST-128 function
: (http://en.wikipedia.org/wiki/CAST-128) or in Blowfish
: (http://en.wikipedia.org/wiki/Blowfish_%28cipher%29), when the
: output length is bigger then the input length.
:
: I you have a example, it should be very helpful.
: Thanks you for your help.
:
: Zang'
:
The cypher uses a different part of the S-box for each different calculation. For example: CAST-128 uses each quarter of the S-box independently and combines the results using several bitwise calculations.
Re: S-box design (input/output) Posted by z4n9ief on 15 Jan 2008 at 10:24 AM

In fact I think if a S-box use a input.length < output.length, then it's beacause this S-box use some information about the input and therefore there is a redundancy, so this kind of S-box is not interesting.
That's the reason why I think it's impossible to do, and even if we try to, it's a bad idea.
Re: S-box design (input/output) Posted by zibadian on 15 Jan 2008 at 11:50 AM
: Thanks for your answer, but I don't very well understand it.
:
: In fact I think if a S-box use a input.length < output.length, then
: it's beacause this S-box use some information about the input and
: therefore there is a redundancy, so this kind of S-box is not
: interesting.
: That's the reason why I think it's impossible to do, and even if we
: try to, it's a bad idea.
:
Here's an example to clarify:
Take for example this S-box: abcd
and as input the byte 1.
A cypher could perform the following:
output = ((a xor 1) and (b xor 1)) or ((c xor 1) and (d xor 1))
after the output has been determined, the S-box is rotated (becoming cadb) and is ready to process the second byte.
As you can see the output is also 1 byte and the whole S-box (4 bytes) is used in the transformation.
As you also might see, there's no redundancy in the S-box.

Given that blowfish is considered to be a good blockcipher, I tend to disagree with your idea that having a larger S-box than the input is a bad idea.
Re: S-box design (input/output) Posted by z4n9ief on 19 Jan 2008 at 3:54 AM
: Here's an example to clarify:
: Take for example this S-box: abcd
: and as input the byte 1.
: A cypher could perform the following:
: output = ((a xor 1) and (b xor 1)) or ((c xor 1) and (d xor 1))
: after the output has been determined, the S-box is rotated (becoming
: As you can see the output is also 1 byte and the whole S-box (4
: bytes) is used in the transformation.
: As you also might see, there's no redundancy in the S-box.
:
: Given that blowfish is considered to be a good blockcipher, I tend
: to disagree with your idea that having a larger S-box than the input

Thank you very much for your explication. Now I see that's possible, thanks to some calculs (unlike in the S-box example on Wikipedia).

Regards.

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic