Skip to content

Simple C program implementing the Caesar Cipher for encrypting and decrypting text.

License

Notifications You must be signed in to change notification settings

Ilchatzis/Caesar-Cipher-Decipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Caesar-Cipher-Decipher

This simple program written in C, with the purpose to encrypt and decrypt text messages using the Caesar Cipher.

How it works

Invented by Julius Caesar, this encryption technique substitutes each letter of a plain text into another letter of the alphabet. The latter is determined by the key provided. Assuming each letter of the latin alphabet is tied to an incrementing number (eg. A --> 0, B --> 1, C --> 2 etc.), the ciphered letter will be changed to the one that has a corresponding number of initial + key number. When ciphering, this shift will be on the right (initial + key). When deciphering, it will shift left (initial - key). This was implemented by adding or abstracting the key number to the ASCII values of each letter. Works only on english alphabet. A decipher is succeeded also when key = provided_key % 26. The generated text is Case-Sensitive.

Example

The word Bark needs to be ciphered. Assuming the key is set to eg. 16, the generated word is : B --> (1 + 16) % 26 = 17 --> R, a --> (0 + 16) % 26 = 16 --> q, r --> (17 + 16) % 26 = 7 --> h, k --> (10 + 16) % 26 = 0 --> a. Result = Rqha.

Use

Type encrypt or decrypt to declare function. Enter text to encrypt/decrypt. Enter key.

Screeshots

Screenshot 2022-02-23 144142 A working screeshot.

Screenshot 2022-02-23 144238 A failed decipher.

Screenshot 2022-02-23 144358 A successful decipher.

Releases

No releases published

Packages

No packages published

Languages