# Implement Twofish cipher with 16-bit blocksize?

I've seen implementation of Rijndael cipher with 16-bit blocksize. And I have also tried to implement 16-bit Rijndael cipher by myself with only a little sneak peeking at the example of the implementation.

I think this was a very good way to learn how Rijndael or AES cipher works, by simplify the cipher and reducing the block size to small numbers that is possible to calculate with your brain.

I would love to learn how twofish works, and I was hoping to use same method as with Rijndael cipher. But I was not able to find anyone who had already implemented a 16-bits Twofish cipher, so I started to wonder if this was possible. After looking at the flowchart of the Twofish cipher:

K0 to K7 should be possible to reduce to 2-bit size, same with the S-boxes, MDS and PHT. But what about the rotary bitshifting and K2r+8? And are there other problems with reducing blocksize of Twofish cipher? Or the first question I should have asked, is it possible?

This is only for learning purpose, I know very well that 16-bits cipher is «unsecure» and highly probability for collision.

• Is there anything that you would like to show to students of this scheme that is not apparent within the reduced Rijndael cipher? Dec 24, 2016 at 14:18
• @MaartenBodewes: I think you need to re-phrase your question, I didn't understand what you was asking for. Dec 24, 2016 at 16:00
• I mean, things like S-boxes are also in AES. So if you learn to program AES, are you also not learning to implement other ciphers such as Twofish? Is there anything specific to Twofish that you want to focus on? As it is I think the question is rather broad (just try it and see where you get stuck). Dec 24, 2016 at 16:07
• I haven't yet tried to implement Twofish with 16-bit blocksize. I was looking for a answer if it is possible. Or are there pieces in Twofish that is not possible to scale down? I can give it a try and ask here if I get stuck. Dec 24, 2016 at 16:42
• @MaartenBodewes Here is a translation from SExchangeese to plain English: "guys, there are too many parts in 256bit version of the cipher. 16 bit would be so much easier to understand. Have you seen 16 bit implementation or can you write one? I would love to do it myself, but I am afraid I implement it incorrectly" Aug 16, 2018 at 14:38