• Stars
    star
    3,345
  • Rank 13,395 (Top 0.3 %)
  • Language
    Rust
  • License
    GNU Affero Genera...
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.

Overview

libsignal contains platform-agnostic APIs used by the official Signal clients and servers, exposed as a Java, Swift, or TypeScript library. The underlying implementations are written in Rust:

  • libsignal-protocol: Implements the Signal protocol, including the Double Ratchet algorithm. A replacement for libsignal-protocol-java and libsignal-metadata-java.
  • signal-crypto: Cryptographic primitives such as AES-GCM. We use RustCrypto's where we can but sometimes have differing needs.
  • device-transfer: Support logic for Signal's device-to-device transfer feature.
  • attest: Functionality for remote attestation of SGX enclaves and server-side HSMs.
  • zkgroup: Functionality for zero-knowledge groups and related features available in Signal.
  • zkcredential: An abstraction for the sort of zero-knowledge credentials used by zkgroup, based on the paper "The Signal Private Group System" by Chase, Perrin, and Zaverucha.
  • poksho: Utilities for implementing zero-knowledge proofs (such as those used by zkgroup); stands for "proof-of-knowledge, stateful-hash-object".
  • pin: Functionality for consistently using PINs as passwords in Signal's Secure Value Recovery system.
  • usernames: Functionality for username generation, hashing, and proofs.
  • media: Utilities for manipulating media.

This repository is used by the Signal client apps (Android, iOS, and Desktop) as well as server-side. Use outside of Signal is unsupported. In particular, the products of this repository are the Java, Swift, and TypeScript libraries that wrap the underlying Rust implementations. All APIs and implementations are subject to change without notice, as are the JNI, C, and Node add-on "bridge" layers. However, backwards-incompatible changes to the Java, Swift, TypeScript, and non-bridge Rust APIs will be reflected in the version number on a best-effort basis.

Building

To build anything in this repository you must have Rust installed, as well as Clang, libclang, CMake, and Make. On a Debian-like system, you can get these extra dependencies through apt:

$ apt-get install clang libclang-dev cmake make

The build currently uses a specific version of the Rust nightly compiler, which will be downloaded automatically by cargo. To build and test the basic protocol libraries:

$ cargo build
...
$ cargo test
...

Java/Android

To build for Android you must install several additional packages including a JDK, the Android NDK/SDK, and add the Android targets to the Rust compiler, using

rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android

To build the Java/Android jar and aar, and run the tests:

$ cd java
$ ./gradlew test
$ ./gradlew build # if you need AAR outputs

Alternately, a build system using Docker is available:

$ cd java
$ make java_test

When exposing new APIs to Java, you will need to run rust/bridge/jni/bin/gen_java_decl.py in addition to rebuilding.

Swift

To learn about the Swift build process see swift/README.md

Node

You'll need Node installed to build. If you have nvm, you can run nvm use to select an appropriate version automatically.

We use yarn as our package manager. The Rust library will automatically be built when you run yarn install.

$ cd node
$ nvm use
$ yarn install
$ yarn tsc
$ yarn test

When testing changes locally, you can use yarn build to do an incremental rebuild of the Rust library.

When exposing new APIs to Node, you will need to run rust/bridge/node/bin/gen_ts_decl.py in addition to rebuilding.

Contributions

Signal does accept external contributions to this project. However unless the change is simple and easily understood, for example fixing a bug or portability issue, adding a new test, or improving performance, first open an issue to discuss your intended change as not all changes can be accepted.

Contributions that will not be used directly by one of Signal's official client apps may still be considered, but only if they do not pose an undue maintenance burden or conflict with the goals of the project.

Signing a CLA (Contributor License Agreement) is required for all contributions.

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 2020-2023 Signal Messenger, LLC.

Licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html

More Repositories

1

Signal-Android

A private messenger for Android.
Kotlin
25,358
star
2

Signal-Desktop

A private messenger for Windows, macOS, and Linux.
TypeScript
14,441
star
3

Signal-iOS

A private messenger for iOS.
Swift
10,703
star
4

Signal-Server

Server supporting the Signal Private Messenger applications on Android, Desktop, and iOS
Java
9,071
star
5

libsignal-protocol-javascript

This library is no longer maintained. libsignal-protocol-javascript was an implementation of the Signal Protocol, written in JavaScript. It has been replaced by libsignal-client’s typesafe TypeScript API.
JavaScript
1,954
star
6

libsignal-protocol-java

Java
1,823
star
7

libsignal-protocol-c

C
1,404
star
8

BitHub

BTC + BitHub = An experiment in funding privacy OSS.
Java
997
star
9

Signal-TLS-Proxy

Shell
830
star
10

libsignal-service-java

A Java/Android library for communicating with the Signal messaging service.
Java
584
star
11

ringrtc

Rust
538
star
12

Signal-Calling-Service

Forwards media from 1 group call device to N group call devices.
Rust
412
star
13

Flock

Private contact and calendar sync for Android.
Java
358
star
14

ContactDiscoveryService

C
279
star
15

SecureValueRecovery

Rust
274
star
16

curve25519-java

Pure Java and JNI backed Curve25519 implementation.
C
230
star
17

gradle-witness

A gradle plugin that enables static verification for remote dependencies.
Groovy
229
star
18

SignalProtocolKit

This library is no longer maintained. SignalProtocolKit was an implementation of the Signal Protocol, written in Objective-C. It has been replaced by libsignal-client’s type safe Swift API.
Objective-C
213
star
19

webrtc

C++
140
star
20

PushServer

A microservice for communicating with push gateways.
Java
115
star
21

WhisperYAFFS

Encrypted Filesystem Support For YAFFS2
C
104
star
22

jobmanager

Android library for executing tasks.
Java
103
star
23

WebSocket-Resources

A Dropwizard library that lets you use Jersey-style Resources over WebSockets
Java
91
star
24

better-sqlite3

C++
76
star
25

SignalServiceKit

SignalServiceKit has moved to Signal-iOS. See README.md for details.
Objective-C
68
star
26

libwebrtc-android

Android WebRTC Packages
Java
60
star
27

Signal-Pods

Pods dependency tracker for Signal-iOS
C
57
star
28

signal-ringrtc-node

TypeScript
50
star
29

gcm-sender-async

Asynchronous Google Cloud Messaging (GCM) Library
Java
48
star
30

zkgroup

41
star
31

curve25519-dalek

Rust
37
star
32

SecureValueRecovery2

C++
37
star
33

libsignal-protocol-rust

Rust
37
star
34

Argon2

Java
36
star
35

Signal-Design

A place to archive design assets used by Signal.
35
star
36

SignalCoreKit

Swift
34
star
37

storage-service

Java
34
star
38

signal-webrtc-ios

Python
33
star
39

Signal-FTS5-Extension

A FTS5 extension for signal_tokenizer.
Rust
32
star
40

ContactDiscoveryService-Icelake

C
31
star
41

maven

27
star
42

libpastelog

Java
27
star
43

tus-server

An implementation of the TUS server protocol for resumable uploads
TypeScript
25
star
44

Mock-Signal-Server

TypeScript
24
star
45

registration-service

Registration Service for Signal
Java
23
star
46

dropwizard-simpleauth

Dropwizard library for simple @Auth annotations that support multiple types
Java
22
star
47

CLAServer

GitHub Integration for managing CLA signatures
Java
22
star
48

mio

Rust
20
star
49

AES-GCM-Provider

A BoringSSL-backed AES-GCM provider for Android with support for "incremental" encryption/decryption
Java
20
star
50

libaxolotl-j2me

Axolotl J2ME
Java
17
star
51

Signal-Art-Creator

Sticker Pack Creator Web App
TypeScript
17
star
52

signal-webrtc-ios-artifacts

Objective-C
17
star
53

SQLCipherVsSharedData

Demo Project to demonstrate a bug in SQLCipher
Objective-C
15
star
54

dropwizard-wavefront

Dropwizard Metrics Reporter For Wavefront
Java
14
star
55

sgx_common

Rust
14
star
56

emoji-search-index

Static assets used for to generate a search index for emoji within Signal.
12
star
57

Signal-Carthage

Objective-C
12
star
58

SignalMetadataKit

Swift
12
star
59

libmobilecoin-ios-artifacts

Swift
12
star
60

libsignal-client-node

11
star
61

redis-dispatch

Java
11
star
62

sqlcipher

C
11
star
63

libsignal-metadata-java

Java
11
star
64

mp4san

A Rust MP4 format sanitizer
Rust
10
star
65

poksho

9
star
66

AccountStream

Java
8
star
67

signal-zkgroup-node

TypeScript
8
star
68

s3-upload-maven-plugin

Maven plugin to upload files to s3
Java
7
star
69

jekyll-simple-i18n

Ruby
7
star
70

HsmEnclave

HSM-backed remote-attestable enclave.
C
5
star
71

sqlcipher-android

A light fork of https://github.com/sqlcipher/sqlcipher-android
C
5
star
72

storage-manager

Manage objects inside a cdn
TypeScript
5
star
73

libsignal-ffi

Rust
4
star
74

partial-default

Provides PartialDefault, a Rust trait similar to Default but with fewer guarantees
Rust
4
star
75

signal-zkgroup-swift

Swift
4
star
76

libsignal-protocol-swift

Swift
2
star
77

Signal-Message-Backup-Tests

Signal Message Backup shared client integration test cases
Rust
2
star
78

libmobilecoin-apple-artifacts

C
2
star
79

Signal-Sqlcipher-Extension

A sqlcipher extension for crypto provider.
Rust
1
star