Coder Social home page Coder Social logo

gferon / libsignal-protocol-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whisperfish/libsignal-protocol-rs

0.0 2.0 0.0 28.48 MB

A Rust interface to the Signal Protocol.

Home Page: https://michael-f-bryan.github.io/libsignal-protocol-rs

License: GNU General Public License v3.0

Rust 98.76% C++ 0.16% Python 0.69% Shell 0.39%

libsignal-protocol-rs's Introduction

libsignal-protocol-rs

Codacy Badge Build Status FOSSA Status License libsignal-protocol on crates.io Docs for libsignal-protocol

(API Docs for master)

A Rust interface to the Signal Protocol.

Examples

The simplest thing you can do with this library is generate a private identity key. This is normally only ever done once when you first start (sometimes called install time).

// create our global context (for things like crypto and locking)
let ctx = Context::default();

let identity = libsignal_protocol::generate_identity_key_pair(&ctx)?;

Next, you'll normally want to generate a bunch of unsigned pre-keys which people can use when contacting you, and one signed pre-key.

let ctx = Context::default();

let identity = libsignal_protocol::generate_identity_key_pair(&ctx)?;

let signed_pre_key = libsignal_protocol::generate_signed_pre_key(
    &ctx,
    &identity,
    5,
    SystemTime::now(),
)?;

let start = 123;
let count = 20;

let pre_keys = libsignal_protocol::generate_pre_keys(&ctx, start, count)?
    .collect::<Vec<PreKey>>();

A Registration ID should also be created at install time.

let ctx = Context::default();
let extended_range = 42;

let registration_id = libsignal_protocol::generate_registration_id(&ctx, extended_range)?;

Legal things

Cryptography Notice

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

License

Copyright 2015-2019 Open Whisper Systems

Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html

Additional Permissions For Submission to Apple App Store: Provided that you are otherwise in compliance with the GPLv3 for each covered work you convey (including without limitation making the Corresponding Source available in compliance with Section 6 of the GPLv3), Open Whisper Systems also grants you the additional permission to convey through the Apple App Store non-source executable versions of the Program as incorporated into each applicable covered work as Executable Versions only under the Mozilla Public License version 2.0 (https://www.mozilla.org/en-US/MPL/2.0/).

FOSSA Status

libsignal-protocol-rs's People

Contributors

michael-f-bryan avatar gferon avatar furuholm avatar rubdos avatar codacy-badger avatar fossabot avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.