All Projects β†’ andrewhamon β†’ cox

andrewhamon / cox

Licence: MIT license
Crystal wrapper for the libsodium crypto API

Programming Languages

crystal
512 projects
shell
77523 projects

Projects that are alternatives of or similar to cox

pony-sodium
Safe Pony FFI wrapper for the libsodium cryptography library. 🐴 πŸ”
Stars: ✭ 24 (+60%)
Mutual labels:  libsodium, sodium
kotlin-multiplatform-libsodium
A kotlin multiplatform wrapper for libsodium, using directly built libsodium for jvm and native, and libsodium.js for js targets.
Stars: ✭ 38 (+153.33%)
Mutual labels:  libsodium
optiga-trust-m
OPTIGAβ„’ Trust M Software Framework
Stars: ✭ 86 (+473.33%)
Mutual labels:  public-key-cryptography
Kryptor
A simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign.
Stars: ✭ 267 (+1680%)
Mutual labels:  libsodium
libsalty
Elixir bindings for libsodium (NIF)
Stars: ✭ 20 (+33.33%)
Mutual labels:  libsodium
rawr-x3dh
TypeScript Implementation of X3DH
Stars: ✭ 51 (+240%)
Mutual labels:  libsodium
libgodium
Pure Go implementation of cryptographic APIs found in libsodium
Stars: ✭ 46 (+206.67%)
Mutual labels:  libsodium
Indium
Sodium addon providing support for the Fabric Rendering API, based on Indigo
Stars: ✭ 284 (+1793.33%)
Mutual labels:  sodium
practical cryptography engineering
Cryptography code examples using libsodium and mbedtls C libraries and Python cryptography and PyNaCl modules
Stars: ✭ 60 (+300%)
Mutual labels:  libsodium
secrets
Not Yet Another Password Manager written in Go using libsodium
Stars: ✭ 28 (+86.67%)
Mutual labels:  libsodium
libsodium-cmake
Wrapper around the libsodium repository providing good integration with CMake when using FetchContent or adding it as a submodule.
Stars: ✭ 21 (+40%)
Mutual labels:  libsodium
bee2
A cryptographic library
Stars: ✭ 59 (+293.33%)
Mutual labels:  public-key-cryptography
lazysodium-java
A Java implementation of the Libsodium crypto library. For the lazy dev.
Stars: ✭ 110 (+633.33%)
Mutual labels:  libsodium
dryoc
Don't Roll Your Own Crypto: pure-Rust, hard to misuse cryptography library
Stars: ✭ 163 (+986.67%)
Mutual labels:  libsodium
rust-libhydrogen
Libhydrogen bindings for Rust.
Stars: ✭ 15 (+0%)
Mutual labels:  libsodium
soda
Libsodium bindings for Erlang
Stars: ✭ 17 (+13.33%)
Mutual labels:  libsodium
prsa
RSA Public Key Encryption
Stars: ✭ 18 (+20%)
Mutual labels:  public-key-cryptography
salty
Portable NaCl-powered encryption
Stars: ✭ 26 (+73.33%)
Mutual labels:  libsodium
spake2-ee
A SPAKE2+ Elligator Edition implementation for libsodium 1.0.16+
Stars: ✭ 36 (+140%)
Mutual labels:  libsodium
liboqs-rust
Rust bindings for liboqs
Stars: ✭ 46 (+206.67%)
Mutual labels:  public-key-cryptography

cox

Build Status

Crystal bindings for the libsodium box API

Given a recipients public key, you can encrypt and sign a message for them. Upon receipt, they can decrypt and authenticate the message as having come from you.

Installation

Install libsodium, then:

Add this to your application's shard.yml:

dependencies:
  cox:
    github: andrewhamon/cox

Usage

require "cox"

data = "Hello World!"

# Alice is the sender
alice = Cox::KeyPair.new

# Bob is the recipient
bob = Cox::KeyPair.new

# Encrypt a message for Bob using his public key, signing it with Alice's
# secret key
nonce, encrypted = Cox.encrypt(data, bob.public, alice.secret)

# Decrypt the message using Bob's secret key, and verify its signature against
# Alice's public key
decrypted = Cox.decrypt(encrypted, nonce, alice.public, bob.secret)

String.new(decrypted) # => "Hello World!"


# Public key signing

message = "Hello World!"

signing_pair = Cox::SignKeyPair.new

# Sign the message
signature = Cox.sign_detached(message, signing_pair.secret)

# And verify
Cox.verify_detached(signature, message, signing_pair.public) # => true

Contributing

  1. Fork it ( https://github.com/andrewhamon/cox/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].