SignalProtocol (libsignal_protocol v0.1.0)

View Source

Signal Protocol implementation for Elixir.

This module provides a high-level interface to the Signal Protocol, implementing end-to-end encryption for secure messaging.

Summary

Functions

Returns a specification to start this module under a supervisor.

Creates a new session with the given local and remote identity keys.

Decrypts a message using the given session.

Encrypts a message using the given session.

Generates a new identity key pair.

Generates a new pre-key with the given ID.

Generates a new signed pre-key with the given ID, signed by the identity key.

Processes a pre-key bundle to establish a session.

Starts a new Signal Protocol session manager.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

create_session(local_identity_key, remote_identity_key)

Creates a new session with the given local and remote identity keys.

Returns {:ok, session} on success, where session is an opaque reference to the session state.

decrypt_message(session, ciphertext)

Decrypts a message using the given session.

Returns {:ok, plaintext} on success.

encrypt_message(session, message)

Encrypts a message using the given session.

Returns {:ok, ciphertext} on success.

generate_identity_key_pair()

Generates a new identity key pair.

Returns {:ok, {public_key, signature}} on success.

generate_pre_key(key_id)

Generates a new pre-key with the given ID.

Returns {:ok, {key_id, public_key}} on success.

generate_signed_pre_key(identity_key, key_id)

Generates a new signed pre-key with the given ID, signed by the identity key.

Returns {:ok, {key_id, public_key, signature}} on success.

process_pre_key_bundle(session, bundle)

Processes a pre-key bundle to establish a session.

Returns :ok on success.

start_link(opts \\ [])

Starts a new Signal Protocol session manager.

Options

  • :name - The name to register the process under (optional)