I am currently working in Logisim and was wondering if I can design some ciphers in the same. One such cipher is PRESENT cipher which is essentially a block cipher. I did get that I need to design the S and P boxes for the same but I am having difficulty starting with the same. The issue is that I am not sure which electronic parts I should use to get the desired output. I'd appreciate it if I could get a starting point for the cipher which would then make things a bit more clearer to me. Thanks!
-
\$\begingroup\$ It's not clear what exactly you are asking. Can you write a Boolean equation for the function you want to implement? \$\endgroup\$– Elliot AldersonCommented Oct 9, 2019 at 17:44
-
\$\begingroup\$ I suggest these instead schneier.com/academic/twofish/download.html This is proven technology that is proven secure so far.. \$\endgroup\$– D.A.S.Commented Oct 9, 2019 at 18:35
2 Answers
Since you are asking how to create the S-box of the linked document: This S-box is a lookup table of 4 bits input to 4 bits output.
The P-layer is "just" wiring. I would generate a sub-circuit for this.
Please be aware that Logisim is limited to 32 bits per multibit-wire. You will need multiple wires.
Alternative 1:
Use the ROM component with 4 bits input and 4 bits output for the S-box.
Alternative 2:
You can use the Combinatorial Analysis window to enter the translation table for the S-box. Then let Logisim build the circuit.
Use it as a component for your main circuit.
Note: Admittedly it is simpler to use a high level hardware description language. To look into the bits, it is still a good exercise to do this on lower levels. Some years ago I built a simple 4-bit computer with Logisim.
Implementing cryptographic components in hardware is hard enough – use a hardware description language like Verilog or VHDL, or the more modern Chisel or migen.
You'd be crazy and, if I was your advisor, prone to wasting time, to try and implement something of that complexity in Logisim GUI. Use logisim-evolution (logisim itself is pretty dead), and place a "VHDL component" or whatsitcalled. Implement your S-Box using VHDL (or something that compiles to VHDL), and simulate it with the tools of the digital design trade. Logisim is a purely educational tool for small circuits.
Still, this is not really a useful thing to do. S-Boxes, even trivial ones, will be too complex to understand visually.