A simple command-line cipher tool that allows users to encrypt and decrypt text using a Caesar Cipher algorithm.
- Encrypts plaintext using Caesar Cipher
- Decrypts ciphertext back to readable text
- Handles invalid user input safely
- Runs in a loop until the user chooses to exit
- The program takes a text input (plaintext or ciphertext) and a numeric key (0–26)
- Each letter is shifted forward or backward in the alphabet based on the key
- The result is displayed to the user
-
Compile the program using c compiler : Example : gcc cipher-tool.c -o cipher-tool
-
Run the program: ./cipher-tool
Enter the first letter
Encrypt(E) or Decrypt(D): e
Text: Hello, world
Code: 7
Ciphertext: OLSSV, DVYSK
Do you want to encrypt or decrypt anything else (y/n): n
- How to structure a C program using functions for better modularity
- How to perform dynamic memory allocation using malloc and safely free memory using free
- How to manipulate strings and process text character by character
- How to validate user input and handle errors in a CLI program
- C
Mostafa Oraby