cryptography

Definition

Caesar's Cipher

The Caesar cipher is a substitution cipher that uses a symmetric key (a number or a letter) to shift each character of the plaintext by this number. It is a monoalphabetic cipher.

Examples

Example with a shifting number

Input: Baba bebt
Output: Hghg hkhz

Example with a shifting letter

Key: ‘N’
Input: NORAQRFFRA HZ NPUG ORV ZVE
Output: ABENDESSEN UM ACHT BEI MIR

Alphabet:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
NOPQRSTUVWXYZABCDEFGHIJKLM