13

So, as an exercise to greater understand some things about cryptography, I decided to try and implement GOST 28147-89, which uses eight 4x4 S-Boxes. I can grasp the concept of putting 4 bits through the S-Box and getting four out, but how would one reverse this?

Furthermore, how would one reverse uneven S-Boxes, such as DES's 6x4 S-Box, when multiple inputs give the same output (e.g., for DES's S-Box S5, where inputs of 100011, 101110, 011101, and 010000 all give an output of 1000).

LMS
  • 233
  • 2
  • 6

2 Answers2

8

Ciphers that use S-boxes are typically in the form of a Feistel network. This has the property that inverting the cipher does not involve inverting the round function, but simply applying the rounds in the opposite order. Therefore one doesn't need to invert the S-box to decrypt.

Watson Ladd
  • 868
  • 4
  • 10
-2

The answers sound good so far; however, they do not mention the ESSENCE: let's take the AES s-box - it is NOT providing the same result for different inputs! Therefore, there is a second s-box for each encryption s-box in AES, which is used for the reverse operation (or function). Even in Wikipedia, if you read the "s-box" or similar pages, you are provided with an s-box that is NOT invertable. I went through many frustrating moments, until I have figured out what I am writing here. Have a great life.