0
$\begingroup$

I have just turned 17 and I have been developing in Java for a few years. Recently I have been interested in a language called rust, I have also been made aware of privacy issues by some of my friends. Mainly in order to learn rust but also to learn more about cryptography I decided to start creating an encrypted communication application (which I may never use but I would still like to do something more or less secure). The idea of the application is that you can have a (written) conversation with a friend, stored on a server... and that even if the server is hacked it is impossible (at least not too easy) to decipher the conversation.

Here is how I thought I would make the application work:

Thomas wants to send a message to Emma. Using an algorithm (which works with a couple of public/private keys), they'll generate a shared secret so that the server cannot know it. Thomas will cipher his message using the secret in a symmetric algorithm and send it to the server. The server stores all the messages. When Emma wants to read the messages, she downloads these ciphered messages and decipher them using the secret.

Now let's say Peter wants to join the conversation, he also has public/private keys. Thomas or Emma will send him (over the server) the secret ciphered using his public key. Now that he has the secret he can download and read the messages.

If I haven't been clear somewhere, don't hesitate to point it out to me. I would like the encryption algorithms to be modular: depending on the configuration of the conversation, messages could be encrypted with AES or ChaCha20, but by default I would use Curve25519 for the elliptic curve Diffie–Hellman in order to generate the shared secret and ChaCha20 to encrypt messages. Do you think that's wise? Is there any alternative to the elliptic curve Diffie–Hellman which could resist to potential quantum computers?

$\endgroup$
  • $\begingroup$ NTRU is quantum secure, but hasn't really had much crypto-analysis performed on it. However, I'm not sure whether NTRU has a shared secret KEX protocol or not. However it does support KEM, so that could work for distributing symmetric keys $\endgroup$ – SamG101 Nov 24 '19 at 9:35
  • 2
    $\begingroup$ This is rather a broad question, basically asking us to validate your design for a chat application. If this is your first application I would certainly try and make it work for a specific design and a specific set of algorithms. You can always decide to upgrade / change. That way you can get some practice in rather than trying to create the perfect protocol from scratch. $\endgroup$ – Maarten Bodewes Nov 24 '19 at 10:40
  • 1
    $\begingroup$ You have set yourself a huge goal, which you might not have realized yet. But it surely is a nice project. Above all, you should write your design in a modular way, to be able to change specific parts in the future. For example: You have thought of end-to-end encryption. And you have thought of group convetsations. But you have not thought of the scenario if someone leaves (or is removed from) a conversation. So later you might want to be able to change keys, and the clients require a proper key management of their stores keys. $\endgroup$ – tylo Nov 24 '19 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.