# Operating Manual: OTP Communicator (Version 5.1.0) Security Preface The OTP Communicator is not an ordinary messenger. There is no central server, no cloud backup for forgotten passwords, and no support. This system gives you absolute control over your data back – and with it, full responsibility. Any error in handling the keys or the hardware compromises the entire security. Strictly adhere to the following protocols. ## 1. Hardware Requirements (Air-Gapping) For maximum security, the app must not be installed on your everyday smartphone. * Acquire two retired Android smartphones running Android 8.0 (API 26) or higher. This is mandatory to guarantee a reliable Hardware Keystore implementation (TEE). * Reset both devices to factory settings. * Physically and permanently remove the SIM cards. * Disable Wi-Fi and Bluetooth. Turn on airplane mode. * Absolute Air-Gap: From now on, these two devices serve exclusively as isolated, cryptographic calculating machines. They must never be connected to a network again. * Cloud Blockade: Android Auto-Backups are hard-blocked at the system level (allowBackup="false") to ensure forensic data traces can never leak to cloud services. ## 2. Key Generation and Exchange To ensure the maximum security of the one-time pad, the app fundamentally distrusts the smartphone's hardware. Operating systems use pseudo-random algorithms that are theoretically manipulable. Therefore, key generation strictly requires true physical randomness (TRNG), which must be imported externally. 1. Boot an offline computer with a TAILS live USB stick (Download: https://tails.net/). 2. Insert an empty MicroSD card and open the terminal. 3. Generate the entropy file (move your mouse wildly): # Formula for N keys: count = ceil((32 + N * 380) / 1048576) + 1 # (For 1,000 to 10,000 keys, 'count=5' is the ideal, secure default value) dd if=/dev/random of=/media/amnesia/SD_CARD_NAME/entropy.bin bs=1M count=5 4. Insert the SD card into Device A, start key generation, and select the entropy.bin. The further process: * Random Salt: Each database receives a 16-byte random salt for Argon2 hardening, embedded in the filename. * Double Index: Send and receive keys receive exclusive IDs to prevent metadata leaks during message exchange. * Import on Device A: After generation, two database files (Device A and Device B) are stored in the app-specific directory on the SD card (Android/data/com.example.otp_kommunikator/files/). You must first import the file intended for Device A. You will assign a pseudonym (e.g., "Alice"). * Chip-Off Protection (In-Place Verification): To prevent wear-leveling artifacts on the internal storage, the database is cryptographically verified directly on the SD card and only copied to the system upon success. The source file on the SD card is deleted from the file system after a successful import. Since software deletion commands on flash memory do not offer secure chip-off protection due to wear-leveling, the SD card must ultimately be physically destroyed. * Handover to Device B: Only then remove the SD card and insert it into Device B. Import the remaining file for Device B under the same or a different pseudonym. * OPSEC WARNING: The unencrypted master key (entropy.bin) still resides on the flash memory. Due to wear-leveling, the SD card MUST be physically destroyed (shredded) after a successful import on both devices. ## 3. Blind Login and Contact Management To obscure the existence of your communication, the app never displays existing contacts upon startup. You will only see a neutral "System Access" screen. * Master Access: Only the correct entry of your Master Password on the blind login screen decrypts the internal index and reveals your real contacts (e.g., "Alice", "Bob"). * Compartmentalization: Each contact is individually encrypted with another specific password. There is no central master password that opens all vaults simultaneously. ## 4. Messages, Transmission, and Padding The app itself does not transmit data. It merely calculates ciphertexts and displays them optically. * Tamper Protection (HMAC): Each encrypted message is signed with an individual HMAC-SHA256. * PKCS#7 Padding: Messages are always padded to a fixed length (150 bytes) according to the cryptographic standard PKCS#7. This hides the actual message length from metadata analysis. * Sparse Keyspace (DoS Protection): Each key is assigned a 16-digit hex index. Incoming codes are mathematically verified for the correct byte length. Clumsy fake codes or random guessing bounce off an address space of 18 quintillion combinations BEFORE the database is even contacted. Your real keys remain protected. * Fail-Secure Transactions (Anti-Replay & Anti-DoS): Upon scanning a code, the OTP key is retrieved within an atomic database transaction. The cryptographic HMAC check is performed strictly inside this locked state. If the seal is manipulated (e.g., forged QR code), the transaction safely rolls back, preserving the key. Only upon 100% valid verification is the key physically destroyed. This definitively prevents both replay attacks and Denial of Service (DoS) key-burning sabotage. * Transmission: Scan the generated QR code from Device A with the camera of Device B. Alternatively, the text can be typed or transmitted via an insecure messenger. The security relies entirely on the ciphertext. ## 5. Passwords and Emergencies (OpSec) The database is encrypted with SQLCipher (AES-256). Without the password, the memory content is forensically worthless. * Hardware Keystore: The app does not store unencrypted configuration files. Password hashes and salts are protected by EncryptedSharedPreferences (AES-256 GCM) in the hardware chip (TEE). Thread locks (Mutex) protect against fast concurrent brute-force attempts. * Safe Password: Use strong passwords. The system uses Argon2 with a cryptographic random salt. Subsequently, an HKDF (HMAC-based Key Derivation Function) ensures strict mathematical separation between the database and authentication keys. * Specific Panic Password: Entering this specific password during the login for "Alice" immediately and irretrievably deletes ONLY the database for "Alice". * Plausible Deniability (Decoy Mode): During the initial setup, you can optionally set a Decoy Password. If forced to unlock the app, enter this password on the blind login screen. It opens a fully functional, isolated fake system. An investigator cannot mathematically prove that a hidden master container still exists. * Global Panic Password (Nuke Switch): This optional password can also be entered directly on the blind login screen. It wipes the entire system (all databases, indices, and the keystore) in milliseconds. * Tabula Rasa (After a Nuke): Unlike previous versions, the app no longer crashes after a global wipe. It silently cleans itself and immediately restarts on the initial setup screen. To an examiner, it appears as if the app was freshly installed and never used. * Brute-Force Protection: After the 5th failed attempt on a contact, its database is automatically deleted. * RAM Hygiene (Zero-Footprint): The application strictly avoids immutable Java strings for sensitive data. Passwords and message plaintexts are captured via native UI bypasses and processed directly as CharArray. All buffers are actively overwritten with zeros after use. If the app goes into the background, decrypted text is immediately cleared from memory. ## 6. Emergency Key Burn If a message is intercepted or lost in transit, the corresponding receiving key remains unused on the target device. To prevent replay attacks or future decryption in the event of device compromise, this "ghost key" must be specifically destroyed. Procedure: The sender notes the Key ID (displayed as a success message when generating the QR code). The sender informs the receiver via an alternative, insecure channel that the message with this specific ID has been compromised. The receiver opens the receive screen and enters the exact ID into the "Targeted Key Destruction" (Gezielte Schlüsselvernichtung) field. Upon confirmation, the key is irrevocably erased from the AES-encrypted database and memory (RAM).