Giter VIP home page Giter VIP logo

e2ee's Introduction

E2EE

E2EE is an end to end encryption engine providing basic functionality with a user-friendly interface. Encryption is based on Diffie-Hellman key exchange algorithm, using 2048 bit prime number. Random values are generated with extreme value distribution, and the location of distribution is chosen empirically to escape both too short and too long calculations. The main Engine.h header file defines a singleton class called E2EE::Engine. It provides 6 functions:

  • prepareToPairWith
  • getKeyToSend
  • setReceivedKey
  • getHash
  • serialize
  • deserialize

Description

bool prepareToPairWith(const std::string& user);

Takes a username as an input parameter, generates a random number for user, stores it in temporary key storage. Returns false if the temporary storage already has a key for user or permanent storage has a hash for user. Otherwise, everything is fine and it returns true.

BigInteger getKeyToSend(const std::string& user) const;

Takes a username as an input parameter, returns corresponding (random) key from the temporary storage. If there is no key generated for user, a default constructed BigInteger object is returned, which is equal to 0.

void setReceivedKey(const std::string& user, const BigInteger& key);

Takes a username and a BigInteger key as input parameters, returns nothing. If there is a generated key for user in temporary storage, it is removed from there, encrypted with key and the result is stored in the permanent storage. If there is no key for user in temporary storage, function does nothing.

BigInteger getHash(const std::string& user) const;

Takes a username as an input parameter, returns corresponding hash from the permanent storage. If there is no hash for user, a default constructed BigInteger object is returned, which is equal to 0.

ByteArray serialize() const;

Returns a byte array of temporary and permanent storages. It's purpose is to save and restore the state of engine.

bool deserialize(const ByteArray& data);

Takes a byte array (normally returned by serialize() function) and restores the state of engine.

e2ee's People

Contributors

vgasparyan1995 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.