This has been done many times before, and all rely on a trusted 3rd party to do what they say. I spent a few years on and off toying with this idea, and came up with a solution that does not need any 3rd party middleman to transmit keys or delete messages after a period of time. If you want a real challenge, figure out how to do that.
Show HN: Send secure, self destructing messages
21–30 of 37 posts
Re: Show HN: Send secure, self destructing messages
#22* You're using a table of very small primes to generate the RSA modulus.
* Real cryptosystems very rarely ever encrypt directly with RSA, and it's dangerous to do so. RSA is used to wrap a symmetric key, or to sign messages during key agreement.
* Given that the raw plaintext of these secret messages is running through the server anyways, you might as well get rid of the RSA and just use SQL "DELETE FROM" as your safeguard.
I understand why one would write an app like this: because it's fun. And that's fine! Just cast it as a game, not as a tool for people in oppressive countries who could be tortured for using something like this.
Re: Show HN: Send secure, self destructing messages
#23This reference installation of the site doesn't use SSL/TLS, and sends the supposedly "secret" message in the clear over the wire to your server. The decryption key is also transmitted in this manner. As someone else mentioned, the decryption key has almost no entropy at all. Any upstream provider (your internet cafe, ISP, FBI, etc.) or the site operator (OP) can read your "secure" message with almost no effort. This…
SSL is something to consider for the future, as is increasing the entropy. I removed the 'military grade' as that might be stretching the claim a bit. Thanks for your feedback!
Re: Show HN: Send secure, self destructing messages
#24Sorry to play the paranoiac, but that is the demographic you're trying to appeal to! There seems to be a key element of trust required for using this site. How do we know the code cycret.com runs is the same as what's on Github? i.e. How do we know cycret isn't actually running different code that serves as a man-in-the-middle by creating RSA encrypted channels to both the sender and receiver, but archiving plain-tex…
Re: Show HN: Send secure, self destructing messages
#25This has been done many times before, and all rely on a trusted 3rd party to do what they say. I spent a few years on and off toying with this idea, and came up with a solution that does not need any 3rd party middleman to transmit keys or delete messages after a period of time. If you want a real challenge, figure out how to do that.
Yes, you're absolutely right that this has been done many times before. The goal was more in lines of a learning experience for myself than to create something unique. You have captured my attention, though, can you give me a hint into the right direction on how to avoid the 3rd party?
I was aiming for the most secure implementation, assuming someone had control over many pieces of the puzzle/network.
Re: Show HN: Send secure, self destructing messages
#26* mt_rand() isn't a CSPRNG and you can't use it to generate crypto parameters. * You're using a table of very small primes to generate the RSA modulus. * Real cryptosystems very rarely ever encrypt directly with RSA, and it's dangerous to do so. RSA is used to wrap a symmetric key, or to sign messages during key agreement. * Given that the raw plaintext of these secret messages is running through the server anyways,…
- A better way to create better random numbers (a static noise sniffing Arduino comes to mind)
- Incorporating http://primes.utm.edu/lists/small/1000.txt instead of the current primes
- SSL
Any hints on a good way to encrypt the message itself instead of RSA?
And yes, it was created just for fun and as a learning experience for myself. I agree that it does look too serious for what it really is, will definitely change that.
On a side note, I'm genuinely honored and humbled that you took the time to look at my project and provide feedback! Matasano is absolutely killing it in the security field!
EDIT: First thing tomorrow morning (it's midnight here) I'll restyle the site to make it clear that it's just a game, not something you can bet your life on.
Re: Show HN: Send secure, self destructing messages
#27* mt_rand() isn't a CSPRNG and you can't use it to generate crypto parameters. * You're using a table of very small primes to generate the RSA modulus. * Real cryptosystems very rarely ever encrypt directly with RSA, and it's dangerous to do so. RSA is used to wrap a symmetric key, or to sign messages during key agreement. * Given that the raw plaintext of these secret messages is running through the server anyways,…
So, back to the drawing board for version 2 which will include: - A better way to create better random numbers (a static noise sniffing Arduino comes to mind) - Incorporating http://primes.utm.edu/lists/small/1000.txt instead of the current primes - SSL Any hints on a good way to encrypt the message itself instead of RSA? And yes, it was created just for fun and as a learning experience for myself. I agree that it do…
Don't use a table of primes for p and q. Look at BN_generate_prime_ex() in OpenSSL for a simple sieve algorithm. Your RSA key size is a function of the product of p and q; they should be bignums.
Incorporate an AES library. Generate AES keys by reading 128 bits of random bytes from /dev/urandom. Generate a 64 bit random number the same way, then encrypt the message in CTR mode using that 64 bit number as the nonce; you'll need a new one for every message. After encrypting with AES to generate a ciphertext, run the ciphertext through HMAC-SHA2 and append that hash to the end of the ciphertext. Encrypt the keys & the nonce with RSA and append that to the message. The receiver verifies the HMAC hash before it attempts to decrypt the AES-CTR encrypted message.
This is advice given under the assumption that you're doing this to learn stuff. Again: strongly advise you make a game out of this instead of trying to supply secure messaging to people.
If you wanted to do this for real, read instead:
Re: Show HN: Send secure, self destructing messages
#28* mt_rand() isn't a CSPRNG and you can't use it to generate crypto parameters. * You're using a table of very small primes to generate the RSA modulus. * Real cryptosystems very rarely ever encrypt directly with RSA, and it's dangerous to do so. RSA is used to wrap a symmetric key, or to sign messages during key agreement. * Given that the raw plaintext of these secret messages is running through the server anyways,…
So, back to the drawing board for version 2 which will include: - A better way to create better random numbers (a static noise sniffing Arduino comes to mind) - Incorporating http://primes.utm.edu/lists/small/1000.txt instead of the current primes - SSL Any hints on a good way to encrypt the message itself instead of RSA? And yes, it was created just for fun and as a learning experience for myself. I agree that it do…
Re: Show HN: Send secure, self destructing messages
#29Earlier quoted context omitted.
So, back to the drawing board for version 2 which will include: - A better way to create better random numbers (a static noise sniffing Arduino comes to mind) - Incorporating http://primes.utm.edu/lists/small/1000.txt instead of the current primes - SSL Any hints on a good way to encrypt the message itself instead of RSA? And yes, it was created just for fun and as a learning experience for myself. I agree that it do…
Just read random bytes from /dev/urandom. Smart people have already taken the time to work out how to give your platform fast random number generation. Don't use a table of primes for p and q. Look at BN_generate_prime_ex() in OpenSSL for a simple sieve algorithm. Your RSA key size is a function of the product of p and q; they should be bignums. Incorporate an AES library. Generate AES keys by reading 128 bits of ran…
After that, it seems I've some extensive reading to do...
Re: Show HN: Send secure, self destructing messages
#30Sorry to play the paranoiac, but that is the demographic you're trying to appeal to! There seems to be a key element of trust required for using this site. How do we know the code cycret.com runs is the same as what's on Github? i.e. How do we know cycret isn't actually running different code that serves as a man-in-the-middle by creating RSA encrypted channels to both the sender and receiver, but archiving plain-tex…
Yes, trust is absolutely an issue here. I put the code on GitHub so people can run it themselves. On the other hand, people also trust websites like gmail, their bank accounts and government stuff with their private data, without knowing anything about the encryption/decryption process behind it...