Android App that allows you to encrypt text messages with the one-time pad encryption technique
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
parappnoid-logo.png
settings.gradle

README.md

Parappnoid

Android App that allows you to encrypt text messages with the one-time pad encryption technique and exchange them through various third party messaging services, such as WhatsApp, Facebook, SMS etc. In addition to the encryption and decryption of the messages, Parappnoid handles the generation, storage and exchange of the one-time pad keys.

Aims

  • Unconditional security for the plaintext.
  • Integrity and autenticity of the ciphertext and the PadID.

Encryption Algortithm

key = (Kp || Km)
ciphertext = (plaintext XOR Kp)
message = (PadID || ciphertext || H(Km || PadID || ciphertext))

Where:
|| = concatenation
key = one time pad key.
Kp = portion of one-time pad key, used for the plaintext encryption.
Km = portion of one-time pad key, used for the MAC calculation.
ciphertext = plaintext encrypted with Kp.
plaintext = the plaintext message to be sent.
PadID = random number that identifies the used key.
H = SHA-256 function, used for the MAC calculation.
message = the output, encoded in HEX format.

One-time pad requirements

(with proposed solutions)
  • The one-time pad keys must be random
    • Maybe the most difficult requirement. The one-time pad keys can be generated in 2 different ways:
      • Reading from an external file (generated by the user with an external TRNG)
      • With the integrated CSPRNG SecureRandom (the unconditional security is not guaranteed)
  • The keys must be as long as the plaintext
    • It may sound like a complicated requirement, but the mobile devices storage is increasing every year, so it could not be a real problem.
  • The keys must be exchanged via a secure channel
    • Parappnoid implements android-qr-data-transfer, a library that uses sequences of QR codes and WiFi-Direct to provide a secure data transmission channel.
  • Keys should be kept in a safe place
    • Parappnoid implements SQLCipher, an external library that encrypts the local database with a AES 256-bit key.
  • The keys can be used only once
    • To preserve the re-use of keys, each of these is erased in an irreversible manner after use
  • Authentication
    • One-time pad doesn't provide message authentication. Parappnoid uses SHA-256 with a one-time key (Km) to provide a MAC.

Known vulnerabilities

  • Mallory can brute force Km, than recreate the message so Bob can't detect the forgery. This attack costs O(2^256), because Km is 32-bytes long.

Dependencies

Parappnoid depends on the following external libraries:

Credits

License

Parappnoid is made available under the terms of the GPLv3.
See the LICENSE file that accompanies this distribution for the full text of the license.
The Android support libraries are licensed under Apache 2.0.
SQLCipher is licensed under a BSD-style license from Zetetic LLC.
Apache Commons Codec and android-qr-data-transfer are licensed under Apache 2.0.