Take the 2-minute tour ×

I'm trying to construct a DES implementation of my own! But i'm not successful with the implementation

I use All the tables like Initail permutation, Expansion Permutation table, Permutation function table, PC-1, PC-2 and all the s-boxes of my own random bit positions .

Should we use the S-Boxes provided by DES or we can create on our own??

share|improve this question
In what way are you not successful? –  GregS Mar 9 '11 at 0:15
add comment

2 Answers

DES without its original S-Boxes would likely be insecure. BTW NSA enhanced them making them more resistant to differential cryptanalysis, which was unknown to the civilian world at the time.

OTOH if you want user generated S-Boxes you could use the Russian cipher GOST 28147-89 (14.1 in Applied Cryptography) which uses user supplied S-Boxes.

share|improve this answer
add comment

The first rule of cryptography: never ever invent anything yourself! Unless you have a PhD and years of experience, you will end up creating gaping security holes. As a matter of fact, history shows that even people with a PhD and years of experience often make security mistakes. Sure, you can do it for fun and educational experience, but please do not ever consider putting anything of it into production. Sorry for being so negative, but this is the reality (and, for the record, I am also a person who should never ever invent anything cryptography-related myself).

When it comes to implementation of something invented by a true security expert (and generally accepted as being secure), there are still many traps to walk into, in particular side-channel attacks. But again, implementing it for fun and learning is of course a good thing.

When it comes to DES specifically, the contents of the S-boxes is a part of the algorithm itself and can not be changed without also losing compatibility with all other DES-encrypted data.

share|improve this answer
Ad "people with PhD and years of experience making mistakes": that's why peer review is so important in this area. Un-reviewed algorithms/implementations are often considered broken by default. –  Joachim Sauer Mar 8 '11 at 15:45
I'm doin this for my project work. i read With the adoption of DES 20 years ago, many critics questioned the involvement of the NSA in generating the s-boxes. Some questioned if a back-door, or at the very least, a reduced capability open to cryptanalysis, was hidden in the boxes. This prompted several researchers to find alternate s-boxes that would be secure without worry of the NSA potentially cracking them. Since the creation of DES, plenty of research has gone into finding better s-boxes and better techniques to break them. . So thought of trying new s-box.... –  HariHaraSudhan Mar 8 '11 at 15:47
@Hari: if you've got doubts about the quality of DES, then switch to a more modern alternative. –  Joachim Sauer Mar 8 '11 at 15:51
@HariHaraSudhan: Interesting idea, but again, in cryptography, ideas that seem good often aren't (and you won't find out until someone breaks your encryption). Since I am not an expert, I have no better arguments than that, I'm afraid. Random S-boxes (which would, in a sense, be an additional key, since the receiver would need to know them) would perhaps break existing analysis techniques, but any specific randomly-generated S-box risks exhibiting some weakness that will perhaps render it vulnerable to e.g. differential cryptanalysis (but I don't know anything about that, so I'm not certain). –  Aasmund Eldhuset Mar 8 '11 at 16:07
@HariHaraSudhan There are perfectly valid ways to ensure the same plaintext does not encrypt to the same ciphertext - IVs. If randomly generated S-Boxes were a practical way to enhance a cipher's security, people would be doing it. Don't assume that you're smarter than the best educated cryptography researchers - none of us are. –  Nick Johnson Mar 8 '11 at 17:09
show 17 more comments

Your Answer


