4 Replies - 1157 Views - Last Post: 08 July 2015 - 11:59 AM

#1 DevgruSeal   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 18-July 07

Cryptography: Is there a term for this modified Caesar cipher?

Posted 06 July 2015 - 08:18 PM

I'm trying to learn C# and decided to write an encryption/decryption program. My idea is based on a Caesar cipher, but also inspired by the Enigma machine. I was wondering if there's a term for this kind of encryption so that I could learn more about it.

Here's a quick run-down:

There exists a set of three "rotors." After each letter is encoded, Rotor 1 increments forward. After the first rotor reaches its maximum value, it wraps around and increments the next rotor. So on and so forth for Rotor 2 and Rotor 3... Essentially, these act as the rotors from the Enigma machine. In my implementation, I would add the value of these three wheels to obtain a Shift value.

Example:
    Starting wheel value with max of 5 per each wheel: (5) (1) (2) [Added together, the Shift value = 8]
    Message is defined as: ABCD
    Step 1: A = 1 (+ 8) = 9 = (I) [Increment: (1) (2) (2) = 5]
    Step 2: B = 2 (+ 5) = 7 = (G) [Increment: (2) (2) (2) = 6]
    Step 3: C = 3 (+ 6) = 9 = (I) [Increment: (3) (2) (2) = 7]
    Step 4: D = 4 (+ 7) = 11 = (K)



So here's my question: Is this basically a modified Caesar cipher? The only difference seems to be that after each letter is encoded, the shift value changes. As long as the three "rotors" are in the correct starting position as when encrypted, the message can be decrypted by subtracting the Shift Value from the message letter value, correct? e.g., IGIK -> I=9 -> 9-8 = 1 -> 1=A Is there another term for this style of encryption so that I can understand it better, or the mathematics involved?

I should note I'm not going for a high-security encryption - I understand this cipher has certain weaknesses - this is just a programming exercise to practice and learn a bit of C#, cryptographic basics, etc in the process.

Thanks! Feel free to ask for clarification on anything if I didn't make sense.

Is This A Good Question/Topic? 0
  • +

Replies To: Cryptography: Is there a term for this modified Caesar cipher?

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Cryptography: Is there a term for this modified Caesar cipher?

Posted 06 July 2015 - 08:50 PM

The Caesar Cipher is a monoalphabetic ciphers. The Vigenere Cipher and Enigma Cipher are both examples of polyalphabetic ciphers.

It might be worth analyzing how to break the Enigma. You get into things like group theory; in particular, the Symmetry group (the group of permutations). Group theory comes up a lot in cryptography (particular with rings and fields, as you'll see if you study AES). Number Theory is another good subject to study if you're interested in cryptography.
Was This Post Helpful? 1
  • +
  • -

#3 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4303
  • View blog
  • Posts: 13,677
  • Joined: 08-June 10

Re: Cryptography: Is there a term for this modified Caesar cipher?

Posted 06 July 2015 - 09:28 PM

Quote

It might be worth analyzing how to break the Enigma.

visit Bletchley Park. For starting (with Enigma encryption) I found it more interesting than any book.
Was This Post Helpful? 1
  • +
  • -

#4 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7915
  • View blog
  • Posts: 26,425
  • Joined: 05-May 12

Re: Cryptography: Is there a term for this modified Caesar cipher?

Posted 07 July 2015 - 02:17 PM

The shift schedule is actually not that complicated:
   3   4   5   6   7
       4   5   6   7   8
           5   6   7   8   9
               6   7   8   9  10
                   7   8   9  10  11
                       8   9  10  11  12
                           9  10  11  12  13
                              10  11  12  13  14
                                  11  12  13  14  15



Get the rotor 3 + rotor 2 - 2. Go down these number of rows. Then count to the right rotor 1 - 1 columns. From this is the initial shift. From that point on, it's just try to move right. If you can't move right, move to the beginning of the next row. If you are the the end of the last row, go to the first row. I'm quite sure there is a simple formula to demonstrate it, but the graphic makes it quite clear how the shift schedule looks.
Was This Post Helpful? 0
  • +
  • -

#5 ishkabible   User is offline

  • spelling expret
  • member icon





Reputation: 1749
  • View blog
  • Posts: 5,901
  • Joined: 03-August 09

Re: Cryptography: Is there a term for this modified Caesar cipher?

Posted 08 July 2015 - 11:59 AM

View Postmacosxnerd101, on 07 July 2015 - 04:50 AM, said:

The Caesar Cipher is a monoalphabetic ciphers. The Vigenere Cipher and Enigma Cipher are both examples of polyalphabetic ciphers.

It might be worth analyzing how to break the Enigma. You get into things like group theory; in particular, the Symmetry group (the group of permutations). Group theory comes up a lot in cryptography (particular with rings and fields, as you'll see if you study AES). Number Theory is another good subject to study if you're interested in cryptography.


It sounds kind of nerdy but learning about finite fields (the algebra that AES is based off of) was one of the more fun aspects of my abstract algebra class (which I otherwise found quite bland and boring). It isn't all that hard to write a program that computes the field operation for GF(2^n) as long as you know some irreducible polynomial of order n. Higher characteristics (GF(2^n) has characteristic 2) are harder; I'm pretty sure you need to know M-1 irreducible polynomials to perform the filed operations on a finite filed of characteristic M. Finding irreducible polynomials is also tricky too; just kind of all around fun math if you ask me.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1