SodiumSeal.jl

Wraps libsodium's sealed boxes
Author christopher-dG
Popularity
2 Stars
Updated Last
10 Months Ago
Started In
February 2020

SodiumSeal

Stable Dev Build Status

SodiumSeal wraps libsodium's sealed boxes.

julia> using SodiumSeal

julia> k = KeyPair()
KeyPair(...)

julia> plaintext = rand(UInt8, 4)
4-element Array{UInt8,1}:
 0x72
 0x01
 0xbd
 0x23

julia> ciphertext = seal(plaintext, k);

julia> unseal(ciphertext, k)
4-element Array{UInt8,1}:
 0x72
 0x01
 0xbd
 0x23

You can also work with existing keys and Base64-encoded data.

julia> using Base64, SodiumSeal

julia> k = KeyPair("IOI7mQ2HxD6yrtVlD/HdQ0YRJVdwKfdf9+VOeuvXjDI=")
KeyPair(...)

julia> plaintext = base64encode(rand(UInt8, 4))
"qrSWSQ=="

julia> seal(plaintext, k)
"Y82B4YedK8EfA7MoBVG1GUlfq28c+khmHT1gENk8m0dyBvJlyh+wCud8JkLTrGXyAShP2w=="