├── ico
├── Exposed_Conscious.png
└── MainInterfaceIcon.png
├── .idea
├── vcs.xml
├── misc.xml
├── compiler.xml
├── modules.xml
├── libraries
│ ├── net_i2p_i2p_0_9_35.xml
│ ├── com_h2database_h2_1_4_197.xml
│ ├── net_i2p_client_streaming_0_9_35.xml
│ └── org_whispersystems_signal_protocol_java_2_6_2.xml
└── uiDesigner.xml
├── src
└── net
│ ├── strangled
│ └── maladan
│ │ ├── serializables
│ │ ├── Messaging
│ │ │ ├── FileConstants.java
│ │ │ ├── IEncryptedMessage.java
│ │ │ ├── EncryptedFileEnd.java
│ │ │ ├── EncryptedFileSpan.java
│ │ │ ├── EncryptedFileInitiation.java
│ │ │ ├── EncryptedMMessageObject.java
│ │ │ ├── FileEnd.java
│ │ │ ├── FileSpan.java
│ │ │ ├── MMessageObject.java
│ │ │ └── FileInitiation.java
│ │ └── Authentication
│ │ │ ├── IEncryptedAuth.java
│ │ │ ├── UserExistsState.java
│ │ │ ├── RegistrationResponseState.java
│ │ │ ├── EncryptedRegistrationResponseState.java
│ │ │ ├── LoginResponseState.java
│ │ │ ├── EncryptedUser.java
│ │ │ ├── EncryptedLoginResponseState.java
│ │ │ ├── User.java
│ │ │ ├── EncryptedClientPreKeyBundle.java
│ │ │ ├── SignalEncryptedPasswordSend.java
│ │ │ ├── ServerLogin.java
│ │ │ └── ServerInit.java
│ │ ├── shared
│ │ ├── AuthResults.java
│ │ ├── Contact.java
│ │ ├── MessengerConversation.java
│ │ ├── OutgoingMessageThread.java
│ │ ├── LocalLoginDataStore.java
│ │ └── IncomingMessageThread.java
│ │ └── cli
│ │ ├── MessageHandlerThread.java
│ │ └── Main.java
│ └── MaladaN
│ └── Tor
│ └── thoughtcrime
│ ├── PreKeyPublic.java
│ ├── InitData.java
│ ├── ServerResponsePreKeyBundle.java
│ ├── InitStore.java
│ ├── SendInitData.java
│ ├── GetSQLConnection.java
│ ├── SignalCrypto.java
│ └── MySignalProtocolStore.java
├── MaladaN-Messenger-Client.iml
├── README.md
└── LICENSE
/ico/Exposed_Conscious.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaladaN/MaladaN-Messenger-Client/HEAD/ico/Exposed_Conscious.png
--------------------------------------------------------------------------------
/ico/MainInterfaceIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaladaN/MaladaN-Messenger-Client/HEAD/ico/MainInterfaceIcon.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/FileConstants.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class FileConstants {
4 | public static int bufferLength = 8192;
5 | public static int encryptionBufferLength = 16000;
6 | }
7 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/IEncryptedMessage.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public interface IEncryptedMessage {
4 |
5 | void storeEncryptedMessage(byte[] message);
6 |
7 | byte[] getEncryptedMessage();
8 | }
9 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/IEncryptedAuth.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 | public interface IEncryptedAuth {
4 |
5 | void storeEncryptedData(byte[] encryptedData);
6 |
7 | byte[] getEncryptedData();
8 | }
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/libraries/net_i2p_i2p_0_9_35.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/libraries/com_h2database_h2_1_4_197.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/UserExistsState.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 |
4 | public class UserExistsState implements java.io.Serializable {
5 |
6 | private boolean userExists;
7 |
8 | public UserExistsState(boolean userExists) {
9 | this.userExists = userExists;
10 | }
11 |
12 | public boolean doesUserExists() {
13 | return userExists;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/RegistrationResponseState.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 | public class RegistrationResponseState implements java.io.Serializable {
4 | private boolean validRegistration;
5 |
6 | public RegistrationResponseState(boolean validRegistration) {
7 | this.validRegistration = validRegistration;
8 | }
9 |
10 | public boolean isValidRegistration() {
11 | return validRegistration;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/shared/AuthResults.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.shared;
2 |
3 |
4 | public class AuthResults {
5 |
6 | private String formattedResults;
7 | private boolean valid;
8 |
9 | AuthResults(String formattedResults, boolean valid) {
10 | this.formattedResults = formattedResults;
11 | this.valid = valid;
12 | }
13 |
14 | public String getFormattedResults() {
15 | return formattedResults;
16 | }
17 |
18 | public boolean isValid() {
19 | return valid;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/EncryptedFileEnd.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class EncryptedFileEnd implements java.io.Serializable, IEncryptedMessage {
4 |
5 | private byte[] serializedEncryptedFileEnd;
6 |
7 | @Override
8 | public void storeEncryptedMessage(byte[] message) {
9 | this.serializedEncryptedFileEnd = message;
10 | }
11 |
12 | @Override
13 | public byte[] getEncryptedMessage() {
14 | return this.serializedEncryptedFileEnd;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/EncryptedRegistrationResponseState.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 | public class EncryptedRegistrationResponseState implements java.io.Serializable, IEncryptedAuth {
4 | private byte[] encryptedState;
5 |
6 | @Override
7 | public void storeEncryptedData(byte[] encryptedData) {
8 | this.encryptedState = encryptedData;
9 | }
10 |
11 | @Override
12 | public byte[] getEncryptedData() {
13 | return this.encryptedState;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/LoginResponseState.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 |
4 | public class LoginResponseState implements java.io.Serializable {
5 | //Sent to the client by the server, to tell the client the current authentication state.
6 |
7 | private boolean validLogin;
8 |
9 | public LoginResponseState(boolean validLogin) {
10 | this.validLogin = validLogin;
11 | }
12 |
13 | public boolean isValidLogin() {
14 | return validLogin;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/EncryptedFileSpan.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class EncryptedFileSpan implements java.io.Serializable, IEncryptedMessage {
4 |
5 | private byte[] serializedEncryptedFileSpan;
6 |
7 | @Override
8 | public void storeEncryptedMessage(byte[] message) {
9 | this.serializedEncryptedFileSpan = message;
10 | }
11 |
12 | @Override
13 | public byte[] getEncryptedMessage() {
14 | return this.serializedEncryptedFileSpan;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/shared/Contact.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.shared;
2 |
3 | import java.util.LinkedList;
4 |
5 | public class Contact {
6 |
7 | private String username;
8 | private LinkedList messages;
9 |
10 | public Contact(String username, LinkedList messages) {
11 | this.username = username;
12 | this.messages = messages;
13 | }
14 |
15 | public String getUsername() {
16 | return username;
17 | }
18 |
19 | public LinkedList getMessages() {
20 | return messages;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/EncryptedFileInitiation.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class EncryptedFileInitiation implements java.io.Serializable, IEncryptedMessage {
4 |
5 | private byte[] serializedEncryptedFileInitiation;
6 |
7 | @Override
8 | public void storeEncryptedMessage(byte[] message) {
9 | this.serializedEncryptedFileInitiation = message;
10 | }
11 |
12 | @Override
13 | public byte[] getEncryptedMessage() {
14 | return serializedEncryptedFileInitiation;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/EncryptedUser.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 | public class EncryptedUser implements java.io.Serializable, IEncryptedAuth {
4 | //Stored encrypted User class
5 |
6 | private byte[] encryptedSerializedUser;
7 |
8 | @Override
9 | public void storeEncryptedData(byte[] encryptedData) {
10 | this.encryptedSerializedUser = encryptedData;
11 | }
12 |
13 | @Override
14 | public byte[] getEncryptedData() {
15 | return this.encryptedSerializedUser;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/EncryptedLoginResponseState.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 | public class EncryptedLoginResponseState implements java.io.Serializable, IEncryptedAuth {
4 | //Holds the login State for transport
5 |
6 | private byte[] encryptedState;
7 |
8 | @Override
9 | public void storeEncryptedData(byte[] encryptedData) {
10 | this.encryptedState = encryptedData;
11 | }
12 |
13 | @Override
14 | public byte[] getEncryptedData() {
15 | return encryptedState;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.idea/libraries/net_i2p_client_streaming_0_9_35.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/User.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 |
4 | public class User implements java.io.Serializable {
5 | //Used by the server to keep track of sessions.
6 |
7 | private boolean loggedIn;
8 | private String username;
9 |
10 | public User(boolean loggedIn, String username) {
11 | this.loggedIn = loggedIn;
12 | this.username = username;
13 | }
14 |
15 | public boolean isLoggedIn() {
16 | return loggedIn;
17 | }
18 |
19 | public String getUsername() {
20 | return username;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/EncryptedMMessageObject.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class EncryptedMMessageObject implements java.io.Serializable, IEncryptedMessage {
4 | //Stores encrypted MMessageObject class
5 |
6 | private byte[] encryptedSerializedMMessageObject;
7 |
8 | @Override
9 | public void storeEncryptedMessage(byte[] message) {
10 | this.encryptedSerializedMMessageObject = message;
11 | }
12 |
13 | @Override
14 | public byte[] getEncryptedMessage() {
15 | return this.encryptedSerializedMMessageObject;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/EncryptedClientPreKeyBundle.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 | public class EncryptedClientPreKeyBundle implements java.io.Serializable, IEncryptedAuth {
4 | //stores an encrypted client pre key bundle for transport
5 |
6 | private byte[] encryptedSerializedClientPreKeyBundle;
7 |
8 | @Override
9 | public void storeEncryptedData(byte[] encryptedData) {
10 | this.encryptedSerializedClientPreKeyBundle = encryptedData;
11 | }
12 |
13 | @Override
14 | public byte[] getEncryptedData() {
15 | return this.encryptedSerializedClientPreKeyBundle;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/FileEnd.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class FileEnd implements java.io.Serializable {
4 |
5 | private String destinationBase64Username;
6 | private byte[] encryptedFileBuffer;
7 |
8 | public FileEnd(String destinationBase64Username, byte[] encryptedFileBuffer) {
9 | this.destinationBase64Username = destinationBase64Username;
10 | this.encryptedFileBuffer = encryptedFileBuffer;
11 | }
12 |
13 | public String getDestinationBase64Username() {
14 | return destinationBase64Username;
15 | }
16 |
17 | public byte[] getEncryptedFileBuffer() {
18 | return encryptedFileBuffer;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/FileSpan.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class FileSpan implements java.io.Serializable {
4 |
5 | private String destinationBase64Username;
6 | private byte[] encryptedFileBuffer;
7 |
8 | public FileSpan(String destinationBase64Username, byte[] encryptedFileBuffer) {
9 | this.destinationBase64Username = destinationBase64Username;
10 | this.encryptedFileBuffer = encryptedFileBuffer;
11 | }
12 |
13 | public String getDestinationBase64Username() {
14 | return destinationBase64Username;
15 | }
16 |
17 | public byte[] getEncryptedFileBuffer() {
18 | return encryptedFileBuffer;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/MaladaN-Messenger-Client.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/SignalEncryptedPasswordSend.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 | public class SignalEncryptedPasswordSend implements java.io.Serializable {
4 | //Used to send the password for a new account, after it has been created using ServerInit.
5 | //Password comes in encrypted using the signal protocol.
6 |
7 | private byte[] serializedPassword;
8 | private String username;
9 |
10 | public SignalEncryptedPasswordSend(byte[] serializedPassword, String username) {
11 | this.serializedPassword = serializedPassword;
12 | this.username = username;
13 | }
14 |
15 | public byte[] getSerializedPassword() {
16 | return serializedPassword;
17 | }
18 |
19 | public String getUsername() {
20 | return username;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/shared/MessengerConversation.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.shared;
2 |
3 | public class MessengerConversation {
4 | private String contactName;
5 | private String contactPhotoPath = "./MainInterfaceIcon.png";
6 |
7 | public MessengerConversation(String contactName, String contactPhotoPath) {
8 | this.contactName = contactName;
9 | this.contactPhotoPath = contactPhotoPath;
10 | }
11 |
12 | public String getContactName() {
13 | return contactName;
14 | }
15 |
16 | public void setContactName(String contactName) {
17 | this.contactName = contactName;
18 | }
19 |
20 | public String getContactPhotoPath() {
21 | return contactPhotoPath;
22 | }
23 |
24 | public void setContactPhotoPath(String contactPhotoPath) {
25 | this.contactPhotoPath = contactPhotoPath;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/MMessageObject.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class MMessageObject implements java.io.Serializable {
4 | private byte[] serializedMessageObject;
5 | private String destinationUser;
6 | private String sendingUser;
7 |
8 | public MMessageObject(byte[] serializedMessageObject, String destinationUser, String sendingUser) {
9 | this.serializedMessageObject = serializedMessageObject;
10 | this.destinationUser = destinationUser;
11 | this.sendingUser = sendingUser;
12 | }
13 |
14 | public byte[] getSerializedMessageObject() {
15 | return serializedMessageObject;
16 | }
17 |
18 | public String getDestinationUser() {
19 | return destinationUser;
20 | }
21 |
22 | public String getSendingUser() {
23 | return sendingUser;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/net/MaladaN/Tor/thoughtcrime/PreKeyPublic.java:
--------------------------------------------------------------------------------
1 | package net.MaladaN.Tor.thoughtcrime;
2 |
3 |
4 | import org.whispersystems.libsignal.ecc.Curve;
5 | import org.whispersystems.libsignal.ecc.ECPublicKey;
6 |
7 | public class PreKeyPublic implements java.io.Serializable {
8 | private byte[] preKeyPublic;
9 | private int prekeyId;
10 |
11 | public PreKeyPublic(ECPublicKey preKeyPublic, int prekeyId) {
12 | this.preKeyPublic = preKeyPublic.serialize();
13 | this.prekeyId = prekeyId;
14 | }
15 |
16 | public ECPublicKey getPreKeyPublic() {
17 | ECPublicKey publicKey = null;
18 | try {
19 | publicKey = Curve.decodePoint(preKeyPublic, 0);
20 | } catch (Exception e) {
21 | e.printStackTrace();
22 | }
23 | return publicKey;
24 | }
25 |
26 | public int getPrekeyId() {
27 | return prekeyId;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Authentication/ServerLogin.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Authentication;
2 |
3 |
4 | public class ServerLogin implements java.io.Serializable {
5 | //Used by the client to login to the server
6 |
7 | private String username;
8 | private byte[] serializedIdentityKey;
9 | private byte[] encryptedPassword;
10 |
11 | public ServerLogin(String encodedHashedUsername, byte[] encryptedPassword, byte[] serializedIdentityKey) {
12 | username = encodedHashedUsername;
13 | this.encryptedPassword = encryptedPassword;
14 | this.serializedIdentityKey = serializedIdentityKey;
15 | }
16 |
17 | public String getUsername() {
18 | return username;
19 | }
20 |
21 | public byte[] getEncryptedPassword() {
22 | return encryptedPassword;
23 | }
24 |
25 | public byte[] getSerializedIdentityKey() {
26 | return serializedIdentityKey;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/net/MaladaN/Tor/thoughtcrime/InitData.java:
--------------------------------------------------------------------------------
1 | package net.MaladaN.Tor.thoughtcrime;
2 |
3 | import org.whispersystems.libsignal.state.PreKeyRecord;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 |
9 | public class InitData {
10 | private int signedPreKeyId;
11 | private List preKeyRecords;
12 |
13 | public InitData(int signedPreKeyId, List preKeyRecords) {
14 | saveData(signedPreKeyId, preKeyRecords);
15 | }
16 |
17 | public void saveData(int signedPreKeyId, List preKeyRecords) {
18 | if (signedPreKeyId != 0 && preKeyRecords != null) {
19 | this.signedPreKeyId = signedPreKeyId;
20 | this.preKeyRecords = preKeyRecords;
21 | }
22 | }
23 |
24 | public List getPreKeyRecords() {
25 | List records = new ArrayList<>();
26 | records.addAll(this.preKeyRecords);
27 | return records;
28 | }
29 |
30 | public int getSignedPreKeyId() {
31 | return this.signedPreKeyId;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/.idea/libraries/org_whispersystems_signal_protocol_java_2_6_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/serializables/Messaging/FileInitiation.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.serializables.Messaging;
2 |
3 | public class FileInitiation implements java.io.Serializable {
4 |
5 | private long fileLengthInBytes;
6 | private String base64Username;
7 | private String destinationBase64Username;
8 |
9 | private byte[] encryptedInitialFileBuffer;
10 |
11 | public FileInitiation(long fileLengthInBytes, String base64Username, String destinationBase64Username, byte[] encryptedInitialFileBuffer) {
12 | this.fileLengthInBytes = fileLengthInBytes;
13 | this.base64Username = base64Username;
14 | this.destinationBase64Username = destinationBase64Username;
15 | this.encryptedInitialFileBuffer = encryptedInitialFileBuffer;
16 | }
17 |
18 | public long getFileLengthInBytes() {
19 | return fileLengthInBytes;
20 | }
21 |
22 | public String getBase64Username() {
23 | return base64Username;
24 | }
25 |
26 | public String getDestinationBase64Username() {
27 | return destinationBase64Username;
28 | }
29 |
30 | public byte[] getEncryptedInitialFileBuffer() {
31 | return encryptedInitialFileBuffer;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MaladaN-Messenger
2 | An end to end encrypted Messenger that uses the signal protocol over the I2P network
3 |
4 | Development IDE: Intellij IDEA
5 |
6 | # Required Libraries:
7 | com.h2database:h2:1.4.197
8 |
9 | net.i2p.client:streaming:0.9.35
10 |
11 | net.i2p:i2p:0.9.35
12 |
13 | org.whispersystems:signal-protocol-java:2.6.2
14 |
15 | # Legal things
16 | Cryptography Notice
17 |
18 | 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.
19 |
20 | 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.
21 |
--------------------------------------------------------------------------------
/src/net/MaladaN/Tor/thoughtcrime/ServerResponsePreKeyBundle.java:
--------------------------------------------------------------------------------
1 | package net.MaladaN.Tor.thoughtcrime;
2 |
3 | import org.whispersystems.libsignal.IdentityKey;
4 | import org.whispersystems.libsignal.ecc.Curve;
5 | import org.whispersystems.libsignal.state.PreKeyBundle;
6 |
7 | public class ServerResponsePreKeyBundle implements java.io.Serializable {
8 | //got this.
9 | private int registrationId;
10 | private PreKeyPublic preKey = null;
11 | private int signedPreKeyId;
12 | private byte[] signedPreKeyPublic;
13 | private byte[] signedPreKeySignature;
14 | private byte[] identityKey;
15 |
16 | //deviceId not present, only one device.
17 |
18 | public ServerResponsePreKeyBundle(int registrationId, PreKeyPublic preKey, int signedPreKeyId, byte[] signedPreKeyPublic, byte[] signedPreKeySignature, byte[] identityKey) {
19 | this.registrationId = registrationId;
20 | this.preKey = preKey;
21 | this.signedPreKeyId = signedPreKeyId;
22 | this.signedPreKeyPublic = signedPreKeyPublic;
23 | this.signedPreKeySignature = signedPreKeySignature;
24 | this.identityKey = identityKey;
25 | }
26 |
27 | public PreKeyBundle getPreKeyBundle() {
28 | try {
29 | return new PreKeyBundle(registrationId, 0, preKey.getPrekeyId(), preKey.getPreKeyPublic(), this.signedPreKeyId, Curve.decodePoint(this.signedPreKeyPublic, 0), this.signedPreKeySignature, new IdentityKey(identityKey, 0));
30 | } catch (Exception e) {
31 | e.printStackTrace();
32 | return null;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/cli/MessageHandlerThread.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.cli;
2 |
3 |
4 | import net.MaladaN.Tor.thoughtcrime.SignalCrypto;
5 | import net.strangled.maladan.serializables.Messaging.MMessageObject;
6 | import net.strangled.maladan.shared.IncomingMessageThread;
7 | import org.whispersystems.libsignal.SignalProtocolAddress;
8 |
9 | import java.util.List;
10 |
11 | public class MessageHandlerThread implements Runnable {
12 |
13 | private boolean running = true;
14 | private Thread t;
15 |
16 | @Override
17 | public void run() {
18 | while (running) {
19 | List objects;
20 |
21 | try {
22 | Thread.sleep(600);
23 | } catch (Exception e) {
24 | e.printStackTrace();
25 | }
26 |
27 | objects = IncomingMessageThread.getIncomingMessages();
28 |
29 | if (!objects.isEmpty()) {
30 |
31 | for (MMessageObject object : objects) {
32 | byte[] encryptedMessage = object.getSerializedMessageObject();
33 | String decryptedMessage = SignalCrypto.decryptStringMessage(encryptedMessage, new SignalProtocolAddress(object.getSendingUser(), 0));
34 | System.out.println(decryptedMessage);
35 | }
36 |
37 | IncomingMessageThread.deleteMessageObjects(objects);
38 | }
39 |
40 | }
41 | }
42 |
43 | void shutdown() {
44 | running = false;
45 | }
46 |
47 | void start() {
48 | if (t == null) {
49 | t = new Thread(this);
50 | t.start();
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/net/strangled/maladan/shared/OutgoingMessageThread.java:
--------------------------------------------------------------------------------
1 | package net.strangled.maladan.shared;
2 |
3 |
4 | import java.io.ObjectOutputStream;
5 | import java.io.OutputStream;
6 | import java.util.LinkedList;
7 | import java.util.Vector;
8 |
9 | public class OutgoingMessageThread implements Runnable {
10 |
11 | public static boolean running = true;
12 | private static Vector