ALLAN JAMES EDGAR

Diffie-Hellman and RSA Encryption Emulator


Home Hardware Software Venture

As with many of my projects, this started off with me realising that I had no idea how a certain topic worked. That topic was encryption, specifically asymmetric encryption. While specific symmetric encryption implementations were over my head, their functioning seemed intuitive. Scramble message with x, unscramble with x. For the sake of consistency that scrambler is henceforth referred as the cypher, as not to further rustle any crypto-feathers. In order to better understand the condepts I intended to recreate this whole system in a software simulation. The goal was to re-make it and subsequently, break it. This whole simulation was performed in Matlab. Within said simulation there were software emulations of individual clients/servers that were being studied. The emulated systems consisted of two "computers" trying to talk to each other and one "malicious actor" who was privy to their communications.

In order to extablish a common encryption scheme I decided to take the "Diffie Hellman" key exchange for a spin. ##### GOT HERE created a prime generator and generated a list of primes large enough to create a 128 bit hash with a message. The emulator consisted of 5 objects posing as addressed terminals 1 Server object and 1 Wire-tap object. Messages sent between terminals were intercepted by the wiretap so I first created a diffie-hellman key exchange protocol to allow secure transmission of messages between terminals, this broke down with floating point error when calculating the modulus so I had to make a function that performed the task in binary to avoid this and returned an integer. After this I made a best guess decryption for the wiretap that was successful with low prime modulus but broke as this number increased. Then I created an RSA keygen to negate the problem of having multiple keys to decrypt messages from different senders.

As with many of my projects, this started off with me realising that I had no idea how a certain topic worked. That topic was encryption, specifically asymmetric encryption. While specific symmetric encryption implementations were over my head, their functioning seemed intuitive. Scramble message with x, unscramble with x. For the sake of consistency that scrambler is henceforth referred as the cypher, as not to further rustle any crypto-feathers. In order to better understand the condepts I intended to recreate this whole system in a software simulation. The goal was to re-make it and subsequently, break it. This whole simulation was performed in Matlab. Within said simulation there were software emulations of individual clients/servers that were being studied. The emulated systems consisted of two "computers" trying to talk to each other and one "malicious actor" who was privy to their communications.

In order to extablish a common encryption scheme I decided to take the "Diffie Hellman" key exchange for a spin. ##### GOT HERE created a prime generator and generated a list of primes large enough to create a 128 bit hash with a message. The emulator consisted of 5 objects posing as addressed terminals 1 Server object and 1 Wire-tap object. Messages sent between terminals were intercepted by the wiretap so I first created a diffie-hellman key exchange protocol to allow secure transmission of messages between terminals, this broke down with floating point error when calculating the modulus so I had to make a function that performed the task in binary to avoid this and returned an integer. After this I made a best guess decryption for the wiretap that was successful with low prime modulus but broke as this number increased. Then I created an RSA keygen to negate the problem of having multiple keys to decrypt messages from different senders.