This repository contains the official dataset evaluation and cryptographic codebase for the paper "Fuzzy security level metric of hybrid cryptosystem algorithms" by Hakan Şimşek and Ömer Faruk Öncel.
This project introduces an intelligent, human-readable, and comprehensive security metric for an AES-RSA hybrid cryptosystem by utilizing an Adaptive Network-Based Fuzzy Inference System (ANFIS) to evaluate multiple critical security parameters concurrently.
Instead of using solitary or independent metrics, this approach calculates an overall "Security Rating" between 0 and 100 based on:
- Hamming Distance (HD)
- Rényi Entropy (RE)
- Avalanche Effect (AE)
- Round Numbers (RN) (for AES)
- Key Length (KL) (for RSA)
The provided algorithms encrypt diverse files (from texts and images to audio tracks) using AES (ECB and PCBC mode) and encapsulate the key via RSA, deriving metric percentages that are fed into the fuzzy logic controller.
src/- Contains the refactored cryptography Python modules.AES_ECB.py: Performs AES encryption under ECB mode and computes statistical metrics.AES_PCBC.py: Performs AES encryption under Propagating Cipher Block Chaining (PCBC) mode and computes metrics.RSA_Hybrid.py: Performs RSA encryption (designed for encrypting the keys) and computes metrics.metrics.py: Calculation algorithms for Hamming Distance, Rényi Entropy, and Avalanche Effect.routines.py: Galois Field multiplications, shift operations, MixColumns, and S-Box transformations.
input/- A directory designated for sample input files.requirements.txt- Project dependencies.
Ensure you have Python 3.8+ installed.
-
Clone the repository:
git clone https://github.com/M3Rcrypt/Fuzzy_Security_Level_Metric_of_Hybrid_Cryptosystem.git cd Fuzzy_Security_Level_Metric_of_Hybrid_Cryptosystem -
Install dependencies:
pip install -r requirements.txt
With our refactored CLI scripts, you can quickly test files located in the input/ directory.
python -m src.AES_ECB --key "SIXTEEN_BYTE_KEY" --input "input/sample_text.txt" --output "ecb_results.txt"python -m src.AES_PCBC --key "SIXTEEN_BYTE_KEY" --iv "SIXTEEN_BYTE_IV_" --input "input/sample_text.txt" --output "pcbc_results.txt"# Uses arbitrary public key numbers e=65537, n=123456789 (Use robust prime products in reality)
python -m src.RSA_Hybrid --input "input/sample_text.txt" --e 65537 --n 123456789 --output "rsa_results.txt"The resulting *.txt output files parse the metrics which can then be directly run against the ANFIS evaluation interface.
As mentioned in the paper, the metric percentages generated from these scripts can be inputted into our MATLAB GUI Designer format.
- The Hybrid system will classify the ciphertext output into semantic groups:
Minimal Security,Basic Security,Intermediate Security,Advanced Security, andExceptional Security.
Please read the article and cite our research dynamically. The project is licensed securely under MIT (if applicable).