Coder Social home page Coder Social logo

georgyfirsov / bc-lib Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 299 KB

Tiny library with block ciphers implementation for my cryptography research

Home Page: https://georgyfirsov.github.io/bc-lib/

License: GNU General Public License v3.0

CMake 25.22% C 60.48% C++ 11.72% Dockerfile 1.46% Shell 1.12%
block-cipher cryptography secret-key-encryption symmetric-cryptography symmetric-key-cryptography

bc-lib's Introduction

bc-lib

Warning This library is implemented for research purposes only! It intentionally doesn't verify some parameters for validity. In real world all parameters MUST be properly verified.

Tests codecov

Supported block ciphers

This library implements not so many cryptographic algorithms, because, as it was said above, it was developed during my research about full disk encryption (FDE) and does't aim to seize all existing block ciphers.

Kuznyechik (GOST 34.12-2018)

For algorithm specification you shuld refer to GOST 34.12-2018. Here is usage example:

//
// Initialize block cipher interface (this is the only way to use ciphers)
//

BLOCK_CIPHER cipher;
kuznyechik_initialize_interface(&cipher);

//
// Create encryption and decryption key schedules from a 256-bit binary key
//

KEY ekey;
KEY dkey;
cipher->initialize_encrypt_key(binary_key, &ekey);
cipher->initialize_decrypt_key(binary_key, &dkey);

//
// And now encrypt plaintext block
//

__m128i plaintext_block  = ...;
__m128i ciphertext_block = ...;
cipher->encrypt_block(plaintext_block, &ekey, &ciphertext_block);

//
// Decryption is straightforward too
//

__m128i decrypted_block = ...;
cipher->decrypt_block(ciphertext_block, &dkey, &decrypted_block);

bc-lib's People

Contributors

georgiifirsov avatar

Stargazers

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