Crate sodiumbox

Crate sodiumbox 

Source
Expand description

Pure Rust implementation of libsodium’s sealed box encryption/decryption.

This crate provides a standalone implementation of the sealed box functionality from libsodium (NaCl) using only pure Rust cryptographic libraries. It is fully compatible with sealed boxes created by libsodium/sodiumoxide.

§Features

  • seal: Create a sealed box for a recipient’s public key
  • open_sealed_box: Open a sealed box using the recipient’s keypair
  • Pure Rust implementation with no C dependencies

Structs§

PublicKey
A Diffie-Hellman public key
StaticSecret
A Diffie-Hellman secret key that can be used to compute multiple SharedSecrets.

Constants§

PUBLICKEYBYTES
The length of a Curve25519 public key in bytes (for compatibility with sealed box format)

Functions§

generate_keypair
Generate a new X25519 keypair for use with sealed box operations
open_sealed_box
Opens a sealed box using RustCrypto libraries.
public_key_from_bytes
Convenience function to convert a public key from bytes to the PublicKey type
seal
Creates a sealed box for a message using a recipient’s public key.
secret_key_from_bytes
Convenience function to convert a secret key from bytes to the StaticSecret type