Skip to content

NIR3X/CryptoRand.cpp

Repository files navigation

CryptoRand.cpp - Random Key Generation using Cryptographic Techniques

The CryptoRand.cpp module provides a secure method for generating random keys using cryptographic techniques and user interactions.

Description

This module utilizes cryptographic algorithms along with user interactions (mouse movements) to generate random keys. It employs Xorshift random number generators for additional randomness.

Features

  • Generates random keys securely.
  • Utilizes cryptographic algorithms for randomness.
  • Incorporates user interactions (mouse movements) for added entropy.

Installation

To use this package, you can clone the repository and compile it using a C++ compiler:

git clone https://github.com/NIR3X/CryptoRand.cpp
cd CryptoRand.cpp
make

Usage

  1. Include the necessary header file: CryptoRand.h.
  2. Call the CCryptoRand::Read() function to generate a random key.
  3. Provide a callback function to track the progress of key generation.
  4. Ensure the generated key is used securely in your application.

Example usage:

#include "CryptoRand.h"
#include <cstdint>
#include <cstdio>

int main() {
	uint8_t key[256];
	CCryptoRand::Read(key, sizeof(key), [] (float progress) {
		printf("\rMove the mouse around to generate a random key: %.2f%%", progress * 100.f);
	});
	printf("\rKey: ");
	for (uint8_t byte : key) {
		printf("%d ", byte); 
	}
	printf("\n");
}

License

GNU AGPLv3 Image

This program is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

About

CryptoRand.cpp - Random Key Generation using Cryptographic Techniques

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published