Skip to content

Add a Caesar cipher encode/decode script #12

Description

@utk2103

Add a Caesar cipher encode/decode script to scripts/.

Why

Smallest possible introduction to string manipulation, modular arithmetic, and the idea of a reversible transformation. Also a nice lead-in to "why this is not real encryption".

Suggested file

scripts/caesar_cipher.py

What it should do

  • python scripts/caesar_cipher.py encode "hello world" --shift 3
  • python scripts/caesar_cipher.py decode "khoor zruog" --shift 3
  • Bonus: --brute-force on decode, printing all 25 candidate shifts.

Acceptance criteria

  • Preserves case, and leaves spaces/digits/punctuation untouched.
  • Decoding an encoded message returns the exact original string.
  • One assert-based self-check under if __name__ == "__main__": or a tiny test_caesar_cipher.py proving the round-trip.
  • A comment noting this is a learning exercise, not secure encryption.

Inspiration

caesar_cipher from Awesome-Python-Scripts.

Good first issue — comment below to get assigned.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions