Code Monkey home page Code Monkey logo

rcrypt's Introduction

πŸ”‘ rcrypt

‼️ Patenting in process. Don't try to steal or you'll lose your money.

What is it?

This repository was used to conceive and implement rcrypt encryption+hashing algorithm.
rcrypt was made to encrypt/hash information(specifically passwords) with pretty bad performance.

It is also a part of RedLibrary.

What about speed?

It's about 1026.6x - 2328.6x speed down, comparing to Sha256 algorithm.

How to use it?

All functions are in 'rcrypt.h'.

//
// Rcrypt -512 bits-
//
    
/**
 * @brief rcrypt512_enc
 *
 * @param key Key.
 * @param str Information to be locked.
 */
inline void rcrypt512_enc(std::string_view key, std::string *str) {...}

/**
 * @brief rcrypt512_dec
 *
 * @param key Key.
 * @param str Information to be unlocked.
 */
inline void rcrypt512_dec(std::string_view key, std::string *str) {...}

/**
 * @brief rcrypt512_hash
 *
 * @param key Key.
 * @param str Information to be encrypted and hashed after that.
 *
 * @return Pointer to a new string with hash.
 */
inline std::string * rcrypt512_hash(std::string_view key, std::string_view str) {...}


//
// Rcrypt -1024 bits-
//

/**
 * @brief rcrypt1024_enc
 *
 * @param key Key.
 * @param str Information to be locked.
 */
inline void rcrypt1024_enc(std::string_view key, std::string *str) {...}

/**
 * @brief rcrypt1024_dec
 *
 * @param key Key.
 * @param str Information to be unlocked.
 */
inline void rcrypt1024_dec(std::string_view key, std::string *str) {...}

/**
 * @brief rcrypt1024_hash
 *
 * @param key Key.
 * @param str Information to be encrypted and hashed after that.
 *
 * @return Pointer to a new string with hash.
 */
inline std::string * rcrypt1024_hash(std::string_view key, std::string_view str) {...}


//
// Rcrypt -1536 bits-
//

/**
 * @brief rcrypt1536_enc
 *
 * @param key Key.
 * @param str Information to be locked.
 */
inline void rcrypt1536_enc(std::string_view key, std::string *str) {...}

/**
 * @brief rcrypt1536_dec
 *
 * @param key Key.
 * @param str Information to be unlocked.
 */
inline void rcrypt1536_dec(std::string_view key, std::string *str) {...}

/**
 * @brief rcrypt1536_hash
 *
 * @param key Key.
 * @param str Information to be encrypted and hashed after that.
 *
 * @return Pointer to a new string with hash.
 */
inline std::string * rcrypt1536_hash(std::string_view key, std::string_view str) {...}

Tech notes:

  • Padding is provided only for "in" params. Key length(in bytes) is calculated using the formula:
    KEY_LENGTH / 8.
  • This library is designed for small code size and simplicity, intended for cases where small binary size, low memory footprint and portability is more important than high performance.

Notes:

  • If you want to route result of encryption to std::cout, you should convert string to hexadecimal system, in other way you will get bad output!
  • There is no built-in error checking or protection from out-of-bounds memory access errors as a result of malicious input.

Screenshots? Here they are:

Here's an example of encryption in rcrypt512 mode:

And the following one is the decryption of previous message:

All material in this repository is in the public domain.
With Copyright© ∞ Vladimir Rogozin.

rcrypt's People

Contributors

red-sayed avatar

Stargazers

 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.