[BREAKGLASS] 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. https://signal.org
Go to file
Michael Kirk e64d373b29 Increase receiver chain count from 5 -> 10
When we ratchet, we can immediately use the new sending chain safely,
however, we have to retain some number of old receiving chain to be able
to decrypt any in-flight messages, or messages that arrive out of order
(i.e.  messages that were *sent* before we ratcheted, but not received
until after we ratcheted).

The tradeoff is storage size (how many old chains we keep around per
session) vs resilience (how many ratchet steps do we maintain the
ability to decrypt with).

Usually message delivery is quick and serial and this isn't an issue.
However sometimes message delays of several minutes have been observed.
If this delay occurs *while* the parties are engaged in an active
back-and-forth, sending messages every few seconds, it's very likely
we'll ratchet past the threshold and see bad decrypted messages.

// FREEBIE
2017-08-16 12:33:31 -04:00
AxolotlKit Increase receiver chain count from 5 -> 10 2017-08-16 12:33:31 -04:00
AxolotlKit.xcodeproj Add SPKAssert macros 2017-08-07 11:15:09 -04:00
AxolotlKit.xcworkspace Travis-CI 2014-10-26 13:12:58 +01:00
AxolotlKitTests Fix tests 2017-06-28 06:50:05 -10:00
bin Fix tests, update cocoapods 2016-12-15 22:30:35 -06:00
.clang-format Add .clang-format file. 2017-02-10 13:53:27 -05:00
.gitignore Fix tests, update cocoapods 2016-12-15 22:30:35 -06:00
.travis.yml Compatible with XCode 8.3 2017-03-28 21:46:09 -04:00
AxolotlKit.podspec Add SPKAssert macros 2017-08-07 11:15:09 -04:00
Gemfile Fix tests, update cocoapods 2016-12-15 22:30:35 -06:00
Gemfile.lock update test app dependencies 2017-03-28 21:04:31 -04:00
LICENSE Update license. 2017-04-10 15:18:11 -04:00
Podfile Add CocoaLumberjack 2017-03-29 18:42:59 -04:00
Podfile.lock Add SPKAssert macros 2017-08-07 11:15:09 -04:00
README.md Let's be bold 2016-06-13 12:03:07 -07:00
Scanfile Fix tests, update cocoapods 2016-12-15 22:30:35 -06:00

Deprecation Warning: It is recommended that libsignal-protocol-c be used for all new applications.

SignalProtocolKit Build Status

SignalProtocolKit is an implementation of the Signal protocol, written in Objective-C.

Documentation

Browse the API reference on CocoaDocs.

Goal

SignalProtocolKit was designed to be a drop-in library that can be easily integrated into existing projects.

The Signal protocol is an asynchronous cryptographic ratcheting protocol with interesting properties.

Integration

SignalProtocolKit was designed with enough abstraction to integrate it easily into your own project. Please refer to the documentation or the Signal example to properly implement the required Objective-C storage protocols.

Signal Protocol is designed for long-lived sessions, keys need to be stored. SignalProtocolKit defines interfaces of the storage classes (IdentityKeyStore.h, PreKeyStore.h, SessionStore.h and SignedPreKeyStore.h). SignalProtocolKit objects do comply to NSSecureCoding so serialization of objects for the database is provided for you.

Prekeys

A concept of PreKeys are used to achieve asynchronous perfect forward secrecy. PreKeys are composed of a Curve25519 public key and a unique ID, both stored by the server.

At install time, clients generate a single signed PreKey as well as a large list of unsigned PreKeys and transmit those to the server.

Sessions

The Signal protocol is session-oriented. Clients establish a "session," which is then used for all subsequent encrypt/decrypt operations. There is no need to ever tear down a session once one has been established.

Sessions are established in one of these ways:

  • PreKeyBundles. A client that wishes to send a message to a recipient can establish a session by retrieving a PreKeyBundle for that recipient from the server.

  • PreKeyWhisperMessages. A client can receive a PreKeyWhisperMessage from a recipient and use it to establish a session.

State

An established session encapsulates a lot of state between two clients. That state is maintained in durable records which need to be kept for the life of the session.

State is kept in the following places:

  • Identity State. Clients will need to maintain the state of their own identity key pair, as well as identity public keys received from other clients.

  • PreKey State. Clients will need to maintain the state of their generated (private) PreKeys.

  • Signed PreKey States. Clients will need to maintain the state of the their signed (private) PreKeys.

  • Session State. Clients will need to maintain the state of the sessions they have established.