A header-only implementation of the Vigenere Cipher in C.
  • C 92.3%
  • Shell 7.7%
Find a file
2026-06-14 20:08:22 +10:00
.gitignore Initial commit 2026-06-14 20:08:22 +10:00
build.sh Initial commit 2026-06-14 20:08:22 +10:00
main.c Initial commit 2026-06-14 20:08:22 +10:00
ReadMe.md Initial commit 2026-06-14 20:08:22 +10:00
UNLICENSE Initial commit 2026-06-14 20:08:22 +10:00
vigenere.h Initial commit 2026-06-14 20:08:22 +10:00

Vigenere Cipher

Overview

This program is an implementation of the Vigenere Cipher.

https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher

The following steps are performed during encryption:

  • Read the encryption key.
  • Read the plain text input string.
  • Remove all non-alpha characters from the key and plain text input.
  • Convert any lower case characters to upper case in key and plain text.
  • Apply the cipher.
  • Display the encrypted text.

Build

Use the following command to build the program:

./build.sh

Usage

To encrypt a string:

./vigenere -k "KEY" -e "STRING TO ENCRYPT"

The above command returns:

CXPSREDSCXGPITR

To decrypt a string:

./vigenere -k "KEY" -d "CXPSREDSCXGPITR"

The above command returns:

STRINGTOENCRYPT