> For the complete documentation index, see [llms.txt](https://security.navidnaf.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://security.navidnaf.com/platform-9-3-4/cryptography/caesar-cipher.md).

# Caesar Cipher

<figure><img src="https://244896893-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTy5fNwfsaV6DbqjnheTF%2Fuploads%2FwtcNo2jRJW6fyOwVGeMc%2Fpiloty.1920x0.jpg?alt=media&amp;token=e1192a51-fbdb-4470-8750-5b8ac883a1c9" alt=""><figcaption></figcaption></figure>

Caesar Cipher shifts the letter by a fixed number of places to the left or to the right.&#x20;

```
// Shifting by 3

F: A B C D E F G H I J K L M N .....
T: D E F G H I J K L M N O P Q.....
```

To decrypt this, the recipient should know that it has been shifted by 3.

```
// Using this, Encrypt: 'CRYPTOGRAPHY'

F: C R Y P T O G R A P H Y
T: F U B S W R J U D S K B
```

* The Caesar Cipher uses a key between 1 and 25.
* A key of 1 shifts each letter by one position (A becomes B).
* A key of 25 shifts each letter by 25 positions (A becomes Z).
* A key of 0 or 26 results in no change (full rotation). \[**Key of 0**: Each letter is shifted by 0 positions, meaning every letter stays the same.; **Key of 26**: There are 26 letters in the English alphabet. Shifting each letter by 26 positions brings it back to its original position, completing a full rotation of the alphabet.]
* The Caesar Cipher has a keyspace of 25 different keys.
