Algorithms & Programming

Caesar Cipher

A C# Windows Forms tool that encrypts text with the Caesar cipher and shows the alphabet shift on a rotating Caesar wheel.

Illustration of a Caesar wheel with a shift of 3: the inner alphabet is rotated so that A becomes D (not a screenshot)
Category
Algorithms & Programming
Period
2025
Stack
C#, C# Windows Forms, Algorithms
Source
—
Overview

About the project

This Windows Forms application encrypts text with the Caesar cipher. The user types a message, chooses a shift between −26 and +26 with a slider and gets the encrypted message in a separate, read-only field. Each letter moves by the chosen number of positions and wraps around from Z to A; uppercase and lowercase are preserved, while spaces, digits and punctuation stay unchanged.

Next to the text fields, a Caesar wheel drawn with System.Drawing makes the shift visible: the outer ring shows the fixed alphabet and the inner ring rotates with the slider, so each letter lines up with the letter that replaces it. Because the shift can be negative, the same tool can also decode a message by applying the opposite shift. The cipher works on the 26 letters of the Latin alphabet; accented letters are not supported.

Main features

What it does

  • Caesar cipher encryption of a typed message
  • Shift from −26 to +26 selected with a slider
  • Caesar wheel with a fixed outer alphabet and a rotating inner ring
  • Case preserved; spaces, digits and punctuation unchanged
  • Decoding by applying the opposite (negative) shift
  • Encrypt button enabled only when text has been entered
Development challenges

Problems to solve

  1. Implementing the shift with modular arithmetic so that letters wrap around the alphabet in both directions, for positive and negative shifts.
  2. Drawing the wheel in two layers with System.Drawing: a static background with the fixed alphabet and an inner ring that is redrawn whenever the shift changes.
  3. Placing the 26 letters around the circles with trigonometry so that each inner letter lines up with the letter it replaces.
Open to internships, apprenticeships & junior roles

Internship, apprenticeship or junior role? Let's talk.

I'm looking for an internship, an apprenticeship or a junior developer position, and I'm also open to selected freelance projects. Feel free to get in touch.