Giter VIP home page Giter VIP logo

rsakey-gen's Introduction

RsaKey-Gen

This is a C++ program that generates RSA keys using the gmp library. It provides a command-line interface (CLI) to generate RSA keys, encrypt and decrypt messages.

Dependencies

The program has the following dependencies:

Getting Started

Compiling

To compile the project on a Mac M1, use the following command:

clang++ -I/opt/homebrew/Cellar/gmp/6.2.1_1/include -L/opt/homebrew/Cellar/gmp/6.2.1_1/lib -lgmp -lgmpxx  main.cpp utils/*

Usage

Generating RSA Keys:

To generate a key, use the following command:

❯ ./a.out -h
Rev 0.1a | Last update 09 mar 2022
(c) 2023 Aubertin Emmanuel (aka aTHO_)

RSA
Usage:RSA| [-h | --help] | [-v | --version]  
                -h  Help
                -v  Version
                -s  RSA key gen with bits size

Example : ./RSA -s 1024

CLI Mode:

To launch the CLI mode, use the -cli argument:

./a.out -cli

To see the help in CLI, type help:

>help
Rev 0.1a | Last update 22 mar 2023
(c) 2023 Aubertin Emmanuel (aka aTHO_)

RsaKey cli
Contrl+c for exit
List of all available commands:
        keygen          Generates RSA key
        crypt           Encrypts a message with the current key. You need to generate a key first.
        decrypt         Decrypts a message with the current key. You need to generate a key first.

The first step is to generate a key. To do this, use the following command:

>keygen -s 16
Create New key : 
Key has been created
Compute time for key generation : 0.001092
##############################################
| Key length : 16
|----------------------------------------------
| public key    ==> 583167853
| private key   ==> 100945765
|----------------------------------------------
| Extra info : 
|       n = 1974137141
|       phi(n) = 1974045312
|       p = 57493
|       q = 34337
##############################################

You can see the usage of keygen with -h.

To encrypt and decrypt messages, use the crypt and decrypt commands respectively. Here is an example:

>crypt -m jesuisceri
1327030971 1496702623 288121575 1151377270 1755681820 702415140 998537965 221146567 702415140 366773913 1755681820 841717706 221146567 288121575 


>decrypt -m 1327030971 1496702623 288121575 1151377270 1755681820 702415140 998537965 221146567 702415140 366773913 1755681820 841717706 221146567 288121575
-m jesuisceri 

License

This program is licensed under the MIT License. Please see the LICENSE file for more details.

rsakey-gen's People

Contributors

emmanuel-aubertin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.