Discuss Crypto scheme in the Security and Cryptography forum on Dev Shed. Crypto scheme Security and Cryptography forum discussing issues related to coding, server applications, network protection, data protection, firewalls, ciphers and the like.
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.
Posts: 4
Time spent in forums: 28 m
Reputation Power: 0
Crypto Protocol Question - Crypto scheme
Hello
I am developing a live chat where all messages between users should be encrypted, saved on server database, but the server should not be able to decrypt the messages. If I use a public/private key system (with private key for decryption, computed client-side, based on user password, and public key, for message encryption, saved on server database), then everything is ok until the moment when an user changes his password. Then he will have another key (computed upon his new password), therefore he will be unable to decrypt his message archive.
Can you suggest me a cryptographic scheme that will work in my scenario?
Posts: 4
Time spent in forums: 28 m
Reputation Power: 0
This will be a two-person chat only. And only those two persons are allowed to view their messages (the server is not allowed to, all messages should arrive encrypted at the server; also all messages are saved encrypted in the database).
I want to find a solution to generate the keys for every person, and also to be able to read message archive if someone finds one`s key and he needs to change it (the archive will still be in the database, but encrypted with the old key)
Posts: 4
Time spent in forums: 28 m
Reputation Power: 0
The problem is that the server should not be allowed to decrypt the messages. The server receives encrypted message from one client, saves it in database and then sends it to othe client as it is.
Posts: 637
Time spent in forums: 2 Weeks 6 Days 10 h 10 m 13 sec
Reputation Power: 825
PKI & certificates might work for you: Each user generates a public/private key pair and obtains a public key certificate from a mutually trusted third party. They exchange certificates via the server, verify them, and then use these keys to encrypt & sign their messages.
You're going to need a trusted third party or a secure alternate communications path somewhere if you can't trust your server.
Of course, not trusting the server makes it kind of pointless in your case. An attacker that compromises it could simply replace the javascript code sent to the clients with his own code that saves a copy of the clear text.
Posts: 6,459
Time spent in forums: 1 Month 2 Weeks 4 Days 3 h 8 m 59 sec
Reputation Power: 6144
Quote:
Of course, not trusting the server makes it kind of pointless in your case. An attacker that compromises it could simply replace the javascript code sent to the clients with his own code that saves a copy of the clear text.
Quoted for emphasis because this is an exceedingly important and true point.
However, that weakness with your implementation aside, the particular security question you pose is not an uncommon one and has standard solutions.
One such solution is to generate the public and private key for each user entirely randomly and store both on the server. The public key in its plaintext form and the private key in an encrypted form. The private key is encrypted and decrypted client-side using a symmetric cipher, such as AES, with a key derived from the user's password.
In this situation, a password change is simple: retrieve the encrypted private key from the server, decrypt it using the symmetric key derived from the old password, encrypt it using the symmetric key derived from the new password, then send it back to the server for storage.
But as OmegaZero stated, not trusting the server is not an option if you use JavaScript.