KCl v1.3.0 Kcl View Source
pure Elixir NaCl crypto suite substitute
The box
and unbox
functions exposed here are the equivalent
of NaCl's:
crypto_box_curve25519xsalsa20poly1305
crypto_box_curve25519xsalsa20poly1305_open
Link to this section Summary
Functions
crypto_auth
equivalent
box up an authenticated packet
derive a public key from a private key
generate a {private, public}
key pair
create an inital state for a peer connection
box based on a shared secret
unbox based on a shared secret
pre-compute a shared key
sign a message
unbox an authenticated packet
Compare auth
HMAC
validate a message signature
Link to this section Types
Link to this section Functions
Specs
crypto_auth
equivalent
Specs
box(binary(), nonce(), Kcl.State.t()) :: {binary(), Kcl.State.t()}
Specs
box up an authenticated packet
Specs
derive_public_key(key(), key_variety()) :: key() | :error
derive a public key from a private key
Specs
generate_key_pair(key_variety()) :: {key(), key()} | :error
generate a {private, public}
key pair
new_connection_state(our_private, our_public \\ nil, their_public)
View SourceSpecs
new_connection_state(key(), key() | nil, key()) :: Kcl.State.t()
create an inital state for a peer connection
A convenience wrapper around Kcl.State.init
and Kcl.State.new_peer
Specs
box based on a shared secret
Specs
unbox based on a shared secret
Specs
sign a message
If only the secret key is provided, the public key will be derived therefrom. This can add significant overhead to the signing operation.
Specs
unbox an authenticated packet
Returns :error
when the packet contents cannot be authenticated, otherwise
the decrypted payload and updated state.
Specs
Compare auth
HMAC
Specs
validate a message signature