# Caesar Cipher

Encrypt or Decrypt Caesar Cipher. Support brute force mode (all possibilities).

### Caesar Cipher Encrypt and Decrypt

#### Encrypt or Decrypt Caesar Cipher. Support brute force mode (all possibilities).

#### What is Caesar Cipher ?

The Caesar cipher is one of the oldest cipher or encryption, founded by of course as the name implies, Julius Caesar. It is a type of substitution cipher in which each letter in the plaintext is 'shifted' . For example, with a shift of 1, H would be replaced by I, Z would become A, and so on.

The best way to imagining how this cipher works is by imagining circle with 26 character sorted alphabetically, From A-Z, and after Z, it is A.

The other way to imagine this cipher is with a long list of character that repeating the same set of character such as
`A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E F G ...`

For better understanding this cipher, you just need to imagine the alphabet can be numbered.
Such as `A is 1`

, `B is 2`

, `C is 3`

, `D is 4`

, `Z is 26`

, and continuing with other characters.

note: the shift can go both ways such as up(left) or down(right)

#### Algorithmic side

If there's a tricky question: I have encrypted text `knud`

that is shifted by 14431.

How to get the answer? do we need to shift 14431 times? it would be a tremendous work.
So, we can try to use modulo operator on math. So, 14431 mod 26 is 1. That's the answer, shift by 1.
So if we shift up `knud`

with 1 character, it would become `love`

. Question solved

#### Example

```
Good things inside ?
```

Encrypted in caesar cipher shifted with 7 :

```
Nvvk aopunz puzpkl ?
```