GithubHelp home page GithubHelp logo

threefish's Introduction

threefish

My implementation ThreeFish-crypt algo

Install

Run install.sh as root/sudo.

Types and interface

namespace threefish
{
    template <uint8_t SIZE_BLOCK> // SIZE_BLOCK in 64-bit words
    class Cryptor
    {
    public:
        void encrypt(const size_t count_blocks, uint64_t * source, uint64_t * destination);
        void decrypt(const size_t count_blocks, uint64_t * source, uint64_t * destination);
    };
}

Usage

#include <my_dev/threefish>

//  You can init cryptor class by std::string or uint64_t array.
//  Cryptor is template class: can be instance of <4>, <8> or <16> for 256-, 512- or 1024 bits length key/blocks:
threefish::Cryptor<4> c_256("password");
threefish::Cryptor<8> c_512(""); // password is empty string

uint64_t key[16] = {0, 1, 2, 3, 4}; // key may be define as array of uint64_t
threefish::Cryptor<16> c_1024(&key[0]);

//  Encrypt text
uint64_t plaintext[SIZE_TXT] = { /* your text */ }; 
uint64_t ciphertext[SIZE_TXT] = { /* place for ciphertext */ };

c_1024.encrypt(SIZE_TXT / 16, &plaintext[0], &ciphertext[0]); // 16 because is SIZE_BLOCK for current example cryptor (1024 bit)

//  Decrypt text
c_1024.decrypt(SIZE_TXT / 16, &ciphertext[0], &plaintext[0]); 

threefish's People

Contributors

dvolkow avatar

Stargazers

 avatar  avatar

Watchers

 avatar

threefish's Issues

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.