<p>I don't understand where the extra bits are coming from in <a href="http://en.wikipedia.org/wiki/S-box" rel="nofollow noreferrer">this article</a> about s-boxes.  Why doesn't the s-box take in the same number of bits for input as output?</p>

[{'answer_id': 23991, 'author': 'Ed.', 'author_id': 522, 'author_profile': 'https://Stackoverflow.com/users/522', 'pm_score': 1, 'selected': False, 'text': "<p>What extra bits?  They are going from 6 to 4.</p>\n\n<p>EDIT: Whoops! I'm an idiot.  This is kinda like a 2nd grade multiplication table.  They strip the outer bits off of the 6-bit block to be encypted, and leave the middle 4.  Just like a table for an arithmatic operation, they go down one side, and find the outer bit sequence, then across the top and find the middle ones.  To answer your question, it could input and output the same number of bits, but this s-box is just set up to do it the way it does.  Its arbitrary.</p>\n"}, {'answer_id': 23997, 'author': 'Niyaz', 'author_id': 184, 'author_profile': 'https://Stackoverflow.com/users/184', 'pm_score': 3, 'selected': True, 'text': '<p>It is the way s-boxes work. They can be m * n  ==>  m bit input , n bit output.\nFor example, in the <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" rel="nofollow noreferrer">AES</a> S-box the number of bits in input is equal to the number of bits in output.</p>\n\n<p>In <a href="http://en.wikipedia.org/wiki/Data_Encryption_Standard" rel="nofollow noreferrer">DES</a>, m=6 and n=4.</p>\n\n<p>The input is expanded from 32 to 48 bits in the first stages of DES. So it is be reduced to 32 bits again by applying one round of S-box substitution. Thus no information is lost here.</p>\n\n<p>The Wikipedia article on itself can be a bit confusing. It will make people think that information is lost. You should read the article in conjuncture with implementation details of some encryption algorithm using s-boxes.</p>\n'}]
['https://Stackoverflow.com/questions/23988', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2581/']