Skip to content
/ IS Public

A Python-based encryption project implementing RCN (Rijndael Could Never), a custom Feistel cipher improving on Twofish with 128-bit keys. Features include 16 encryption rounds, key-dependent S-boxes, zigzag transposition, LU matrix substitution, and Pseudo-Hadamard Transform for strong diffusion/confusion. Provides multiple interfaces: CLI, Flask

Notifications You must be signed in to change notification settings

umerkay/IS

Repository files navigation

Information Security Project Spring 2024

RCN CIPHER

Muhammad Umer Khan (Lead)
Shalina Riaz
Sheeza Aslam

CONFIDENTIALITY

Confidentiality is a fundamental security service that ensures
that information is not disclosed to unauthorized individuals,
entities, or processes.
Choosing confidentiality as a security service was driven by the
mathematical concepts underlying encryption algorithms. The
principles of diffusion, confusion, and elegant Feistel structures
intrigued us more than other security services, inspiring our
focus on safeguarding sensitive information through encryption.

About RCN

RCN (Rijndael Could Never) is an improvement of the Twofish cipher, implementing a custom Feistel structure with:

  • Zigzag transposition for added complexity
  • Matrix LU Substitution using key-dependent matrices
  • 128-bit encryption with enhanced key scheduling
  • 16 rounds of encryption with custom S-box and MDS transformations

How to Run

Prerequisites

  • Python 3.x
  • Flask (for web interface)

Install required dependencies:

pip install flask numpy

Option 1: Web Interface

  1. Start the Flask server:
python server.py
  1. Open index.html in your web browser

  2. Enter your text and key (up to 32 characters) to encrypt/decrypt

Option 2: Command Line

Run the main encryption/decryption script:

python main_file.py

Option 3: Direct Cipher Usage

Use the cipher directly in Python:

from rcncipher import encrypt, decrypt

# Your plaintext and key (as hex strings)
plaintext = "your_plaintext_hex"
key = "your_128bit_key_hex"

# Encrypt
ciphertext = encrypt(plaintext, key)

# Decrypt
decrypted = decrypt(ciphertext, key)

Brute Force Attack Demonstration

Run the brute force attack simulation:

python bruteforce.py

This demonstrates the computational infeasibility of brute-forcing a 128-bit key (approximately 4.53 × 10²⁰ years with standard computing power).

Project Structure

  • rcncipher.py - Core RCN cipher implementation
  • server.py - Flask web server for the GUI
  • index.html / index.css - Web interface
  • main_file.py - Command-line encryption/decryption utility
  • bruteforce.py - Brute force attack demonstration

Security Features

  • 128-bit key length providing 2¹²⁸ possible key combinations
  • Feistel structure with 16 rounds
  • Key-dependent S-boxes for enhanced security
  • Zigzag transposition for additional confusion
  • Matrix LU substitution using expanded keys
  • Pseudo-Hadamard Transform (PHT) for diffusion

For legal reasons: Rijndael probably could.

About

A Python-based encryption project implementing RCN (Rijndael Could Never), a custom Feistel cipher improving on Twofish with 128-bit keys. Features include 16 encryption rounds, key-dependent S-boxes, zigzag transposition, LU matrix substitution, and Pseudo-Hadamard Transform for strong diffusion/confusion. Provides multiple interfaces: CLI, Flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published