Giter Site home page Giter Site logo

cryptobox's Introduction

Simple Cryptobox - Simple HSM like functionality

Employing libsodium for public/private key generation, signature and verification procedure. In particular, libsodium supports curve25519 only with EdDSA for signature generation/authenticity verification.

Requirements

  • cmake 3.8 and above
  • libsodium
  • boost

Installation

Assuming

  • libsodium is installed in $SODIUM_INSTALL
git clone https://github.com/vkhristenko/cryptobox && cd cryptobox
mkdir build && cd build
cmake -DDCMAKE_PREFIX_PATH=$SODIUM_INSTALL ../
make -j N

the main executable is located in build/src/cryptobox/drivers. there is a rule for install target, but not used here for simplicity.

Usage

Key creation

./cryptobox --create 10
Key Handle 4129717526 created
Key Handle 1058730520 created
Key Handle 1584837623 created
Key Handle 2946837651 created
Key Handle 3055165083 created
Key Handle 3261598646 created
Key Handle 1943014097 created
Key Handle 2096332338 created
Key Handle 3059205084 created
Key Handle 3185867906 created

Signing a msg

  • Input comes in in the form of text. Below is an example for 32byte string
  • Output is hex-encoded binary signed message.
./cryptobox --sign aaaaaaaabbbbbbbbccccccccdddddddd --handle 4129717526
5fc21f7b503944e1ae759c2805348af22a75c6ddfe82cd99a39ba02cd80806ce67255dff66489fa39046ecc1ec28519e9ca5c74c2d5edf062439f309b11bdd016161616161616161626262626262626263636363636363636464646464646464

Verifying a signature

  • Input: signed message with handle
  • Output rejection/acceptance
./cryptobox --verify 5fc21f7b503944e1ae759c2805348af22a75c6ddfe82cd99a39ba02cd80806ce67255dff66489fa39046ecc1ec28519e9ca5c74c2d5edf062439f309b11bdd016161616161616161626262626262626263636363636363636464646464646464 --handle 4129717526
Verification: Accepted

change a single char:

./cryptobox --verify 5fc21f7b503044e1ae759c2805348af22a75c6ddfe82cd99a39ba02cd80806ce67255dff66489fa39046ecc1ec28519e9ca5c74c2d5edf062439f309b11bdd016161616161616161626262626262626263636363636363636464646464646464 --handle 4129717526
Verification: Rejected

cryptobox's People

Contributors

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