tags:

views:

51

answers:

4

Iam not sure if this is the right place but lets see.

Iam developing an system to send private messages from one user to an other use. Under the hood runs PHP 5.2.x .

Now iam looking for any way to crypt private messages in a way that i cant access them. In the moment i have no idea how to realize such a system, where iam not knowing the encryption key.

My first idea was to combine it with something like OAuth.

Some more requirements to clarify the problem:

  • Public Webpage
  • good usability
+3  A: 

what about RSA and other public-key cryptography? http://en.wikipedia.org/wiki/Public-key_cryptography

Andrey
Note, this is not something you should implement yourself. Try PGP
nont
@nont agree. there are good and free implementations.
Andrey
A: 

How about you just don't store the key?

nont
And how does the user encrypts an "mail" without an key? If he sends the key with an post requests than iam able to capture it.
ArneRie
well, you could encrypt the message and then throw away the key. when he wants to decrypt he needs to enter it again. Of course, if you don't want the possibility of even seeing the key, then the Andrey's suggestion is good, you need public key cryptography.
nont
+1  A: 

You could use the Diffie-Hellman protocol to generate encryption keys that are only known to the users.

But as a user, you have to have access to those keys in order to read your messages. So you'd have to find a way to store the key at the client instead of your server, otherwise you'd still be able to decrypt the messages. This would be quite a challenge for a PHP site, so I doubt it can be accomplished.

Niels van der Rest
+3  A: 

it will never work if you're doing the decryption on your server. You need to do the decryption completely on client side with javascript.

Ideas for looking for information on javascript crypto engines:

If your users all use modern browsers with support for client side database storegae, you can use this to store the keys: an example


you should know, that it would be not very secure if you want the de-/en-cryption to be fast, or it will be really slow, because javascript is not the best language to do crypto stuff.

jigfox
Nice one thanks, but than one user needs to send the key to the other user or?
ArneRie
if you use RSA, the public key can be stored on the server. You only need the public key to encrypt the message. But it can't be decrypted with the public key, for that you need the private key, and that can be stored somewhere on the client side
jigfox