Skip to content

jendahejna/KeyGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KeyGenerator: Cryptographic Key Generation Tool


Description

KeyGenerator is an academic project developed as part of an Applied Cryptography course at the Brno University of Technology, Faculty of Electrical Engineering and Communication. Its core purpose is to provide a user-friendly and secure tool for generating secret keys for symmetric ciphers. The application facilitates key generation for various lengths and common encryption algorithms (e.g., AES128, 192, 256, IDEA, DES), offering flexible output formats such as DEC, HEX, and Base16.

At the heart of KeyGenerator is a robust random number generator (RNG), designed to meet high cryptographic standards. This RNG leverages multiple entropy sources and is built upon the strong foundation of a Deterministic Random Bit Generator (DRBG), specifically the HMAC_DRBG construction, as recommended by NIST SP 800-90A. The project also integrates a system for statistically testing the quality of the generated random sequences.


Deterministic Random Bit Generator (DRBG)

The core of our generator is a DRBG based on the HMAC_DRBG construction. This method was chosen due to its proven security and resilience against cryptographic attacks, as validated by machine testing. It ensures that generated keys are unpredictable and resistant to reverse engineering. The HMAC_DRBG process involves iteratively applying HMAC (Hash-based Message Authentication Code) and regularly updating its internal key and state to prevent backward traceability.

Entropy Sources

To ensure the highest quality of randomness, the DRBG is seeded with entropy collected from various sources:

  • System Random Number Generator: Utilizes the operating system's built-in entropy sources.
  • User Input: Incorporates unpredictable user interactions, such as text input from the user.
  • External API (Random.org): Leverages randomness from a trusted external service like Random.org to enhance entropy.

Randomness Testing

To verify the cryptographic quality of the generated sequences, standard statistical tests are implemented:

  • Frequency (Monobit) Test: Aims to determine if the number of ones and zeros in the sequence is approximately equal, as expected for a truly random sequence.
  • Discrete Fourier Transform (Spectral Test): Designed to detect periodic features (repeating patterns) in the sequence that would indicate a deviation from the assumption of randomness.

How to Run

  1. Clone the repository:
    git clone [https://github.com/jendahejna/KeyGenerator.git](https://github.com/jendahejna/KeyGenerator.git)
  2. Navigate to the project directory:
    cd KeyGenerator
  3. Install the required Python dependencies:
    pip install -r requirements.txt
  4. Run the main application script:
    python main.py
  5. Follow the on-screen menu to select key length, entropy source, generate keys, or run tests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages