All Projects → adjoint-io → double-ratchet

adjoint-io / double-ratchet

Licence: other
Double ratchet algorithm for E2E encryption

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to double-ratchet

rawr-x3dh
TypeScript Implementation of X3DH
Stars: ✭ 51 (-13.56%)
Mutual labels:  diffie-hellman, x3dh
chat-diffie-hellman
A secure chat between an Android client and Java server using AES for encryption and Diffie-Hellman for key exchange.
Stars: ✭ 26 (-55.93%)
Mutual labels:  diffie-hellman
rfc7748 precomputed
Updated! (Dec2-2019) This is a C-language software library that provides optimized implementations of the Diffie-Hellman functions known as X25519 and X448 (RFC-7748) for 64-bit architectures.
Stars: ✭ 43 (-27.12%)
Mutual labels:  diffie-hellman
Computer-Security-algorithms
👨‍💻 Computer Security algorithms in C#
Stars: ✭ 48 (-18.64%)
Mutual labels:  diffie-hellman
Phpseclib
PHP Secure Communications Library
Stars: ✭ 4,627 (+7742.37%)
Mutual labels:  diffie-hellman
pyDHE
a fully python Diffie-Hellman Library
Stars: ✭ 50 (-15.25%)
Mutual labels:  diffie-hellman
penetration testing
🎩 [penetration testing Book], Kali Magic, Cryptography, Hash Crack, Botnet, Rootkit, Malware, Spyware, Python, Go, C|EH.
Stars: ✭ 57 (-3.39%)
Mutual labels:  diffie-hellman

CircleCI

Double Ratchet Algorithm

CircleCI

An implementation of Open Whisper System's Double Ratchet Algorithm in Haskell.

The Double Ratchet algorithm is used by two parties to exchange encrypted messages based on a shared secret key. Typically the parties will use some key agreement protocol (such as X3DH) to agree on the shared secret key. Following this, the parties will use the Double Ratchet to send and receive encrypted messages. This gives the cryptosystem the property of perfect forward secrecy in which compromise of long-term keys does not compromise past session keys. Forward secrecy protects past sessions against future compromises of secret keys or passwords.

The parties derive new keys for every Double Ratchet message so that earlier keys cannot be calculated from later ones. The parties also send Diffie-Hellman public values attached to their messages. The results of Diffie-Hellman calculations are mixed into the derived keys so that later keys cannot be calculated from earlier ones. These properties gives some protection to earlier or later encrypted messages in case of a compromise of a party's keys.

Usage

The example will use the pre-shared keys bob_private and bob_public and ssk.

To compile the example:

> stack ghc Example.hs --package ratchet 
> ./Example server
> ./Example client

To load in GHCi:

> stack ghci --package network
> :load Example.hs

Protocol

After an initial key exchange it manages the ongoing renewal and maintenance of short-lived session keys. It combines a cryptographic ratchet based on the Diffie–Hellman key exchange (DH) and a ratchet based on a key derivation function (KDF) like e.g. a hash function and is therefore called a double ratchet.

Signal Protocol protocol combines the Double Ratchet Algorithm, prekeys, and a triple Diffie–Hellman (3-DH) handshake, and uses Curve25519, AES-256 and HMAC-SHA256 as primitives.

License

Copyright 2017-2018 Adjoint Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].