I'm developing a journal web app and am trying to tackle what I foresee as the biggest problem - trusting me not to read other people's entries. The solution I have so far is:
- User gives a secret key each time they login. It is not stored with their user data and is only kept for the lifetime of the session.
- Each entry the user writes is encrypted using this key. Similarly when they try to open an entry the entry will be decrypted using this key.
- If an incorrect key is entered the entries given will be returned as jibberish, however this will allow the user to store entries with different keys if they wish to do so.
While the trust is then on me to not record the keys (I hope to distribute a single-user version later on which will feature the same code) I can't help thinking there is either a more common way to do this or to a flaw in this thinking somewhere (I am not very knowledgeable on security or encryption other some probably flaky understanding of md5/sha1/blowfish). Is this the best way to go about this?