GithubHelp home page GithubHelp logo

libsignal-protocol-java's Introduction

Overview

A ratcheting forward secrecy protocol that works in synchronous and asynchronous messaging environments.

PreKeys

This protocol uses a concept called 'PreKeys'. A PreKey is an ECPublicKey and an associated unique ID which are stored together by a server. PreKeys can also be signed.

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

Sessions

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 three ways:

  1. 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.
  2. PreKeySignalMessages. A client can receive a PreKeySignalMessage from a recipient and use it to establish a session.
  3. KeyExchangeMessages. Two clients can exchange KeyExchange messages 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:

  1. Identity State. Clients will need to maintain the state of their own identity key pair, as well as identity keys received from other clients.
  2. PreKey State. Clients will need to maintain the state of their generated PreKeys.
  3. Signed PreKey States. Clients will need to maintain the state of their signed PreKeys.
  4. Session State. Clients will need to maintain the state of the sessions they have established.

Using libsignal-protocol

Configuration

On Android:

dependencies {
  compile 'org.whispersystems:signal-protocol-android:(latest version number)'
}

For pure Java apps:

<dependency>
  <groupId>org.whispersystems</groupId>
  <artifactId>signal-protocol-java</artifactId>
  <version>(latest version number)</version>
</dependency>

Install time

At install time, a libsignal client needs to generate its identity keys, registration id, and prekeys.

IdentityKeyPair    identityKeyPair = KeyHelper.generateIdentityKeyPair();
int                registrationId  = KeyHelper.generateRegistrationId();
List<PreKeyRecord> preKeys         = KeyHelper.generatePreKeys(startId, 100);
SignedPreKeyRecord signedPreKey    = KeyHelper.generateSignedPreKey(identityKeyPair, 5);

// Store identityKeyPair somewhere durable and safe.
// Store registrationId somewhere durable and safe.

// Store preKeys in PreKeyStore.
// Store signed prekey in SignedPreKeyStore.

Building a session

A libsignal client needs to implement four interfaces: IdentityKeyStore, PreKeyStore, SignedPreKeyStore, and SessionStore. These will manage loading and storing of identity, prekeys, signed prekeys, and session state.

Once those are implemented, building a session is fairly straightforward:

SessionStore      sessionStore      = new MySessionStore();
PreKeyStore       preKeyStore       = new MyPreKeyStore();
SignedPreKeyStore signedPreKeyStore = new MySignedPreKeyStore();
IdentityKeyStore  identityStore     = new MyIdentityKeyStore();

// Instantiate a SessionBuilder for a remote recipientId + deviceId tuple.
SessionBuilder sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore,
                                                   identityStore, recipientId, deviceId);

// Build a session with a PreKey retrieved from the server.
sessionBuilder.process(retrievedPreKey);

SessionCipher     sessionCipher = new SessionCipher(sessionStore, recipientId, deviceId);
CiphertextMessage message      = sessionCipher.encrypt("Hello world!".getBytes("UTF-8"));

deliver(message.serialize());

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 2013-2019 Open Whisper Systems

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

libsignal-protocol-java's People

Contributors

alan-signal avatar greyson-signal avatar jeff-r-koyaltech avatar moxie-signal avatar moxie0 avatar sebkur avatar sepppenner avatar tgalal avatar xashyar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libsignal-protocol-java's Issues

Unexpected InvalidProtocolBufferException during Decrypt

Exception in thread "main" org.whispersystems.libsignal.InvalidMessageException: com.google.protobuf.InvalidProtocolBufferException: Protocol message tag had invalid wire type. at org.whispersystems.libsignal.protocol.PreKeySignalMessage.<init>(PreKeySignalMessage.java:67) at core.EndToEndEncryptionClient.receive(EndToEndEncryptionClient.java:121) at core.EndToEndEncryptionClient.main(EndToEndEncryptionClient.java:174) Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message tag had invalid wire type. at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:99) at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:498) at com.google.protobuf.GeneratedMessage.parseUnknownField(GeneratedMessage.java:193) at org.whispersystems.libsignal.protocol.SignalProtos$PreKeySignalMessage.<init>(SignalProtos.java:772) at org.whispersystems.libsignal.protocol.SignalProtos$PreKeySignalMessage.<init>(SignalProtos.java:730) at org.whispersystems.libsignal.protocol.SignalProtos$PreKeySignalMessage$1.parsePartialFrom(SignalProtos.java:838) at org.whispersystems.libsignal.protocol.SignalProtos$PreKeySignalMessage$1.parsePartialFrom(SignalProtos.java:833) at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:104) at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:128) at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:133) at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49) at org.whispersystems.libsignal.protocol.SignalProtos$PreKeySignalMessage.parseFrom(SignalProtos.java:1038) at org.whispersystems.libsignal.protocol.PreKeySignalMessage.<init>(PreKeySignalMessage.java:48) ... 2 more

Hey, I was trying to use the java library for Signal Protocol. I am able to encrypt properly as given in your docs. However, I am getting the above exception while trying to decrypt the CipherMessage.
The following is my code to receive & send that i am using:


private void receive(String cipherMessage, String SENDER_SIGNAL_ACCOUNT_USERNAME, Integer SENDER_SIGNAL_ACCOUNT_DEVICE_ID) throws UntrustedIdentityException, LegacyMessageException, InvalidVersionException, InvalidMessageException, DuplicateMessageException, InvalidKeyException, InvalidKeyIdException, IOException {

    System.out.println("Decrypting Message: " + cipherMessage);

    // DEVELOP ADDRESS OF SENDER
    SignalProtocolAddress signalProtocolAddress = new SignalProtocolAddress(SENDER_SIGNAL_ACCOUNT_USERNAME, SENDER_SIGNAL_ACCOUNT_DEVICE_ID);

    // DECRYPT THE CIPHER_MESSAGE
    SessionCipher sessionCipher = new SessionCipher(signalProtocolStore, signalProtocolAddress);
    String message = new String(sessionCipher.decrypt(new PreKeySignalMessage(cipherMessage.getBytes())));

    System.out.println("Received Message: " + message);
}

String send(String recipientNumber, int deviceId, String message, String SIGNAL_ACCOUNT_USERNAME, String SIGNAL_ACCOUNT_PASSWORD)
throws InvalidKeyException, UntrustedIdentityException, UnsupportedEncodingException, CustomException {

    System.out.println("Sending message: " + message + ", to deviceId: " + deviceId);
    // DEVELOP ADDRESS OF RECIPIENT
    SignalProtocolAddress signalProtocolAddress = new SignalProtocolAddress(recipientNumber, deviceId);

    // INSTANTIATE A SESSION_BUILDER FOR A REMOTE RECIPIENT_ID + DEVICE_ID TUPLE.
    SessionBuilder sessionBuilder = new SessionBuilder(signalProtocolStore, signalProtocolAddress);

    // BUILD A SESSION WITH A PRE_KEY RETRIEVED FROM THE SERVER.
    sessionBuilder.process(accountManager.fetchPreKeyBundleFromServer(recipientNumber, deviceId, SIGNAL_ACCOUNT_USERNAME, SIGNAL_ACCOUNT_PASSWORD));

    // ENCRYPT THE MESSAGE
    SessionCipher sessionCipher = new SessionCipher(signalProtocolStore, signalProtocolAddress);
    CiphertextMessage ciphertextMessage = sessionCipher.encrypt(message.getBytes("UTF-8"));

    // DELIVER THE MESSAGE USING WHATEVER TRANSPORT YOU'D LIKE!
    String cipherMessage = new String(ciphertextMessage.serialize());

    System.out.println("Encrypted Message: " + cipherMessage);
    return cipherMessage;
}

UninitializedMessageException thrown when building PreKeyRecordStructure

I am seeing some unusual behaviour.

When calling KeyHelper.generatePreKeys(1, 100); An UninitialisedMessageException is thrown from inside PreKeyRecordStructure.newBuilder().build().

This code is generated from protobuf, but it looks something like this:

public PreKeyRecordStructure build() {
  PreKeyRecordStructure result = buildPartial();
  if (!result.isInitialized()) {
    throw newUninitializedMessageException(result);
  }
  return result;
}

result.isInitialized() is returning false. If I attach a breakpoint to see what is happening, the code will work without throwing an exception. If I remove all breakpoints, the code will throw the exception.

I created a clean Android project, to try and get a small, reproducible case; but I was unable to trigger the same behaviour. Any idea as to what is happening here? I am happy to help debug.

Error Build Signal-Server

Hi Dear, i cannot success build Signal-Server. What can i do for this issue ?


"C:\Program Files (x86)\Java\jdk1.8.0_181\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.4\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.4\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.4\lib\idea_rt.jar=60196:C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.4\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.2.4 compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.whispersystems.textsecure:redis-dispatch:jar:2.92
[WARNING] 'version' contains an expression but should be a constant. @ org.whispersystems.textsecure:redis-dispatch:${TextSecureServer.version}, C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\redis-dispatch\pom.xml, line 13, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.whispersystems.textsecure:websocket-resources:jar:2.92
[WARNING] 'version' contains an expression but should be a constant. @ org.whispersystems.textsecure:websocket-resources:${TextSecureServer.version}, C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\websocket-resources\pom.xml, line 13, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.whispersystems.textsecure:gcm-sender-async:jar:2.92
[WARNING] 'version' contains an expression but should be a constant. @ org.whispersystems.textsecure:gcm-sender-async:${TextSecureServer.version}, C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\gcm-sender-async\pom.xml, line 13, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.whispersystems.textsecure:service:jar:2.92
[WARNING] 'version' contains an expression but should be a constant. @ org.whispersystems.textsecure:service:${TextSecureServer.version}, C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\service\pom.xml, line 13, column 14
[WARNING] The expression ${parent.artifactId} is deprecated. Please use ${project.parent.artifactId} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] TextSecureServer
[INFO] redis-dispatch
[INFO] websocket-resources
[INFO] gcm-sender-async
[INFO] service
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TextSecureServer 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building redis-dispatch 2.92
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.antlr:stringtemplate:jar:3.2.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ redis-dispatch ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\redis-dispatch\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ redis-dispatch ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 10 source files to C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\redis-dispatch\target\classes
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building websocket-resources 2.92
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ websocket-resources ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\websocket-resources\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ websocket-resources ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 31 source files to C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\websocket-resources\target\classes
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[INFO] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java: Some input files use or override a deprecated API.
[INFO] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java: Recompile with -Xlint:deprecation for details.
[INFO] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java: C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\websocket-resources\src\main\java\org\whispersystems\websocket\WebSocketResourceProviderFactory.java uses unchecked or unsafe operations.
[INFO] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gcm-sender-async 2.92
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gcm-sender-async ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\gcm-sender-async\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ gcm-sender-async ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 9 source files to C:\Users\dsi\Documents\D'ProMaster\Signal\Signal-Server\gcm-sender-async\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[27,21] package java.net.http does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[28,21] package java.net.http does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[29,34] package java.net.http.HttpResponse does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[58,17] cannot find symbol
symbol: class HttpClient
location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[163,11] cannot find symbol
symbol: class HttpClient
location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[58,44] cannot find symbol
symbol: class HttpClient
location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[94,54] package HttpClient does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[93,25] cannot find symbol
symbol: variable HttpClient
location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[118,7] cannot find symbol
symbol: class HttpRequest
location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[122,57] package HttpRequest does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[118,29] cannot find symbol
symbol: variable HttpRequest
location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[127,80] cannot find symbol
symbol: variable BodyHandlers
location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[153,78] incompatible types: java.util.concurrent.CompletableFuture<java.lang.Object> cannot be converted to java.util.concurrent.CompletableFuture<org.whispersystems.gcm.server.Result>
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[155,31] cannot find symbol
symbol: method failedFuture(com.fasterxml.jackson.core.JsonProcessingException)
location: class java.util.concurrent.CompletableFuture
[INFO] 16 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] TextSecureServer ................................... SUCCESS [ 0.005 s]
[INFO] redis-dispatch ..................................... SUCCESS [ 5.263 s]
[INFO] websocket-resources ................................ SUCCESS [ 3.223 s]
[INFO] gcm-sender-async ................................... FAILURE [ 1.111 s]
[INFO] service ............................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.767 s
[INFO] Finished at: 2020-01-06T16:39:25+07:00
[INFO] Final Memory: 23M/56M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project gcm-sender-async: Compilation failure: Compilation failure:
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[ERROR] error reading C:\Users\dsi.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar; error in opening zip file
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[27,21] package java.net.http does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[28,21] package java.net.http does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[29,34] package java.net.http.HttpResponse does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[58,17] cannot find symbol
[ERROR] symbol: class HttpClient
[ERROR] location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[163,11] cannot find symbol
[ERROR] symbol: class HttpClient
[ERROR] location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[58,44] cannot find symbol
[ERROR] symbol: class HttpClient
[ERROR] location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[94,54] package HttpClient does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[93,25] cannot find symbol
[ERROR] symbol: variable HttpClient
[ERROR] location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[118,7] cannot find symbol
[ERROR] symbol: class HttpRequest
[ERROR] location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[122,57] package HttpRequest does not exist
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[118,29] cannot find symbol
[ERROR] symbol: variable HttpRequest
[ERROR] location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[127,80] cannot find symbol
[ERROR] symbol: variable BodyHandlers
[ERROR] location: class org.whispersystems.gcm.server.Sender
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[153,78] incompatible types: java.util.concurrent.CompletableFuture<java.lang.Object> cannot be converted to java.util.concurrent.CompletableFuture<org.whispersystems.gcm.server.Result>
[ERROR] /C:/Users/dsi/Documents/D'ProMaster/Signal/Signal-Server/gcm-sender-async/src/main/java/org/whispersystems/gcm/server/Sender.java:[155,31] cannot find symbol
[ERROR] symbol: method failedFuture(com.fasterxml.jackson.core.JsonProcessingException)
[ERROR] location: class java.util.concurrent.CompletableFuture
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :gcm-sender-async

Process finished with exit code 1

not an issue but a suggestion

can you guys make a YouTube video on how to implement this library into a real life app like very simple chatting app just having chatting and end to end encryption using signal. This will be really helpful to the community. Thank you!!

Reduce code duplication in ECPublicKey and ECPrivateKey

Not related to the issue

Dear WhisperSystems team,
first of all thank you for the great work you are doing.
I think the products you offer will have a positive impact on the way we think about our privacy
and I hope that other products get inspired by your work.


Now to the actual issue

Notice: I am just getting started with open source projects and WhisperSystems' software
so please bare with me if I don't see the whole impact of my change proposal.
๐Ÿ˜‰

The interfaces ECPublicKey and ECPrivateKey share the same method signatures.
My proposed change is, in order to reduce code duplication, to aggregate these method signatures
into a super interface. I propose the name SerializableKey for the new interface.

public interface SerializableKey {
  // shared method signatures here
}

public interface ECPublicKey extends SerializableKey {
  // we only need to add the final field
}

public interface ECPrivateKey extends SerializableKey {
  // nothing to add here
}

โž– The argument against this change

  • Due to the strict separation of ECPublicKey and ECPrivateKey (no common interface),
    we avoid having potencial security flaws -> e.g. injecting an instance of ECPrivateKey, although it
    is meant to be an instance of ECPublicKey

โž• The arguments in favour of this change

  • reduce code duplication
  • easier for new developers to recognize the similarities between ECPublicKey and ECPrivateKey
  • more generalization and therefore the generalized interface can be used elsewhere as well
    (see below)

One example for using this new interface in other parts is in the class PublicKey of the TextSecure for Android Repository: this class could implement the new SerializableKey interface, because some methods share the same signatures.
I haven't dug deep enough into the code yet to spot other places where it could be used, but
the good thing is that it can be introduced incrementally, because the current code won't break without the use of the SerializableKey interface

I appreciate any thoughts on this. ๐Ÿ˜˜
If this could be integrated, I would love to send you a PR.
Thank you and best regards,
Jan

Exception: java.lang.ArrayIndexOutOfBoundsException length=4; index=4 org.whispersystems.libsignal.state.PreKeyRecord.<init>

Getting below error when generating prekeys.
I am trying to achieve end-to-end encryption in a chat window.

Non-fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=4; index=4 at com.google.protobuf.MessageSchema.newSchemaForRawMessageInfo(MessageSchema.java:507) at com.google.protobuf.MessageSchema.newSchema(MessageSchema.java:227) at com.google.protobuf.ManifestSchemaFactory.newSchema(ManifestSchemaFactory.java:77) at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:71) at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:90) at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:104) at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:175) at com.google.protobuf.GeneratedMessageLite$Builder.buildPartial(GeneratedMessageLite.java:395) at com.google.protobuf.GeneratedMessageLite$Builder.build(GeneratedMessageLite.java:403) at org.whispersystems.libsignal.state.PreKeyRecord.<init>(PreKeyRecord.java:31) at org.whispersystems.libsignal.util.KeyHelper.generatePreKeys(KeyHelper.java:89) at com.quickfire.messaging.cryptography.SignalProtocolManagerImpl.initProtocol(SignalProtocolManagerImpl.kt:15) at com.quickfire.presentation.login.LoginActivity.updateLoginResult(LoginActivity.kt:176) at com.quickfire.presentation.login.LoginActivity.access$updateLoginResult(LoginActivity.kt:34) at com.quickfire.presentation.login.LoginActivity$observeData$2$invokeSuspend$$inlined$collect$1.emit(Collect.kt:138) at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:348) at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(:12) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:234) at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:190) at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:369) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:403) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:395) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:300) at kotlinx.coroutines.flow.StateFlowSlot.makePending(StateFlow.kt:236) at kotlinx.coroutines.flow.StateFlowImpl.updateState(StateFlow.kt:301) at kotlinx.coroutines.flow.StateFlowImpl.setValue(StateFlow.kt:268) at com.quickfire.presentation.login.LoginViewModel.handleLoginResult(LoginViewModel.kt:75) at com.quickfire.presentation.login.LoginViewModel.access$handleLoginResult(LoginViewModel.kt:25) at com.quickfire.presentation.login.LoginViewModel$login$1$1.invoke(LoginViewModel.kt:53) at com.quickfire.presentation.login.LoginViewModel$login$1$1.invoke(LoginViewModel.kt:25) at com.quickfire.domain.model.base.Record.handleResult(Record.kt:9) at com.quickfire.presentation.login.LoginViewModel$login$1.invoke(LoginViewModel.kt:53) at com.quickfire.presentation.login.LoginViewModel$login$1.invoke(LoginViewModel.kt:25) at com.quickfire.domain.interactor.base.BaseFlowUseCase$invoke$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:133) at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:61) at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(:11) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7682) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

Can I use this library with firebase database

I want to implement E2EE in a firebase chat application. Can I use this library with firebase database as server and android as a client. All the encryption and decryption will happen at client side.

Required Docuentation

Could you please share proper documentation or sample app to implement E2EE.
Example :
SessionStore sessionStore = new MySessionStore();
PreKeyStore preKeyStore = new MyPreKeyStore();
SignedPreKeyStore signedPreKeyStore = new MySignedPreKeyStore();
IdentityKeyStore identityStore = new MyIdentityKeyStore();

// Instantiate a SessionBuilder for a remote recipientId + deviceId tuple.
SessionBuilder sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore,
identityStore, recipientId, deviceId);

// Build a session with a PreKey retrieved from the server.
sessionBuilder.process(retrievedPreKey);

SessionCipher sessionCipher = new SessionCipher(sessionStore, recipientId, deviceId);
CiphertextMessage message = sessionCipher.encrypt("Hello world!".getBytes("UTF-8"));

deliver(message.serialize());

In above example

  1. MySessionStore , MyPreKeyStore ,MySignedPreKeyStore,MyIdentityKeyStore implementation have various methods. How do we use not able to find anywhere.

  2. SessionBuilder(
    sessionStore, preKeyStore, signedPreKeyStore,
    identityStore, recipientId, deviceId
    )
    Here in latest library only 5 params need to pass. That one also not updated and not able to found any documentation also.
    SignalProtocolAddress contains deviceId and name. How to create object of SignalProtocolAddress,

  3. sessionBuilder.process(retrievedPreKey)
    Here what is retrievedPreKey and could you please share any working sample.

  4. val sessionCipher = SessionCipher(sessionStore, recipientId, deviceId)
    In latest lib SessionCipher have only 2 parametrs.

Android project under this project no code files available. If possible please share at-least a sample code files in this project. That can really helpful to start lib-signal-protocol. Sorry for my bad english.

REST API Server integration with pom.xml and enhancements

I want to be able to build this project, and others similar like it using maven, for server side java, for encrypt, decrypt, and Hmac for authenticated diffie hellman, and am considering adding your Hmac implementation to mine. I want to eliminate having to generate RSA public keys manually from command line.

I want the server side REST APIs to use Diffie hellman, along with the encrypt,decrypt, and hmac, for authenticated transactions.

Is it a possibility to add maven pom.xml support to these projects, along with a Diffie Hellman implementation? I have one to offer. (see https://github.com/quantum-fusion/aes-256-encryption-utility/blob/e6d4f1166a3a94fde6a6f9025b551fdc0e1f18d7/src/test/java/com/acquitygroup/encryption/AESCipherTest.java#L60 )

I am also interested in adding create JWT, create JWE, and decrypt JWE.
(see https://github.com/quantum-fusion/aes-256-encryption-utility/blob/e6d4f1166a3a94fde6a6f9025b551fdc0e1f18d7/src/main/java/com/acquitygroup/encryption/CryptoHelper.java#L56 )

Elliptic curves tests

Hi everybody!
Does anybody know from where (document, rfc etc.) elliptic curves test vectors got?
How to set test vectors from RFC7448?

Simultaneous session initialization with PreKeyWhisperMessage

Assume two parties want to start a session simultaneously by sending a PreKeyWhisperMessage. Both initialize their end of the session and send a PreKeyWhisperMessage. Both sides will now try to complete the session by looking up the prekey with the previously issued base key. The result is that there are two sessions in place! As far as I understand the code, there is nothing in place to prevent this to happen or do I miss something?
This would mean both sessions are one-way only and the chain keys in the ratchet will not be updated, which is a problematic.
I am new to all this Axolotl stuff, so this may be the wrong place to ask this question.

Protocol version 3 specs

In the code, there is a distinction between version 2 and 3. Where can I find the specs for both versions?

gradle build fails based on unknown variables {sonatypeRepo,userName, password}

The problem is when I try to build, using $gradle build

This is the error:

  • What went wrong:
    A problem occurred evaluating project ':java'.

Could not get unknown property 'sonatypeRepo' for object of type org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer.

https://github.com/WhisperSystems/libsignal-protocol-java/blob/4f5e1ff299cea22cc75bb97249020a7da67b816d/java/build.gradle#L50

The issues are as follows: sonatypeRepo is unknown, and userName and password are also unknown, therefore gradle fails in the build step.

repository(url: sonatypeRepo) {
authentication(userName: whisperSonatypeUsername, password: whisperSonatypePassword)
}

my app is not obfuscated due to -dontoptimize and -dontobfuscate rules in progaurd-rules.pro

I raised an issue #74
this issue was resolved by adding following lines in progaurd-rules.pro

-dontoptimize -dontobfuscate -keepattributes SourceFile,LineNumberTable -keep class org.whispersystems.** { *; } -keep class org.thoughtcrime.securesms.** { *; } -keepclassmembers class ** { public void onEvent*(**); }

after adding above line of code, my whole app code is not obfuscated now because of just these two lines -dontoptimize -dontobfuscate.
If i remove these two instructions my app crashes during serialization of signal protocol classes.

my configuration in build.gradle file

release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard.cfg' useProguard true debuggable false } debug { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard.cfg' useProguard true debuggable false }

I tried adding rules for signal in seperate file proguard.cfg, as you can see above. but no lock :(
kindly let me know how to obfuscate my app.

NumericFingerprintGeneratorTest does not build due to fingerprint comparison changes

ScannableFingerprint comparison used to throw a FingerprintIdentifierMismatchException in cases of mismatch. It now just returns a boolean that indicates whether or not the fingerprints matched. I don't think the unit tests were ever updated to handle this change. As such, I now get the following build errors when trying to build NumericFingerprintGeneratorTest:

Error:(108, 7) error: exception FingerprintIdentifierMismatchException is never thrown in body of corresponding try statement
Error:(115, 7) error: exception FingerprintIdentifierMismatchException is never thrown in body of corresponding try statement

Curve.decodePoint throws OOBE when input byte array isn't proper size

Caught while debugging device provisioning problems, seems like it should throw some kind of decoding exception instead? Full log:

        AndroidRuntime  E  FATAL EXCEPTION: AsyncTask #2
                        E  Process: org.thoughtcrime.securesms, PID: 19613
                        E  java.lang.RuntimeException: An error occured while executing doInBackground()
                        E      at android.os.AsyncTask$3.done(AsyncTask.java:300)
                        E      at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                        E      at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                        E      at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                        E      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                        E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                        E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                        E      at java.lang.Thread.run(Thread.java:841)
                        E  Caused by: java.lang.ArrayIndexOutOfBoundsException: src.length=30 srcPos=1 dst.length=32 dstPos=0 length=32
                        E      at java.lang.System.arraycopy(Native Method)
                        E      at org.whispersystems.libaxolotl.ecc.Curve25519.decodePoint(Curve25519.java:71)
                        E      at org.whispersystems.libaxolotl.ecc.Curve.decodePoint(Curve.java:35)
                        E      at org.thoughtcrime.securesms.DeviceProvisioningActivity$3.doInBackground(DeviceProvisioningActivity.java:110)
                        E      at org.thoughtcrime.securesms.DeviceProvisioningActivity$3.doInBackground(DeviceProvisioningActivity.java:96)
                        E      at android.os.AsyncTask$2.call(AsyncTask.java:288)
                        E      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                        E      ... 4 more

DH Ratchet never skips keys while documentation does

I was reading about the Double Ratchet Algorithm and in

def RatchetDecrypt(state, header, ciphertext, AD): 

there is the specified line

    if header.dh != state.DHr:                 
        SkipMessageKeys(state, header.pn)

which doesn't exist in the Java Implementation in the Java implementation message keys are skipped only in getOrCreateMessageKeys where they are skipped only for the current ratchet key
this is specified in the documentation at

    SkipMessageKeys(state, header.n)      

In getOrCreateChainKey message keys aren't skipped while they should be, which if I am correct will result in message keys not being saved after a DH ratchet step causing a DuplicateMessageException if a message was received from before the DH ratchet step.

Thanks, OughtToPrevail

Edited from: Signal users community forum where I first asked it as a question when now I understand this is actually an issue.

Suggestion: Helpful Docs

I would suggest to put together some documentation.
The README is ... not really helpful. Especially not mentioning where to get certain variables used in code snippets confuses me the most.

If there is some sort of "Getting Started Guide" that I did not see, please provide a link.

Thanks in advance.

DeviceConsistencyTest > testDeviceConsistency FAILED

I attempted to gradle build --info and hit the following error. It is not surprise considering the code in question is not implemented. My question is if this test is expected to be failing and should be annotated as such.

Starting process 'Gradle Test Executor 18'. Working directory: ~/libsignal-protocol-java/java Command: /usr/local/jdk-1.8.0/bin/java -Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager -Dorg.gradle.native=false -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp ~/.gradle/caches/5.6.2/workerMain/gradle-worker.jar worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 18'
Successfully started process 'Gradle Test Executor 18'

org.whispersystems.libsignal.devices.DeviceConsistencyTest > testDeviceConsistency FAILED
    java.lang.AssertionError: NYI
        at org.whispersystems.curve25519.BaseJavaCurve25519Provider.calculateVrfSignature(BaseJavaCurve25519Provider.java:77)
        at org.whispersystems.curve25519.JavaCurve25519Provider.calculateVrfSignature(JavaCurve25519Provider.java:13)
        at org.whispersystems.curve25519.OpportunisticCurve25519Provider.calculateVrfSignature(OpportunisticCurve25519Provider.java:68)
        at org.whispersystems.curve25519.Curve25519.calculateVrfSignature(Curve25519.java:133)
        at org.whispersystems.libsignal.ecc.Curve.calculateVrfSignature(Curve.java:120)
        at org.whispersystems.libsignal.protocol.DeviceConsistencyMessage.<init>(DeviceConsistencyMessage.java:23)
        at org.whispersystems.libsignal.devices.DeviceConsistencyTest.testDeviceConsistency(DeviceConsistencyTest.java:41)

Gradle Test Executor 18 finished executing tests.

I ran this at fde96d2 with minor patches on OpenBSD:

diff --git a/java/build.gradle b/java/build.gradle
index 99455dd..9d51ba0 100644
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -41,7 +41,7 @@ dependencies {
 
 protobuf {
     protoc {
-        artifact = 'com.google.protobuf:protoc:3.10.0'
+        path = '/usr/local/bin/protoc'
     }
     generateProtoTasks {
         all().each { task ->
diff --git a/settings.gradle b/settings.gradle
index 7412250..4a565e5 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':java', ':android', ':tests'
+include ':java', ':tests'

privacy policy

I have a big plan regarding privacy policy, I think that this solid plan will help us a lot in solving privacy problems. And everyone who talks about privacy policy problems now in the world will be silent.
Please help me to find any one in the privacy policy office.
I'm invention

Update Readme.md code example to use proper methods

// Instantiate a SessionBuilder for a remote recipientId + deviceId tuple.
SessionBuilder sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore,
                                                   identityStore, recipientId, deviceId);

This is no longer valid. The new SessionBuilder requires a SignalProtocolAddress instead of recipientId and deviceId.

Suggested code:

// Instantiate a SessionBuilder for a remote recipientId + deviceId tuple.
SignalProtocolAddress protocolAddress = new SignalProtocolAddress(recipientId, deviceId);
SessionBuilder sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore,
                                                   identityStore, protocolAddress);

Similarly, SessionCipher needs an update.

SessionCipher sessionCipher = new SessionCipher(...);

While you are reading this, can you slip in an explanation of how deviceId(integer) is used? Do you number them 1, 2, 3, 4...? Multiple devices are only possible if one user backup the private-keys and restores on another device, right? I feel I have wrong understanding for the use of deviceId because you just use DEFAULT_DEVICE_ID which is 1. Thanks anyway.

Tests failing (InvalidKeyException)

Tests are failing for me.
platform: Linux 64 bit
java: jdk 8u40
sdk: android-sdk_r24.0.2-linux

Am I missing something obvious here?

Thanks.

$ ./gradlew test
:java:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:java:processResources UP-TO-DATE
:java:classes
:java:compileTestJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:java:processTestResources UP-TO-DATE
:java:testClasses
:java:test

org.whispersystems.libaxolotl.SessionBuilderTest > testBasicPreKeyV3 FAILED
java.lang.AssertionError at SessionBuilderTest.java:129
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:129

org.whispersystems.libaxolotl.SessionBuilderTest > testBadSignedPreKeySignature PASSED

org.whispersystems.libaxolotl.SessionBuilderTest > testRepeatBundleMessageV2 FAILED
java.lang.AssertionError at SessionBuilderTest.java:262
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:262

org.whispersystems.libaxolotl.SessionBuilderTest > testRepeatBundleMessageV3 FAILED
java.lang.AssertionError at SessionBuilderTest.java:315
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:315

org.whispersystems.libaxolotl.SessionBuilderTest > testBadMessageBundle FAILED
java.lang.AssertionError at SessionBuilderTest.java:369
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:369

org.whispersystems.libaxolotl.SessionBuilderTest > testBasicKeyExchange FAILED
java.lang.AssertionError at SessionBuilderTest.java:520
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:520

org.whispersystems.libaxolotl.SessionBuilderTest > testSimultaneousKeyExchange FAILED
java.lang.AssertionError at SessionBuilderTest.java:520
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:520

org.whispersystems.libaxolotl.SessionBuilderTest > testOptionalOneTimePreKey FAILED
java.lang.AssertionError at SessionBuilderTest.java:493
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:493

org.whispersystems.libaxolotl.SessionBuilderTest > testBasicPreKeyV2 FAILED
java.lang.AssertionError at SessionBuilderTest.java:45
Caused by: java.security.InvalidKeyException at SessionBuilderTest.java:45

org.whispersystems.libaxolotl.CurveTest > testSignatureOverflow PASSED

org.whispersystems.libaxolotl.CurveTest > testPureJava PASSED

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testBasicSimultaneousInitiate FAILED
java.lang.AssertionError at SimultaneousInitiateTests.java:50
Caused by: java.security.InvalidKeyException at SimultaneousInitiateTests.java:50

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testLostSimultaneousInitiate FAILED
java.lang.AssertionError at SimultaneousInitiateTests.java:104
Caused by: java.security.InvalidKeyException at SimultaneousInitiateTests.java:104

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testSimultaneousInitiateLostMessage FAILED
java.lang.AssertionError at SimultaneousInitiateTests.java:156
Caused by: java.security.InvalidKeyException at SimultaneousInitiateTests.java:156

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testSimultaneousInitiateRepeatedMessages FAILED
java.lang.AssertionError at SimultaneousInitiateTests.java:215
Caused by: java.security.InvalidKeyException at SimultaneousInitiateTests.java:215

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testRepeatedSimultaneousInitiateRepeatedMessages FAILED
java.lang.AssertionError at SimultaneousInitiateTests.java:293
Caused by: java.security.InvalidKeyException at SimultaneousInitiateTests.java:293

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testRepeatedSimultaneousInitiateLostMessageRepeatedMessages FAILED
java.lang.AssertionError at SimultaneousInitiateTests.java:371
Caused by: java.security.InvalidKeyException at SimultaneousInitiateTests.java:371

org.whispersystems.libaxolotl.SessionCipherTest > testBasicSessionV3 FAILED
java.lang.AssertionError at SessionCipherTest.java:62
Caused by: java.security.InvalidKeyException at SessionCipherTest.java:62

org.whispersystems.libaxolotl.SessionCipherTest > testBasicSessionV2 FAILED
java.lang.AssertionError at SessionCipherTest.java:62
Caused by: java.security.InvalidKeyException at SessionCipherTest.java:62

org.whispersystems.libaxolotl.ecc.Curve25519Test > testAgreement PASSED

org.whispersystems.libaxolotl.ecc.Curve25519Test > testRandomAgreements PASSED

org.whispersystems.libaxolotl.ecc.Curve25519Test > testSignature PASSED

org.whispersystems.libaxolotl.ratchet.RatchetingSessionTest > testRatchetingSessionAsAlice PASSED

org.whispersystems.libaxolotl.ratchet.RatchetingSessionTest > testRatchetingSessionAsBob PASSED

org.whispersystems.libaxolotl.ratchet.ChainKeyTest > testChainKeyDerivationV2 PASSED

org.whispersystems.libaxolotl.ratchet.RootKeyTest > testRootKeyDerivationV2 PASSED

org.whispersystems.libaxolotl.groups.GroupCipherTest > testBasicRatchet FAILED
java.lang.AssertionError at GroupCipherTest.java:62
Caused by: java.security.InvalidKeyException at GroupCipherTest.java:62

org.whispersystems.libaxolotl.groups.GroupCipherTest > testOutOfOrder FAILED
java.lang.AssertionError at GroupCipherTest.java:105
Caused by: java.security.InvalidKeyException at GroupCipherTest.java:105

org.whispersystems.libaxolotl.groups.GroupCipherTest > testEncryptNoSession PASSED

org.whispersystems.libaxolotl.groups.GroupCipherTest > testBasicEncryptDecrypt FAILED
java.lang.AssertionError at GroupCipherTest.java:37
Caused by: java.security.InvalidKeyException at GroupCipherTest.java:37

org.whispersystems.libaxolotl.kdf.HKDFTest > testVectorV3 PASSED

org.whispersystems.libaxolotl.kdf.HKDFTest > testVectorLongV3 PASSED

org.whispersystems.libaxolotl.kdf.HKDFTest > testVectorV2 PASSED

33 tests completed, 19 failed
:java:test FAILED

FAILURE: Build failed with an exception.

org.whispersystems.curve25519.NoSuchProviderException

When i use libsignal-protocol-java๏ผˆversion 2.7.0 ๏ผ‰in my android project, there is a problem.
In my gradle file, i add dependancies like following:

      implementation'org.whispersystems:curve25519-android:0.5.0'
      implementation('org.whispersystems:signal-protocol-android:2.7.0'){
         exclude group:'org.whispersystems',module:'curve25519-android'
     }

when i directly run my project via Android sutido, the app works fine. However, when i bulid an apk, and install via the apk i had built. There is an error show up, said โ€œorg.whispersystems.curve25519.NoSuchProviderExceptionโ€

it seems like the curve25519.os not built into the apk.

apache license or mit

Is it possible to add Apache or MIT License to this project? I want to use it in my Android app, but I need to disclose my whole source code if I use this library.

Need Detailed documentation

I want to use this plug in for E2EE for my chat app with messaging, audio and video calls.

I have already gone through ReadMe.md , I think it is not in detail(at least for people like me who are new to this)

Can any one please provide detailed documentation with sample code.

Tests failing (InvalidKeyException)

Last bug was closed. I tried to respond to the request for more details but I had no way to reopen the bug. Not sure how to proceed (in the sense that I don't know if comments added to the old bug just go in a black hole) so trying again with a new bug.

Tests are failing on a fresh checkout of (https://github.com/WhisperSystems/libaxolotl-android.git)

platform: Linux 64 bit
java: jdk 8u40
sdk: android-sdk_r24.0.2-linux

Also tried on 32 bit Linux and got the same result.

I'm happy to provide any further details you require. I have provided all the relevant details I can think of. What other details would help?

Here is the output of gradle with the --info option;

./gradlew build --info
Starting Build
Settings evaluated using settings file '/home/dev/libaxolotl-android/settings.gradle'.
Projects loaded. Root project using build file '/home/dev/libaxolotl-android/build.gradle'.
Included projects: [root project 'libaxolotl-android', project ':android', project ':java', project ':tests']
Evaluating root project 'libaxolotl-android' using build file '/home/dev/libaxolotl-android/build.gradle'.
Evaluating project ':android' using build file '/home/dev/libaxolotl-android/android/build.gradle'.
Evaluating project ':java' using build file '/home/dev/libaxolotl-android/java/build.gradle'.
Evaluating project ':tests' using build file '/home/dev/libaxolotl-android/tests/build.gradle'.
All projects evaluated.
Selected primary task 'build' from project :
Tasks to be executed: [task ':android:compileLint', task ':android:copyDebugLint', task ':android:mergeDebugProguardFiles', task ':android:preBuild', task ':android:preDebugBuild', task ':android:checkDebugManifest', task ':android:preDebugTestBuild', task ':android:preReleaseBuild', task ':java:compileJava', task ':java:processResources', task ':java:classes', task ':java:jar', task ':android:prepareOrgWhispersystemsCurve25519Android022Library', task ':android:prepareDebugDependencies', task ':android:compileDebugAidl', task ':android:compileDebugRenderscript', task ':android:generateDebugBuildConfig', task ':android:generateDebugAssets', task ':android:mergeDebugAssets', task ':android:generateDebugResValues', task ':android:generateDebugResources', task ':android:mergeDebugResources', task ':android:processDebugManifest', task ':android:processDebugResources', task ':android:generateDebugSources', task ':android:compileDebugJava', task ':android:processDebugJavaRes', task ':android:packageDebugJar', task ':android:compileDebugNdk', task ':android:packageDebugJniLibs', task ':android:packageDebugLocalJar', task ':android:packageDebugRenderscript', task ':android:packageDebugResources', task ':android:bundleDebug', task ':android:assembleDebug', task ':android:copyReleaseLint', task ':android:mergeReleaseProguardFiles', task ':android:checkReleaseManifest', task ':android:prepareReleaseDependencies', task ':android:compileReleaseAidl', task ':android:compileReleaseRenderscript', task ':android:generateReleaseBuildConfig', task ':android:generateReleaseAssets', task ':android:mergeReleaseAssets', task ':android:generateReleaseResValues', task ':android:generateReleaseResources', task ':android:mergeReleaseResources', task ':android:processReleaseManifest', task ':android:processReleaseResources', task ':android:generateReleaseSources', task ':android:compileReleaseJava', task ':android:processReleaseJavaRes', task ':android:packageReleaseJar', task ':android:compileReleaseNdk', task ':android:packageReleaseJniLibs', task ':android:packageReleaseLocalJar', task ':android:packageReleaseRenderscript', task ':android:packageReleaseResources', task ':android:bundleRelease', task ':android:assembleRelease', task ':android:signArchives', task ':android:assemble', task ':android:lint', task ':android:check', task ':android:build', task ':java:javadoc', task ':java:packageJavadoc', task ':java:packageSources', task ':java:signArchives', task ':java:assemble', task ':java:compileTestJava', task ':java:processTestResources', task ':java:testClasses', task ':java:test', task ':java:check', task ':java:build', task ':tests:compileJava', task ':tests:processResources', task ':tests:classes', task ':tests:jar', task ':tests:assemble', task ':tests:compileTestJava', task ':tests:processTestResources', task ':tests:testClasses', task ':tests:test', task ':tests:check', task ':tests:build']
:android:compileLint (Thread[main,5,main]) started.
:android:compileLint
Executing task ':android:compileLint' (up-to-date check took 0.001 secs) due to:
Task has not declared any outputs.
:android:compileLint (Thread[main,5,main]) completed. Took 0.021 secs.
:android:copyDebugLint (Thread[main,5,main]) started.
:android:copyDebugLint
Skipping task ':android:copyDebugLint' as it has no source files.
:android:copyDebugLint UP-TO-DATE
:android:copyDebugLint (Thread[main,5,main]) completed. Took 0.008 secs.
:android:mergeDebugProguardFiles (Thread[main,5,main]) started.
:android:mergeDebugProguardFiles
Skipping task ':android:mergeDebugProguardFiles' as it is up-to-date (took 0.018 secs).
:android:mergeDebugProguardFiles UP-TO-DATE
:android:mergeDebugProguardFiles (Thread[main,5,main]) completed. Took 0.023 secs.
:android:preBuild (Thread[main,5,main]) started.
:android:preBuild
Executing task ':android:preBuild' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:android:preBuild (Thread[main,5,main]) completed. Took 0.064 secs.
:android:preDebugBuild (Thread[main,5,main]) started.
:android:preDebugBuild
Skipping task ':android:preDebugBuild' as it has no actions.
:android:preDebugBuild (Thread[main,5,main]) completed. Took 0.001 secs.
:android:checkDebugManifest (Thread[main,5,main]) started.
:android:checkDebugManifest
Executing task ':android:checkDebugManifest' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:android:checkDebugManifest (Thread[main,5,main]) completed. Took 0.003 secs.
:android:preDebugTestBuild (Thread[main,5,main]) started.
:android:preDebugTestBuild
Skipping task ':android:preDebugTestBuild' as it has no actions.
:android:preDebugTestBuild (Thread[main,5,main]) completed. Took 0.001 secs.
:android:preReleaseBuild (Thread[main,5,main]) started.
:android:preReleaseBuild
Skipping task ':android:preReleaseBuild' as it has no actions.
:android:preReleaseBuild (Thread[main,5,main]) completed. Took 0.001 secs.
:java:compileJava (Thread[main,5,main]) started.
:java:compileJava
Skipping task ':java:compileJava' as it is up-to-date (took 0.087 secs).
:java:compileJava UP-TO-DATE
:java:compileJava (Thread[main,5,main]) completed. Took 0.097 secs.
:java:processResources (Thread[main,5,main]) started.
:java:processResources
Skipping task ':java:processResources' as it has no source files.
:java:processResources UP-TO-DATE
:java:processResources (Thread[main,5,main]) completed. Took 0.003 secs.
:java:classes (Thread[main,5,main]) started.
:java:classes
Skipping task ':java:classes' as it has no actions.
:java:classes UP-TO-DATE
:java:classes (Thread[main,5,main]) completed. Took 0.001 secs.
:java:jar (Thread[main,5,main]) started.
:java:jar
Skipping task ':java:jar' as it is up-to-date (took 0.039 secs).
:java:jar UP-TO-DATE
:java:jar (Thread[main,5,main]) completed. Took 0.046 secs.
:android:prepareOrgWhispersystemsCurve25519Android022Library (Thread[main,5,main]) started.
:android:prepareOrgWhispersystemsCurve25519Android022Library
Skipping task ':android:prepareOrgWhispersystemsCurve25519Android022Library' as it is up-to-date (took 0.005 secs).
:android:prepareOrgWhispersystemsCurve25519Android022Library UP-TO-DATE
:android:prepareOrgWhispersystemsCurve25519Android022Library (Thread[main,5,main]) completed. Took 0.007 secs.
:android:prepareDebugDependencies (Thread[main,5,main]) started.
:android:prepareDebugDependencies
Executing task ':android:prepareDebugDependencies' (up-to-date check took 0.001 secs) due to:
Task has not declared any outputs.
:android:prepareDebugDependencies (Thread[main,5,main]) completed. Took 0.015 secs.
:android:compileDebugAidl (Thread[main,5,main]) started.
:android:compileDebugAidl
Skipping task ':android:compileDebugAidl' as it is up-to-date (took 0.005 secs).
:android:compileDebugAidl UP-TO-DATE
:android:compileDebugAidl (Thread[main,5,main]) completed. Took 0.008 secs.
:android:compileDebugRenderscript (Thread[main,5,main]) started.
:android:compileDebugRenderscript
Skipping task ':android:compileDebugRenderscript' as it is up-to-date (took 0.009 secs).
:android:compileDebugRenderscript UP-TO-DATE
:android:compileDebugRenderscript (Thread[main,5,main]) completed. Took 0.021 secs.
:android:generateDebugBuildConfig (Thread[main,5,main]) started.
:android:generateDebugBuildConfig
Skipping task ':android:generateDebugBuildConfig' as it is up-to-date (took 0.01 secs).
:android:generateDebugBuildConfig UP-TO-DATE
:android:generateDebugBuildConfig (Thread[main,5,main]) completed. Took 0.018 secs.
:android:generateDebugAssets (Thread[main,5,main]) started.
:android:generateDebugAssets
Skipping task ':android:generateDebugAssets' as it has no actions.
:android:generateDebugAssets UP-TO-DATE
:android:generateDebugAssets (Thread[main,5,main]) completed. Took 0.002 secs.
:android:mergeDebugAssets (Thread[main,5,main]) started.
:android:mergeDebugAssets
Skipping task ':android:mergeDebugAssets' as it is up-to-date (took 0.003 secs).
:android:mergeDebugAssets UP-TO-DATE
:android:mergeDebugAssets (Thread[main,5,main]) completed. Took 0.005 secs.
:android:generateDebugResValues (Thread[main,5,main]) started.
:android:generateDebugResValues
Skipping task ':android:generateDebugResValues' as it is up-to-date (took 0.002 secs).
:android:generateDebugResValues UP-TO-DATE
:android:generateDebugResValues (Thread[main,5,main]) completed. Took 0.003 secs.
:android:generateDebugResources (Thread[main,5,main]) started.
:android:generateDebugResources
Skipping task ':android:generateDebugResources' as it has no actions.
:android:generateDebugResources UP-TO-DATE
:android:generateDebugResources (Thread[main,5,main]) completed. Took 0.001 secs.
:android:mergeDebugResources (Thread[main,5,main]) started.
:android:mergeDebugResources
Skipping task ':android:mergeDebugResources' as it is up-to-date (took 0.005 secs).
:android:mergeDebugResources UP-TO-DATE
:android:mergeDebugResources (Thread[main,5,main]) completed. Took 0.008 secs.
:android:processDebugManifest (Thread[main,5,main]) started.
:android:processDebugManifest
Skipping task ':android:processDebugManifest' as it is up-to-date (took 0.008 secs).
:android:processDebugManifest UP-TO-DATE
:android:processDebugManifest (Thread[main,5,main]) completed. Took 0.04 secs.
:android:processDebugResources (Thread[main,5,main]) started.
:android:processDebugResources
Skipping task ':android:processDebugResources' as it is up-to-date (took 0.008 secs).
:android:processDebugResources UP-TO-DATE
:android:processDebugResources (Thread[main,5,main]) completed. Took 0.014 secs.
:android:generateDebugSources (Thread[main,5,main]) started.
:android:generateDebugSources
Skipping task ':android:generateDebugSources' as it has no actions.
:android:generateDebugSources UP-TO-DATE
:android:generateDebugSources (Thread[main,5,main]) completed. Took 0.003 secs.
:android:compileDebugJava (Thread[main,5,main]) started.
:android:compileDebugJava
Skipping task ':android:compileDebugJava' as it is up-to-date (took 0.014 secs).
:android:compileDebugJava UP-TO-DATE
:android:compileDebugJava (Thread[main,5,main]) completed. Took 0.042 secs.
:android:processDebugJavaRes (Thread[main,5,main]) started.
:android:processDebugJavaRes
Skipping task ':android:processDebugJavaRes' as it has no source files.
:android:processDebugJavaRes UP-TO-DATE
:android:processDebugJavaRes (Thread[main,5,main]) completed. Took 0.004 secs.
:android:packageDebugJar (Thread[main,5,main]) started.
:android:packageDebugJar
Skipping task ':android:packageDebugJar' as it is up-to-date (took 0.01 secs).
:android:packageDebugJar UP-TO-DATE
:android:packageDebugJar (Thread[main,5,main]) completed. Took 0.014 secs.
:android:compileDebugNdk (Thread[main,5,main]) started.
:android:compileDebugNdk
Skipping task ':android:compileDebugNdk' as it is up-to-date (took 0.011 secs).
:android:compileDebugNdk UP-TO-DATE
:android:compileDebugNdk (Thread[main,5,main]) completed. Took 0.018 secs.
:android:packageDebugJniLibs (Thread[main,5,main]) started.
:android:packageDebugJniLibs
Skipping task ':android:packageDebugJniLibs' as it has no source files.
:android:packageDebugJniLibs UP-TO-DATE
:android:packageDebugJniLibs (Thread[main,5,main]) completed. Took 0.004 secs.
:android:packageDebugLocalJar (Thread[main,5,main]) started.
:android:packageDebugLocalJar
Skipping task ':android:packageDebugLocalJar' as it has no source files.
:android:packageDebugLocalJar UP-TO-DATE
:android:packageDebugLocalJar (Thread[main,5,main]) completed. Took 0.002 secs.
:android:packageDebugRenderscript (Thread[main,5,main]) started.
:android:packageDebugRenderscript
Skipping task ':android:packageDebugRenderscript' as it has no source files.
:android:packageDebugRenderscript UP-TO-DATE
:android:packageDebugRenderscript (Thread[main,5,main]) completed. Took 0.002 secs.
:android:packageDebugResources (Thread[main,5,main]) started.
:android:packageDebugResources
Skipping task ':android:packageDebugResources' as it is up-to-date (took 0.008 secs).
:android:packageDebugResources UP-TO-DATE
:android:packageDebugResources (Thread[main,5,main]) completed. Took 0.012 secs.
:android:bundleDebug (Thread[main,5,main]) started.
:android:bundleDebug
Executing task ':android:bundleDebug' (up-to-date check took 0.004 secs) due to:
Output file /home/dev/libaxolotl-android/android/build/outputs/aar/axolotl-android-1.3.1.aar has changed.
:android:bundleDebug (Thread[main,5,main]) completed. Took 0.075 secs.
:android:assembleDebug (Thread[main,5,main]) started.
:android:assembleDebug
Skipping task ':android:assembleDebug' as it has no actions.
:android:assembleDebug (Thread[main,5,main]) completed. Took 0.006 secs.
:android:copyReleaseLint (Thread[main,5,main]) started.
:android:copyReleaseLint
Skipping task ':android:copyReleaseLint' as it has no source files.
:android:copyReleaseLint UP-TO-DATE
:android:copyReleaseLint (Thread[main,5,main]) completed. Took 0.005 secs.
:android:mergeReleaseProguardFiles (Thread[main,5,main]) started.
:android:mergeReleaseProguardFiles
Skipping task ':android:mergeReleaseProguardFiles' as it is up-to-date (took 0.002 secs).
:android:mergeReleaseProguardFiles UP-TO-DATE
:android:mergeReleaseProguardFiles (Thread[main,5,main]) completed. Took 0.006 secs.
:android:checkReleaseManifest (Thread[main,5,main]) started.
:android:checkReleaseManifest
Executing task ':android:checkReleaseManifest' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:android:checkReleaseManifest (Thread[main,5,main]) completed. Took 0.001 secs.
:android:prepareReleaseDependencies (Thread[main,5,main]) started.
:android:prepareReleaseDependencies
Executing task ':android:prepareReleaseDependencies' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:android:prepareReleaseDependencies (Thread[main,5,main]) completed. Took 0.003 secs.
:android:compileReleaseAidl (Thread[main,5,main]) started.
:android:compileReleaseAidl
Skipping task ':android:compileReleaseAidl' as it is up-to-date (took 0.006 secs).
:android:compileReleaseAidl UP-TO-DATE
:android:compileReleaseAidl (Thread[main,5,main]) completed. Took 0.008 secs.
:android:compileReleaseRenderscript (Thread[main,5,main]) started.
:android:compileReleaseRenderscript
Skipping task ':android:compileReleaseRenderscript' as it is up-to-date (took 0.005 secs).
:android:compileReleaseRenderscript UP-TO-DATE
:android:compileReleaseRenderscript (Thread[main,5,main]) completed. Took 0.007 secs.
:android:generateReleaseBuildConfig (Thread[main,5,main]) started.
:android:generateReleaseBuildConfig
Skipping task ':android:generateReleaseBuildConfig' as it is up-to-date (took 0.003 secs).
:android:generateReleaseBuildConfig UP-TO-DATE
:android:generateReleaseBuildConfig (Thread[main,5,main]) completed. Took 0.006 secs.
:android:generateReleaseAssets (Thread[main,5,main]) started.
:android:generateReleaseAssets
Skipping task ':android:generateReleaseAssets' as it has no actions.
:android:generateReleaseAssets UP-TO-DATE
:android:generateReleaseAssets (Thread[main,5,main]) completed. Took 0.0 secs.
:android:mergeReleaseAssets (Thread[main,5,main]) started.
:android:mergeReleaseAssets
Skipping task ':android:mergeReleaseAssets' as it is up-to-date (took 0.002 secs).
:android:mergeReleaseAssets UP-TO-DATE
:android:mergeReleaseAssets (Thread[main,5,main]) completed. Took 0.003 secs.
:android:generateReleaseResValues (Thread[main,5,main]) started.
:android:generateReleaseResValues
Skipping task ':android:generateReleaseResValues' as it is up-to-date (took 0.002 secs).
:android:generateReleaseResValues UP-TO-DATE
:android:generateReleaseResValues (Thread[main,5,main]) completed. Took 0.003 secs.
:android:generateReleaseResources (Thread[main,5,main]) started.
:android:generateReleaseResources
Skipping task ':android:generateReleaseResources' as it has no actions.
:android:generateReleaseResources UP-TO-DATE
:android:generateReleaseResources (Thread[main,5,main]) completed. Took 0.001 secs.
:android:mergeReleaseResources (Thread[main,5,main]) started.
:android:mergeReleaseResources
Skipping task ':android:mergeReleaseResources' as it is up-to-date (took 0.008 secs).
:android:mergeReleaseResources UP-TO-DATE
:android:mergeReleaseResources (Thread[main,5,main]) completed. Took 0.011 secs.
:android:processReleaseManifest (Thread[main,5,main]) started.
:android:processReleaseManifest
Skipping task ':android:processReleaseManifest' as it is up-to-date (took 0.003 secs).
:android:processReleaseManifest UP-TO-DATE
:android:processReleaseManifest (Thread[main,5,main]) completed. Took 0.004 secs.
:android:processReleaseResources (Thread[main,5,main]) started.
:android:processReleaseResources
Skipping task ':android:processReleaseResources' as it is up-to-date (took 0.005 secs).
:android:processReleaseResources UP-TO-DATE
:android:processReleaseResources (Thread[main,5,main]) completed. Took 0.007 secs.
:android:generateReleaseSources (Thread[main,5,main]) started.
:android:generateReleaseSources
Skipping task ':android:generateReleaseSources' as it has no actions.
:android:generateReleaseSources UP-TO-DATE
:android:generateReleaseSources (Thread[main,5,main]) completed. Took 0.001 secs.
:android:compileReleaseJava (Thread[main,5,main]) started.
:android:compileReleaseJava
Skipping task ':android:compileReleaseJava' as it is up-to-date (took 0.013 secs).
:android:compileReleaseJava UP-TO-DATE
:android:compileReleaseJava (Thread[main,5,main]) completed. Took 0.015 secs.
:android:processReleaseJavaRes (Thread[main,5,main]) started.
:android:processReleaseJavaRes
Skipping task ':android:processReleaseJavaRes' as it has no source files.
:android:processReleaseJavaRes UP-TO-DATE
:android:processReleaseJavaRes (Thread[main,5,main]) completed. Took 0.001 secs.
:android:packageReleaseJar (Thread[main,5,main]) started.
:android:packageReleaseJar
Skipping task ':android:packageReleaseJar' as it is up-to-date (took 0.004 secs).
:android:packageReleaseJar UP-TO-DATE
:android:packageReleaseJar (Thread[main,5,main]) completed. Took 0.007 secs.
:android:compileReleaseNdk (Thread[main,5,main]) started.
:android:compileReleaseNdk
Skipping task ':android:compileReleaseNdk' as it is up-to-date (took 0.004 secs).
:android:compileReleaseNdk UP-TO-DATE
:android:compileReleaseNdk (Thread[main,5,main]) completed. Took 0.006 secs.
:android:packageReleaseJniLibs (Thread[main,5,main]) started.
:android:packageReleaseJniLibs
Skipping task ':android:packageReleaseJniLibs' as it has no source files.
:android:packageReleaseJniLibs UP-TO-DATE
:android:packageReleaseJniLibs (Thread[main,5,main]) completed. Took 0.001 secs.
:android:packageReleaseLocalJar (Thread[main,5,main]) started.
:android:packageReleaseLocalJar
Skipping task ':android:packageReleaseLocalJar' as it has no source files.
:android:packageReleaseLocalJar UP-TO-DATE
:android:packageReleaseLocalJar (Thread[main,5,main]) completed. Took 0.001 secs.
:android:packageReleaseRenderscript (Thread[main,5,main]) started.
:android:packageReleaseRenderscript
Skipping task ':android:packageReleaseRenderscript' as it has no source files.
:android:packageReleaseRenderscript UP-TO-DATE
:android:packageReleaseRenderscript (Thread[main,5,main]) completed. Took 0.001 secs.
:android:packageReleaseResources (Thread[main,5,main]) started.
:android:packageReleaseResources
Skipping task ':android:packageReleaseResources' as it is up-to-date (took 0.009 secs).
:android:packageReleaseResources UP-TO-DATE
:android:packageReleaseResources (Thread[main,5,main]) completed. Took 0.011 secs.
:android:bundleRelease (Thread[main,5,main]) started.
:android:bundleRelease
Executing task ':android:bundleRelease' (up-to-date check took 0.002 secs) due to:
Output file /home/dev/libaxolotl-android/android/build/outputs/aar/axolotl-android-1.3.1.aar has changed.
:android:bundleRelease (Thread[main,5,main]) completed. Took 0.009 secs.
:android:assembleRelease (Thread[main,5,main]) started.
:android:assembleRelease
Skipping task ':android:assembleRelease' as it has no actions.
:android:assembleRelease (Thread[main,5,main]) completed. Took 0.0 secs.
:android:signArchives (Thread[main,5,main]) started.
:android:signArchives
Skipping task ':android:signArchives' as task onlyIf is false.
:android:signArchives SKIPPED
:android:signArchives (Thread[main,5,main]) completed. Took 0.015 secs.
:android:assemble (Thread[main,5,main]) started.
:android:assemble
Skipping task ':android:assemble' as it has no actions.
:android:assemble (Thread[main,5,main]) completed. Took 0.0 secs.
:android:lint (Thread[main,5,main]) started.
:android:lint
Executing task ':android:lint' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
Ran lint on variant release: 0 issues found
Ran lint on variant debug: 0 issues found
Wrote HTML report to file:/home/dev/libaxolotl-android/android/build/outputs/lint-results.html
Wrote XML report to /home/dev/libaxolotl-android/android/build/outputs/lint-results.xml
:android:lint (Thread[main,5,main]) completed. Took 1.874 secs.
:android:check (Thread[main,5,main]) started.
:android:check
Skipping task ':android:check' as it has no actions.
:android:check (Thread[main,5,main]) completed. Took 0.001 secs.
:android:build (Thread[main,5,main]) started.
:android:build
Skipping task ':android:build' as it has no actions.
:android:build (Thread[main,5,main]) completed. Took 0.001 secs.
:java:javadoc (Thread[main,5,main]) started.
:java:javadoc
Skipping task ':java:javadoc' as it is up-to-date (took 0.033 secs).
:java:javadoc UP-TO-DATE
:java:javadoc (Thread[main,5,main]) completed. Took 0.037 secs.
:java:packageJavadoc (Thread[main,5,main]) started.
:java:packageJavadoc
Skipping task ':java:packageJavadoc' as it is up-to-date (took 0.014 secs).
:java:packageJavadoc UP-TO-DATE
:java:packageJavadoc (Thread[main,5,main]) completed. Took 0.017 secs.
:java:packageSources (Thread[main,5,main]) started.
:java:packageSources
Skipping task ':java:packageSources' as it is up-to-date (took 0.011 secs).
:java:packageSources UP-TO-DATE
:java:packageSources (Thread[main,5,main]) completed. Took 0.014 secs.
:java:signArchives (Thread[main,5,main]) started.
:java:signArchives
Skipping task ':java:signArchives' as task onlyIf is false.
:java:signArchives SKIPPED
:java:signArchives (Thread[main,5,main]) completed. Took 0.002 secs.
:java:assemble (Thread[main,5,main]) started.
:java:assemble
Skipping task ':java:assemble' as it has no actions.
:java:assemble UP-TO-DATE
:java:assemble (Thread[main,5,main]) completed. Took 0.001 secs.
:java:compileTestJava (Thread[main,5,main]) started.
:java:compileTestJava
Skipping task ':java:compileTestJava' as it is up-to-date (took 0.031 secs).
:java:compileTestJava UP-TO-DATE
:java:compileTestJava (Thread[main,5,main]) completed. Took 0.033 secs.
:java:processTestResources (Thread[main,5,main]) started.
:java:processTestResources
Skipping task ':java:processTestResources' as it has no source files.
:java:processTestResources UP-TO-DATE
:java:processTestResources (Thread[main,5,main]) completed. Took 0.001 secs.
:java:testClasses (Thread[main,5,main]) started.
:java:testClasses
Skipping task ':java:testClasses' as it has no actions.
:java:testClasses UP-TO-DATE
:java:testClasses (Thread[main,5,main]) completed. Took 0.001 secs.
:java:test (Thread[main,5,main]) started.
:java:test
Executing task ':java:test' (up-to-date check took 0.066 secs) due to:
No history is available.
Starting process 'Gradle Test Executor 1'. Working directory: /home/dev/libaxolotl-android/java Command: /home/dev/jdk1.8.0_40/bin/java -Djava.security.manager=jarjar.org.gradle.process.internal.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant -ea -cp /home/dev/.gradle/caches/2.2.1/workerMain/gradle-worker.jar jarjar.org.gradle.process.internal.launcher.GradleWorkerMain 'Gradle Test Executor 1'
Successfully started process 'Gradle Test Executor 1'
Gradle Test Executor 1 started executing tests.

org.whispersystems.libaxolotl.SessionBuilderTest > testBasicPreKeyV3 FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.testBasicPreKeyV3(SessionBuilderTest.java:129)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SessionBuilderTest > testRepeatBundleMessageV2 FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:442)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:401)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.testRepeatBundleMessageV2(SessionBuilderTest.java:262)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:436)
    ... 3 more

org.whispersystems.libaxolotl.SessionBuilderTest > testRepeatBundleMessageV3 FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.testRepeatBundleMessageV3(SessionBuilderTest.java:315)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SessionBuilderTest > testBadMessageBundle FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.testBadMessageBundle(SessionBuilderTest.java:369)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SessionBuilderTest > testBasicKeyExchange FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.runInteraction(SessionBuilderTest.java:520)
at org.whispersystems.libaxolotl.SessionBuilderTest.testBasicKeyExchange(SessionBuilderTest.java:421)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 4 more

org.whispersystems.libaxolotl.SessionBuilderTest > testSimultaneousKeyExchange FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.runInteraction(SessionBuilderTest.java:520)
at org.whispersystems.libaxolotl.SessionBuilderTest.testSimultaneousKeyExchange(SessionBuilderTest.java:466)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 4 more

org.whispersystems.libaxolotl.SessionBuilderTest > testOptionalOneTimePreKey FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.testOptionalOneTimePreKey(SessionBuilderTest.java:493)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SessionBuilderTest > testBasicPreKeyV2 FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:442)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:401)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionBuilderTest.testBasicPreKeyV2(SessionBuilderTest.java:45)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:436)
    ... 3 more

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testBasicSimultaneousInitiate FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SimultaneousInitiateTests.testBasicSimultaneousInitiate(SimultaneousInitiateTests.java:50)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testRepeatedSimultaneousInitiateLostMessageRepeatedMessages FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SimultaneousInitiateTests.testRepeatedSimultaneousInitiateLostMessageRepeatedMessages(SimultaneousInitiateTests.java:371)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testLostSimultaneousInitiate FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SimultaneousInitiateTests.testLostSimultaneousInitiate(SimultaneousInitiateTests.java:104)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testSimultaneousInitiateLostMessage FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SimultaneousInitiateTests.testSimultaneousInitiateLostMessage(SimultaneousInitiateTests.java:156)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testSimultaneousInitiateRepeatedMessages FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SimultaneousInitiateTests.testSimultaneousInitiateRepeatedMessages(SimultaneousInitiateTests.java:215)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SimultaneousInitiateTests > testRepeatedSimultaneousInitiateRepeatedMessages FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SimultaneousInitiateTests.testRepeatedSimultaneousInitiateRepeatedMessages(SimultaneousInitiateTests.java:293)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 3 more

org.whispersystems.libaxolotl.SessionCipherTest > testBasicSessionV3 FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionCipherTest.runInteraction(SessionCipherTest.java:62)
at org.whispersystems.libaxolotl.SessionCipherTest.testBasicSessionV3(SessionCipherTest.java:47)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 4 more

org.whispersystems.libaxolotl.SessionCipherTest > testBasicSessionV2 FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:442)
at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:401)
at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
at org.whispersystems.libaxolotl.SessionCipherTest.runInteraction(SessionCipherTest.java:62)
at org.whispersystems.libaxolotl.SessionCipherTest.testBasicSessionV2(SessionCipherTest.java:36)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:436)
    ... 4 more

Gradle Test Executor 1 finished executing tests.

org.whispersystems.libaxolotl.groups.GroupCipherTest > testBasicEncryptDecrypt FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.groups.GroupCipher.getCipherText(GroupCipher.java:184)
at org.whispersystems.libaxolotl.groups.GroupCipher.encrypt(GroupCipher.java:76)
at org.whispersystems.libaxolotl.groups.GroupCipherTest.testBasicEncryptDecrypt(GroupCipherTest.java:37)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.groups.GroupCipher.getCipherText(GroupCipher.java:178)
    ... 2 more

org.whispersystems.libaxolotl.groups.GroupCipherTest > testBasicRatchet FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.groups.GroupCipher.getCipherText(GroupCipher.java:184)
at org.whispersystems.libaxolotl.groups.GroupCipher.encrypt(GroupCipher.java:76)
at org.whispersystems.libaxolotl.groups.GroupCipherTest.testBasicRatchet(GroupCipherTest.java:62)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.groups.GroupCipher.getCipherText(GroupCipher.java:178)
    ... 2 more

org.whispersystems.libaxolotl.groups.GroupCipherTest > testOutOfOrder FAILED
java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
at org.whispersystems.libaxolotl.groups.GroupCipher.getCipherText(GroupCipher.java:184)
at org.whispersystems.libaxolotl.groups.GroupCipher.encrypt(GroupCipher.java:76)
at org.whispersystems.libaxolotl.groups.GroupCipherTest.testOutOfOrder(GroupCipherTest.java:105)

Caused by:
java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.groups.GroupCipher.getCipherText(GroupCipher.java:178)
    ... 2 more

33 tests completed, 19 failed
Finished generating test XML results (0.05 secs) into: /home/dev/libaxolotl-android/java/build/test-results
Generating HTML test report...
Finished generating test html results (0.074 secs) into: /home/dev/libaxolotl-android/java/build/reports/tests
:java:test FAILED
:java:test (Thread[main,5,main]) completed. Took 2.487 secs.

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':java:test'.

There were failing tests. See the report at: file:///home/dev/libaxolotl-android/java/build/reports/tests/index.html
Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 11.639 secs
Stopped 0 compiler daemon(s).

Unlimited number of message keys stored

Correct my if I'm wrong, but it looks like there is no limit on the number of message keys that can be stored for a given chain key. In contrast, chain keys have a limit of 5.

An attacker could send messages to a client with a counter that increments by 2000 each time. Each time the client receives one of these messages, it is forced to compute and store 2000 more message keys. To make matters worse, the client must do this before it has checked the message is authentic, so an attacker doesn't even have to be able to produce authentic messages. I'm not sure how the UI deals with InvalidMessageExceptions, but if it silently ignores them then the user will not even be aware this is happening.

A quick back-of-the-envelope calculation gives:

80 bytes per message key * 2000 keys * 10000 messages = 1.49GiB of storage used

It wouldn't take long for an attacker to fill a user's storage.

Have you considered this issue?

Updating the readme to use Java code style

Just one small thing: You could update the readme file using the java code tag:

Example:

    IdentityKeyPair    identityKeyPair = KeyHelper.generateIdentityKeyPair();
    int                registrationId  = KeyHelper.generateRegistrationId();
    List<PreKeyRecord> preKeys         = KeyHelper.generatePreKeys(startId, 100);
    SignedPreKeyRecord signedPreKey    = KeyHelper.generateSignedPreKey(identityKeyPair, 5);
	
    // Store identityKeyPair somewhere durable and safe.
    // Store registrationId somewhere durable and safe.

    // Store preKeys in PreKeyStore.
    // Store signed prekey in SignedPreKeyStore.

or

    SessionStore      sessionStore      = new MySessionStore();
    PreKeyStore       preKeyStore       = new MyPreKeyStore();
    SignedPreKeyStore signedPreKeyStore = new MySignedPreKeyStore();
    IdentityKeyStore  identityStore     = new MyIdentityKeyStore();
	
    // Instantiate a SessionBuilder for a remote recipientId + deviceId tuple.
	
    SessionBuilder sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore,
                                                       identityStore, recipientId, deviceId);
	
    // Build a session with a PreKey retrieved from the server.
    sessionBuilder.process(retrievedPreKey);
	
    SessionCipher     sessionCipher = new SessionCipher(sessionStore, recipientId, deviceId);
    CiphertextMessage message      = sessionCipher.encrypt("Hello world!".getBytes("UTF-8"));

    deliver(message.serialize());
	```

What does "install time" mean?

Hello.

I am trying to understand what "install time" means in the following statement from the READMe page.

At install time, a libsignal client needs to generate its identity keys, registration id, and prekeys.

Does it mean that when the app is installing, the keys will be generated? If yes, how do can I write install code?

Or, does it mean that generating the keys should be the first thing the app does when installed on a device?

Thanks.

Generate pre kyes ArrayIndexOutOfBoundsException

It works perfectly before now .but suddenly has stopped today. I didn't change anything

       at com.google.protobuf.MessageSchema.newSchemaForRawMessageInfo(MessageSchema.java:507)
       at com.google.protobuf.MessageSchema.newSchema(MessageSchema.java:227)
       at com.google.protobuf.ManifestSchemaFactory.newSchema(ManifestSchemaFactory.java:77)
       at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:71)
       at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:90)
       at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:104)
       at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:175)
       at com.google.protobuf.GeneratedMessageLite$Builder.buildPartial(GeneratedMessageLite.java:395)
       at com.google.protobuf.GeneratedMessageLite$Builder.build(GeneratedMessageLite.java:403)
       at org.whispersystems.libsignal.state.PreKeyRecord.<init>(PreKeyRecord.java:31)
       at org.whispersystems.libsignal.util.KeyHelper.generatePreKeys(KeyHelper.java:89)
       at com.strolink.android.crypto.PreKeyUtil.generatePreKeys(PreKeyUtil.kt:21)
       at com.strolink.android.job.RefreshOneTimePreKeysJob$Companion.generateKeys(RefreshOneTimePreKeysJob.kt:47)
       at com.strolink.android.ui.landing.LoadingViewModel$pushAsyncSignalKeys$2.invokeSuspend(LoadingViewModel.kt:43)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

Bump minSdk to >4

An empty AndroidManifest file causes the build system to assume minSdk=1. When adding this library as a dependency the ManifestMerger adds an implicit permission READ_PHONE_STATE see http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger#TOC-Implicit-permissions-addition

To my knowledge there is no way to 'raise' a min SDK of a library (it only work the other way round) so people using this libray will end up with unwanted permissions in their app.

If you would bump the minSdk to 5 this would not happen.

Please help me understand why is GPL3 library used in proprietary software WhatsApp?

Please help me understand why is GPL3 library used in proprietary software WhatsApp?

According to Wikipedia: WhatsApp calls are encrypted with SRTP, and all client-server communications are "layered within a separate encrypted channel".[124] The Signal Protocol library used by WhatsApp is open-source and published under the GPLv3 license.[124][125]

References to 124: https://www.whatsapp.com/security/WhatsApp-Security-Whitepaper.pdf where it says how they are using this library is open source:

The Signal Protocol library used by WhatsApp is Open Source, available
here: https://github.com/whispersystems/libsignal-protocol-java/

To what degree the hypocrisy may go?

Is the Whatsapp proprietary?

And why are you allowing them to use the GPL 3 licensed software?

If they did use the software with the GPL 3 licensed software, now their Whatsapp is automatically to release their source code, as they are bound to GPL 3 license.

And what are you doing there? Nothing?

UntrustedIdentityException

When I try to establish session then I got UntrustedIdentityException exception how to resolve, actually I don't know what is the exact flow so plz help me.

signalProtocol.processSession(recipientId, preKeyBundle)

If my recipient id is 123 and preKeyBundle is another device bundle which I want to communicate so how to resolve?

Getting null object reference on org.whispersystems.libsignal.state.SessionRecord.getSessionState()

Platform : Android

Java class : SessionCipherTest.java (libsignal-protocol-java/tests/src/test/java/org/whispersystems/libsignal/SessionCipherTest.java).

Issues : java.lang.NullPointerException

While executing class getting error in the line
CiphertextMessage message = aliceCipher.encrypt(alicePlaintext);

Error shows as :

W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'org.whispersystems.libsignal.state.SessionState org.whispersystems.libsignal.state.SessionRecord.getSessionState()' on a null object reference

W/System.err:     at org.whispersystems.libsignal.SessionCipher.encrypt(SessionCipher.java:104)

W/System.err:     at com.kasbah.hugarro.signaljavalibtest.MainActivity.runInteraction(MainActivity.java:203)

W/System.err:     at com.kasbah.hugarro.signaljavalibtest.MainActivity.testBasicSessionV3(MainActivity.java:138)

 W/System.err:     at com.kasbah.hugarro.signaljavalibtest.MainActivity.onCreate(MainActivity.java:109)

W/System.err:     at android.app.Activity.performCreate(Activity.java:6010)

W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)

W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)

W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)

W/System.err:     at android.app.ActivityThread.access$800(ActivityThread.java:155)

W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)

W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)

W/System.err:     at android.os.Looper.loop(Looper.java:135)

W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5343)

W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)

W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

What is the problem and how to solve this.

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.