From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Adding plugs to the Enigmatic encryptor

Adding plugs to the Enigmatic encryptor - Python Tutorial

From the course: Learning Assembly Language

Start my 1-month free trial

Adding plugs to the Enigmatic encryptor

- [Narrator] In order to finish setting up the enigmatic encryptor, we need to simulate the plug board and allow for up to two pairs of characters to be exchanged. I've made the changes, so let's take a look at them. At line 14, we've got a new message, message 3, as a prompt for entering a plug as two characters in our 0 to F alphabet. And at line 43, where we originally had two plug placeholders, plug1 and plug2, we now have a 16-byte array filled with the values 0 to F in hexadecimal. This is our array to use for plug substitutions. We'll be reading characters from the console and storing them as nibbles, so we need to have a routine to do the conversion. We've already done this conversion when we checked the starting position for the rotor. So at line 55, I've taken that code and made it into a callable subroutine. As we did with the slots, at line 69 I've declared a framed subroutine called LoadPlug to read the…

Contents