I have an idea for a web app that I'd like to discuss. I like it a lot but chances are that I missed some evident security hole. Or, maybe it just sucks.

The idea is a web-based secure text notes manager, with the following features:

  • because it's web, it can be accessed from anywhere;
  • importing/exporting encrypted notes;
  • the only thing stored on server are encrypted notes (no user accounts! more below);
  • local version (use on your own server);
  • password is never stored anywhere (not as a hash or anything).

Here is how it works:

The server keeps a database of notes, where each note has:

  • author's email;
  • encrypted content;
  • metadata (modified time, etc).

When a user opens the web app for the first time, it asks for email.

(Oops, new users aren't allowed to post images! Please follow this link for a screenshot: dl.dropbox.com/u/456669/Screenshots/3EqQx.png )

If this email has not been used on this device before, a message with validation link is sent. (Link, of course, expires very soon).


After validation, the device+email combination is saved into a cookie. Encrypted notes are loaded from server.

After that, all job is done with Javascript, no server interaction.

The app asks for password.


Notes are decrypted with password. Then, there goes the actual user interface for managing notes (it will be super nice, but that's not the topic of the discussion).

When saving changes for a note, it's encrypted with entered password (which is stored in Javascript variable, or in paranoid mode, asked again). The encrypted note is synced with server.

Why I like the idea

I get access to my secure notes from anywhere (home, work, guests, travel).

I can be sure no one can access my notes. If someone enters my email, I receive a validation email, which I decline.

If my email is hacked, and a hacker accesses my notes, he still needs password to decrypt them.

Password is only used to decrypt notes. In other words, wrong password simply means messy notes on screen.

Open source means I can install it on my home server, and do not trust a 3rd-party service.

Not perfect

While I was writing that, a problem occured to me. Because the app cannot check if a password is correct (that's the idea!), there needs to be some way to prevent user from entering wrong password, getting "messy" notes, and then saving them on server. Hmm!...

Anyway, thanks for reading, and thanks in advance for your thoughts and feedback!

  • This is very long and very broad. As a site, we're much more suited to individually answering individual questions. This has too many piled into one place to be a good source of reference. – Jeff Ferland Jan 15 '13 at 1:14

I can see a few flaws in the system you described:

  • If an existing user wants to access his notes, would he need to access his email account and click on a link for every visit?
    1. If yes, how would you link his click to a valid user session?
    2. If no, then anyone could download the encrypted notes for a known email and try to decrypt them offline.
  • Implementing the encryption algorithm in JavaScript is not the best solution. A simple XSS on your system could reveal the user's password in plaintext.
  • An user could use a password for every note. How could he remember which password was used for which note?
  • Assuming that you somehow force him in using the same password every time, how would you handle password changes, where you should decrypt and encrypt every note, also using javascript.

It is pretty hard implement a new solution that is user friendly, can be used on various devices and is also very secure.

Keep in mind that existing, well known algorithms and practices are probably the best choice at the moment. Custom solutions are very likely to be flawed. Maybe if you give more details about how you would handle the points stated above, we could have a better view of the solution and could analyze it better.

  • Thanks! I am curious if you have been using anything for secure notes, and can recommend it. – Vlad Gerasimov Jan 15 '13 at 2:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.