GithubHelp home page GithubHelp logo

grachale / hybrid_encryption Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 15 KB

Implementation of two functions in C++ (seal and open) that encrypt/decrypt data using hybrid encryption.

C++ 100.00%
ciphers cpp openssl

hybrid_encryption's Introduction

Hybrid encryption

Implementation of two functions in C++ (seal and open) that encrypt/decrypt data using hybrid encryption.

Function Parameters for "seal":

bool seal(const char* inFile, const char* outFile, const char* publicKeyFile, const char* symmetricCipher);

inFile: The file containing binary data to be encrypted.

outFile: The output file where all necessary information for decryption will be stored.

publicKeyFile: The public key to be used for encrypting the symmetric key.

symmetricCipher: The name of the symmetric cipher used for encryption.

Return value: true on success, false otherwise. If the function fails, you must ensure that the output file outFile will not exist.

The seal function generates a symmetric key and an initialization vector (IV) as inputs for the symmetric cipher symmetricCipher. Using this cipher, key, and IV, the function encrypts the data in inFile. The key for the symmetric cipher is encrypted with an asymmetric cipher (RSA) using the public key stored in publicKeyFile.

Function Parameters for "open":

bool open(const char* inFile, const char* outFile, const char* privateKeyFile);

inFile: The encrypted file in the same format as the output file from the seal function.

outFile: The output file where all decrypted data will be stored (expecting binary match with the input file from the seal function).

privateKeyFile: The private key used for decrypting the encrypted key.

Return value: true on success, false otherwise. If the function fails, you must ensure that the output file outFile will not exist.

hybrid_encryption's People

Contributors

grachale avatar

Stargazers

Alexandr Burakov 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.