# Exploiting Online Services to Enable Anonymous and Confidential Messaging
## 4 Implementing the Proposed Messaging Service  
The proposed messaging service should enable end-to-end, anonymous, confidential, and covert message exchange between users. End-to-end means messages are encrypted at the sender and only decrypted at the destination. Anonymous means only the users that are exchanging messages know their identity. Confidential refers to exchanged messages being encrypted end-to-end. Covert means the exchange of messages remains hidden. Therefore, the solution should not require dedicated servers and should use existing online services while disguising its use. Moreover, in order to better promote user anonymity, the proposed experiment should only use online services that do not require user authentication. Multiple online services were analysed in order to verify their adequacy for the identified requirements. Our search for an adequate online image-sharing website led to the selection of Imgur because it maintains image format (except for the case of images with resolutions above 1920 \(\times\) 1080 pixels), but mainly because it also allows images to be uploaded anonymously. As an alternative channel to exchange image URLs, the DontPad online service was selected since it was the only one found that did not require JavaScript, and because it allows anonymous use. JavaScript was considered a potential avenue for user identification, motivating its dismissal. When two users want to exchange messages, the proposed messaging service requires that they first exchange a channel identifier and agree on a password and salt to use with a Key Derivation Function (KDF) [36, 37] to create a channel key (\(C_{i}\)) shared by all users in the channel. A secure procedure to exchange the identifier, key, and salt is assumed. This exchange can also occur offline, preferably in person for the sake of online anonymity. These values are generated per conversation using a secure random number generator. The proposed solution adopts the Universally Unique Identifier (UUID) format for the channel identifier. The URL used to store the links to the images with hidden information is obtained by concatenating the generated UUID with the text-sharing service URL. For instance, assuming Channel 1 has the UUID\({}_{1}\), then the group's shared online folder in DontPad will be available at: [[http://dontpad.com/UUID](http://dontpad.com/UUID)]([http://dontpad.com/UUID](http://dontpad.com/UUID))\({}_{1}\). This would then be used to pass the image's URL, with the URL being deleted as soon as the receiver reads the secret message. Afterwards, users can exchange messages. A sequence diagram is depicted in Figure 3. The sender starts by securely deriving a channel key (\(C_{i}\)) from the password and the salt (Step 1). In Step 2, an initialization vector \(IV_{i}\) is generated with a secure random generator. Afterwards, in Step 3, the key \(C_{i}\) and the \(IV_{i}\) are used to encrypt the plaintext message using symmetric encryption (e.g., AES), generating the ciphertext \(E_{i}\). In Step 4, the sender generates a Hash-Based Message Authentication Code (HMAC) [38, 39, 40, 41]\(H_{i}\) from the ciphertext \(E_{i}\) and \(IV_{i}\). The ciphertext \(E_{i}\), HMAC \(H_{i}\), and a nonce are encrypted with the key \(C_{i}\) and then concatenated with \(IV_{i}\) in Step 5--these data shall be referred to as \(M_{i}\). In Step 6, the secret data \(M_{i}\) is hidden through steganography, being embedded into an image file \(F_{i}\), which has had its EXIF data scrubbed clean, resulting in the stego-image \(SF_{i}\). The sender then, anonymously, uploads \(SF_{i}\) to the image-hosting service (Step 7), obtains its URL (Step 8), and writes the URL to a folder on the text-hosting service (step 9). Next, the receiver can read the shared folder on the text-hosting service, obtain the new URL (Step 10), and proceed to download \(SF_{i}\) (Step 11). Then, he/she extracts the embedded data \(M_{i}\) (Step 12) to retrieve \(IV_{i}\) and the encrypted \(E_{i}\) and \(H_{i}\) (Step 13).