C Fundamentals
Algorithms · data structures · cryptography · systems — pure C11, zero deps
Loading...
Searching...
No Matches
main.c File Reference

CLI for Caesar / Vigenère / XOR ciphers + SHA-256 hashing. More...

#include "caesar.h"
#include "sha256.h"
#include "vigenere.h"
#include "xor_cipher.h"
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

static char * join_args (int argc, char *argv[], int start)
 
int main (int argc, char *argv[])
 
static void print_usage (const char *prog)
 

Detailed Description

CLI for Caesar / Vigenère / XOR ciphers + SHA-256 hashing.

Usage: crypto-cli -e SHIFT "text" # Caesar encrypt crypto-cli -d SHIFT "text" # Caesar decrypt crypto-cli -c "ciphertext" # Caesar crack via chi-squared crypto-cli -v –key=KEY "text" # Vigenère encrypt crypto-cli -V –key=KEY "ciphertext" # Vigenère decrypt crypto-cli -x –key=KEY "text" # XOR (encrypt = decrypt) crypto-cli -s "text" # SHA-256 → hex

Definition in file algorithms/encryption/main.c.

Function Documentation

◆ join_args()

static char * join_args ( int  argc,
char *  argv[],
int  start 
)
static

Definition at line 35 of file algorithms/encryption/main.c.

Referenced by main().

◆ main()

◆ print_usage()

static void print_usage ( const char *  prog)
static

Definition at line 24 of file algorithms/encryption/main.c.

Referenced by main().