I also created recently a weekend project based on client-side encryption: https://whisperpassword.com , I need to learn about design though ;-)
My weekend project - AES encryption for Gmail or anything else
41–50 of 71 posts
Re: My weekend project - AES encryption for Gmail or anything else
#42Your key derivation function is pretty weak. Looking at your code you are doing SHA256(password entered by user). You should take a look at using http://en.wikipedia.org/wiki/PBKDF2 for the key derivation. SHA256 is really fast and given that you are getting entropy from some user entered password (which is likely to be badly chosen) you want something _slow_ to derive the key. Hence PBKDF2 with lots of iterations.
Thank you point me out. Definitely, I need to implement PBKDF2 (and add salt to password). I planning this, but weekend is too short and finally I just put SHA256 for key derivation. But, until you describe, I do not recognize what the principal difference between hash and password based key derivation function, thanks.
A SHA{1,2,3,128,256,512} hash is very VERY VERY fast. So fast, in fact, that an attacker who has the hash could easily run through all 8 character passwords given a few GPU machine clusters.
PBKDF2 is very much like a SHA hash, but it is repeated over and over. Instead of just salt||SHA1(password||salt) you compute salt||SHA1(SHA1(SHA1(SHA1(SHA1(password||salt))))). This makes it so an attacker with the hash has to do much more work in order to brute force the password.
Now, that's not exactly how it works, but just read the wikipedia article for that.
Re: My weekend project - AES encryption for Gmail or anything else
#43Wouldn't it make more sense to revive FireGPG[1] and, while you're at it, port it to all other major browsers? I am still disappointed that PGP in the browser never gained traction. Not only would it help with e-mail security, it could also be used for passwordless website logins, portable web identities, all that jazz[2]. One proper, user-friendly browser plugin could put an end to all those nasty kludges called OAu…
Are there any webmail providers out there that support PGP? GMail never will since it needs the ability to read your email to show you ads.
Re: My weekend project - AES encryption for Gmail or anything else
#44Earlier quoted context omitted.
Even if you could somehow minify all of AES into a bookmarklet, you'd still lose any time any page this ran from requested HTML or JS from a non-HTTPS link, since any of those requests could poison the runtime.
Would using SPDY help?
The basic problem here is that JS is too dynamic to ensure this type of security. Any script running on the page can rebind any value, monitor or trigger any event, or a number of other things. Without SSL or similar, an attacker can inject any script they want into the page.
The simplest variant of such an attack would be a script that replaces your AES function with a ROT13 or other useless cipher. There are variations on this theme, and in the end it's impossible to defend against all of them.
Re: My weekend project - AES encryption for Gmail or anything else
#45Earlier quoted context omitted.
Thank you point me out. Definitely, I need to implement PBKDF2 (and add salt to password). I planning this, but weekend is too short and finally I just put SHA256 for key derivation. But, until you describe, I do not recognize what the principal difference between hash and password based key derivation function, thanks.
I assume you know that the reason you add a salt is to prevent rainbow table attacks. Without a salt, if someone obtains the hash then they need to just run it through a single rainbow table and with very high probability, obtain the password. A SHA{1,2,3,128,256,512} hash is very VERY VERY fast. So fast, in fact, that an attacker who has the hash could easily run through all 8 character passwords given a few GPU mac…
Re: My weekend project - AES encryption for Gmail or anything else
#46Earlier quoted context omitted.
I assume you know that the reason you add a salt is to prevent rainbow table attacks. Without a salt, if someone obtains the hash then they need to just run it through a single rainbow table and with very high probability, obtain the password. A SHA{1,2,3,128,256,512} hash is very VERY VERY fast. So fast, in fact, that an attacker who has the hash could easily run through all 8 character passwords given a few GPU mac…
What you described is essentially PBKDF1, which is similar to PBKDF2, but only supports a fixed output key length. It's also a decent option; just not as flexible as PBKDF2.
Re: My weekend project - AES encryption for Gmail or anything else
#47I am not sure though, if it is possible to create a multipart message using JavaScript in gmail.
Re: My weekend project - AES encryption for Gmail or anything else
#48Earlier quoted context omitted.
Are there any webmail providers out there that support PGP? GMail never will since it needs the ability to read your email to show you ads.
HushMail and Countermail do. I think it never really caught on because if you really care about end-to-end security, you wouldn't be using a webmail provider.
I can imagine an extension for Chrome or Firefox that will not be updated without my knowledge and has been peer reviewed like gnupg.
Re: My weekend project - AES encryption for Gmail or anything else
#49Earlier quoted context omitted.
Thank you point me out. Definitely, I need to implement PBKDF2 (and add salt to password). I planning this, but weekend is too short and finally I just put SHA256 for key derivation. But, until you describe, I do not recognize what the principal difference between hash and password based key derivation function, thanks.
I assume you know that the reason you add a salt is to prevent rainbow table attacks. Without a salt, if someone obtains the hash then they need to just run it through a single rainbow table and with very high probability, obtain the password. A SHA{1,2,3,128,256,512} hash is very VERY VERY fast. So fast, in fact, that an attacker who has the hash could easily run through all 8 character passwords given a few GPU mac…
Re: My weekend project - AES encryption for Gmail or anything else
#50Wouldn't it make more sense to revive FireGPG[1] and, while you're at it, port it to all other major browsers? I am still disappointed that PGP in the browser never gained traction. Not only would it help with e-mail security, it could also be used for passwordless website logins, portable web identities, all that jazz[2]. One proper, user-friendly browser plugin could put an end to all those nasty kludges called OAu…
Since I have zero experience with JS, I'm thankful for any help. Code is on: https://github.com/Mononofu/CryptoChrome
The plugin I'm using was compiled on Ubuntu x64 and probably doesn't work anywhere else. It was written using firebreath, basically it's just a wrapper to gpg.