The Keyed Caesar cipher is a variation of the classical Caesar cipher, adapted to increase security by combining a keyword with a shift-based substitution. The original Caesar cipher, attributed to Julius Caesar around 58–50 BCE, shifts each letter of the alphabet by a fixed number of positions. In the Keyed Caesar cipher, a keyword is first used to create a modified alphabet: the letters of the keyword are placed at the start of the alphabet (omitting duplicates), followed by the remaining unused letters in standard order. After generating this keyed alphabet, the usual shift is applied to produce the ciphertext. This method preserves the simplicity of the Caesar cipher while breaking the simple linear pattern, making frequency analysis slightly more difficult.
For example, using the keyword KEY and a shift of 3, the modified alphabet begins with K E Y, followed by the remaining letters in order excluding K, E, Y. The plaintext “HELLO” is then encrypted by locating each letter in the standard alphabet and replacing it with the letter 3 positions ahead in the keyed alphabet. Using this approach, H maps to I, E to F, L to N, the second L also to N, and O to Q, producing the ciphertext IFNNQ. Decryption reverses the process by shifting letters backward through the same keyed alphabet.
The Keyed Caesar cipher is symmetric and fully reversible, but it remains relatively weak by modern standards because it is a monoalphabetic substitution: each plaintext letter always maps to the same ciphertext letter. Its security depends on the secrecy of both the keyword and the shift value. Historically, it was used to increase the difficulty of simple Caesar-based encoding in educational or low-security contexts, demonstrating how combining keyword permutation with traditional shifts can strengthen classical ciphers. Practicing with examples like “HELLO” and the key KEY illustrates how the modified alphabet and shift interact to produce a more unpredictable ciphertext while maintaining the reversibility that makes Caesar-style ciphers easy to use and understand.