Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

RSA

RSA is an educational C++20 library for RSA-style encryption and decryption primitives.

Important

This project is experimental and intended for learning/library exploration. The goal is to become production-ready in the future.

Features

  • RSA-style encryption and decryption APIs
  • Public and private key structs with serialization helpers
  • Base64 helper functions for encoded key or byte-vector data

Integration

Clone the repository with its submodules:

git clone --recurse-submodules https://github.com/ParallelEngineering/RSA-Encryptor.git

To integrate the library into another CMake project, add this repository as a subdirectory and link against the RSA target:

add_subdirectory(path/to/RSA-Encryptor)
target_link_libraries(YourTarget PRIVATE RSA)

You can also build the library directly with CMake:

cmake -S . -B build
cmake --build build

Basic Usage

#include "decrypt.h"
#include "encrypt.h"
#include "keyPair.h"

#include <cstdint>
#include <string>
#include <vector>

int main() {
    keyPair keys;

    PublicKey publicKey = keys.getPublicKey();
    PrivateKey privateKey = keys.getPrivateKey();

    core::Encryptor encryptor(publicKey);
    core::Decryptor decryptor(privateKey);

    const std::string message = "hello";
    ByteArray ciphertext = encryptor.encrypt(message);
    std::string plaintext = decryptor.decrypt(ciphertext);
}

About

A simple RSA encryption and decryption library written in C++

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages