Skip to content
This repository has been archived by the owner on Feb 6, 2021. It is now read-only.
/ C5 Public archive

C5 - Counter Conventional Caesar Cipher Contraption

License

Notifications You must be signed in to change notification settings

a-p-jo/C5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C5

C5 is short for Counter Conventional Caesar Cipher Contraption

Full Disclosure :

C5 is not intended for any commercial or serious security purposes. It is loosely based on the Vigenère Cipher and the Caesar Cipher, and remains, a shift cipher at its core. It's intended for making puzzle-ciphers and for the purposes of throwing off casual snooping. A challenge to break C5 is posted here , and while not yet cracked, it is only a matter of time. It is not immune to being treated as multiple caesar ciphers, where it may be broken by frequency analysis, as long as the message is long enough.

Algorithm/Steps:

C5 cipher involves maximum 8 different shifts applied mostly unevenly across the message, resulting in ciphertext that is not easy to casually crack. It is not necessary that all 8 shifts are used, nor that 8 shifts have unique values, nor even that all 8 shifts have non-zero values -- all this depends on the pin and the length of the message.

Hence, a number can be ecnrypted as itself, and the ciphertext can prima facie be very random looking in most cases.

  • Encryption :
  1. Pin is taken. Pin has 8 digits. These digits are stored individually in an array.These digits are used as the 8 possible shifts.
  2. A Message is taken from the user, stored into a string 'msg'.
  3. Each character in msg is changed depending on its position value. The position number is matched with 6 mathematical number series. Depending on which it matches with, a digit from the pin is used as a shift on the char in that position. If it is a part of none of these series, the position value is checked for being odd or even. The shifted value is stored as an int.(ASCII value of char x is used for the shift operations)
  4. Each int is stored in an int array 'en'. Then, all elements of en are printed in hex , with a space separating each from the other , and the last number is always -de (hex for -222, used to terminate input in decryption).
  • Decryption :
  1. Pin is taken and digits are stored to array.
  2. Ciphertext is taken from user.
  3. Every entered int is stored and the same rules as in encrypt are applied and reversed according to the entered pin and stored to string 'msg_d'.
  4. String 'msg_d' is printed, and if pin was correct, the decoded text makes sense and is the same as the original message.
  • Example :

Message = "hello"

PIN = "12345678"

Ciphertext = 63 68 6f 67 70 -de