Go to file
2025-12-31 05:54:29 +02:00
aes test(aes): add AES-CBC NIST SP 800-38A test vectors 2025-12-31 04:12:20 +02:00
cipher-core feat(cipher-core): add PKCS#7 padding support 2025-12-31 00:48:49 +02:00
cipher-factory test(aes): add AES-CBC NIST SP 800-38A test vectors 2025-12-31 04:12:20 +02:00
cli feat(cli): add file encryption/decryption support 2025-12-31 04:24:51 +02:00
des docs(aes,des): add crate documentation and improve re-exports 2025-12-31 00:18:24 +02:00
web feat(web): add AES-CBC page with file encryption and UI improvements 2025-12-31 05:45:42 +02:00
.dockerignore feat(web): add Dockerfile 2025-11-26 05:49:24 +02:00
.gitignore chore: remove .env 2025-11-26 06:00:17 +02:00
Cargo.toml fix: clippy warnings 2025-11-26 06:42:29 +02:00
docker-compose.yml feat(web): add Dockerfile 2025-11-26 05:49:24 +02:00
Dockerfile feat(web): add Dockerfile 2025-11-26 05:49:24 +02:00
LICENSE-APACHE Create LICENSE-APACHE 2025-10-13 12:51:43 +03:00
LICENSE-MIT Create LICENSE-MIT 2025-10-13 12:52:21 +03:00
README.md chore: update readme 2025-12-31 05:54:29 +02:00
rust-toolchain.toml feat(web): add simple webpage 2025-11-26 01:11:19 +02:00

Cipher Workshop

A Rust workspace containing implementations of various cipher algorithms, along with a command-line interface (CLI) and a web interface to interact with them.

Features

  • AES Implementation: AES-128 in ECB and CBC modes
  • DES Implementation: DES in ECB mode
  • Command-Line Interface: Encrypt and decrypt messages or files using the supported ciphers
  • Web Interface: Browser-based encryption with file upload, drag-and-drop, and random key/IV generation

Workspace Structure

The cipher-workshop workspace is organized into the following crates:

  • aes: Implementation of the AES cipher (ECB and CBC modes)
  • cipher-core: Core traits and types for ciphers
  • cipher-factory: A factory for creating cipher contexts
  • cli: A command-line interface for the ciphers
  • des: Implementation of the DES cipher
  • web: A web interface built with Leptos

Getting Started

Prerequisites

Building the Project

Clone the repository and build the workspace:

git clone https://github.com/kristofers-solo/cipher-workshop.git
cd cipher-workshop
cargo build

Usage

CLI

The CLI allows you to encrypt and decrypt messages or files using the supported ciphers.

AES (ECB mode)

# Encrypt a message
cargo run --bin cli -- encrypt -a aes -k 0x2B7E151628AED2A6ABF7158809CF4F3C "Hello World"

# Decrypt a message
cargo run --bin cli -- decrypt -a aes -k 0x2B7E151628AED2A6ABF7158809CF4F3C 0x...

AES-CBC (with IV)

# Encrypt a file
cargo run --bin cli -- encrypt -a aes-cbc -k 0x2B7E151628AED2A6ABF7158809CF4F3C --iv 0x000102030405060708090A0B0C0D0E0F -i input.txt -o output.enc

# Decrypt a file
cargo run --bin cli -- decrypt -a aes-cbc -k 0x2B7E151628AED2A6ABF7158809CF4F3C --iv 0x000102030405060708090A0B0C0D0E0F -i output.enc -o decrypted.txt

DES

# Encrypt a message
cargo run --bin cli -- encrypt -a des -k 0x133457799BBCDFF1 "Hello"

# Decrypt a message
cargo run --bin cli -- decrypt -a des -k 0x133457799BBCDFF1 0x...

Web Interface

The web interface provides a user-friendly way to interact with the ciphers, available at: https://cryptography.kristofers.xyz/

Features:

  • DES, AES, and AES-CBC encryption/decryption
  • Random key and IV generation using Web Crypto API
  • File upload with drag-and-drop support
  • File download for encrypted/decrypted output
  • Multiple output formats: Hex, Binary, Octal, Text

To run the web interface locally:

cd web
cargo leptos watch

License

This project is licensed under either of the Apache License, Version 2.0 or the MIT license, at your option.