Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: InstantCryptor – AES256 Encryption for Dropbox and Google Drive (instantcryptor.com)
35 points by licobo on Feb 28, 2015 | hide | past | favorite | 50 comments


>> The password will be hashed with the SHA256 algorithm, the mode for encryption is 256 Bit Rijndael/AES

SHA256 is not a KDF, AES-256 is not a block cipher mode. Where is the source code?


Wolf is 100% correct. These details make it sound like this product is insecure. We definitely don't want ecb mode or a weak kdf like 1 round of sha256 with no salt.

BUT before anyone lambasts this guy, it's good the author posted so mistakes can be learned from the feedback, that way others get exposed to the issues, and less mistakes are made in the future. In my opinion, there is too much hate for people who make mistakes when writing code, when in reality that's how you learn. Few people learn all the theory first and THEN how to build it, it's often learn to build then the theory.


This is true for every kind of software except security things.

It's really hard for a novice to find something that will actually protect them in between all the "convenient cloud solutions" that an intern cobbled together in their lunch break using some javascript they found on github.


I wish it were just interns... Example follows.

The Finnish security company F-Secure revealed a secure cloud service, called Younited (https://www.younited.com/). It did not catch on. The active user amounts stayed at near zero level so it was sold to a company called Synchronoss.

F-Secure initially hoped that their good reputation, and the fact that the servers are located in countries without draconian spying legislation would be enough. They seriously hoped to make a star product out of their secure cloud service.

Well, secure against whom? Simply installing the applications and completing registration process revealed instantly that the service is insecure. Yes, in compliance sense "everything is encrypted", but the keys are clearly held server side. The customer has absolutely no control over the key management and storage, meaning they are at F-Secure's mercy, and F-Secure can technically open everything for authorities.

Now the actually interesting part of the story: The problem isn't the implementation. The problem isn't that they marketed it as secure. The important alpha users on this product area are way too savvy, and stayed away. As per the standard innovation diffusion model, they did not drag other users in. Not marketing the service as secure would have yielded better results!

It's funny how even serious software security companies screw things up. Even when they are attempting for a strategic new product positioning, and even when at near clear blue sea situation.


No it is even true for security things BUT the authors need to have no problem taking a dose of humble pie and labeling the project as completely insecure.

I don't see anything wrong with writing security software that is insecure as long as you don't pretend it is secure....


I don't see anything wrong with writing security software that is insecure as long as you don't pretend it is secure....

Except this one very much pretends to offer protection, apparently oblivious of the problems with their design.

They should point out very visibly that this is a tech-demo to promote a completely different product, and not an app that anyone should actually use.


Why not just use NaCl or libsodium... no need to muck about implementing things you don't fully understand.


I really dislike when companies say it their product encrypts with "256-bit encryption" or "AES-256". Like you said, that is an incomplete description of an encryption scheme. The choice of block cipher mode can immediately make or break my opinion of a product, and when developers omit what mode they've chosen, I lean toward break.


At least it's not "military-grade encryption".


Heh, that reminds me of when the "Trillian" IM client advertised "128-bit blowfish" encryption, but used 128-bit DH to negotiate the key (this many years ago).


What's the standard for this kind of thing, PBKDF2 / AES-CBC / HMAC-256?

(I went and checked NaCl and it has its own primitives, http://nacl.cr.yp.to/secretbox.html)


The old best practice was RSA (with OAEP padding), AES CBC (with PKCS 7 padding), HMAC-SHA-2 (for TLS, AES GCM is better than AES CBC + HMAC, but I don't know if it's true in general). The new best practice seems to be something based on Curve25519 with SALSA/XSALSA/CHACHA + POLY1305.

CFRG has been trying for a year to come up with recommendation for TLS 1.3 on how to use 25519 and stronger curves in better primitives than ECDSA. ChaCha20+Poly1305 is getting more progress getting standardized, but still very slowly[0][1][2][3]. If you want to be sane then don't look into how sausages, laws and standards get made.

0 - https://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-0...

1 - https://tools.ietf.org/html/draft-nir-cfrg-chacha20-poly1305...

2 - https://tools.ietf.org/html/draft-irtf-cfrg-chacha20-poly130...

3 - https://tools.ietf.org/html/draft-mavrogiannopoulos-chacha-t...


Scrypt for key derivation, chacha20+poly1305 for authenticated secret-key encryption. In Javascript, https://github.com/jedisct1/libsodium.js provides them.


Looks like they are using CBC block cipher mode. Guess they updated the site since then.

This appears to be the source code: https://instantcryptor.com/js/main.js


  var hash = crc.Crypto.Hash.SHA256.hash(password.value)
  crypter = new Crypt.Mode.Licobo(new Crypt.Rijndael256(hash))

And it looks like they didn't bother to use a KDF.

But I guess when your mode is "Crypt.Mode.Licobo" then that is the least of your problems...


PBKDF2 is still the gold standard for converting a password to an encryption key, right? bcrypt has some desirable properties, but it has a fixed output length of 192 bits.


scrypt is the gold standard, I think.


@all: thanks a lot for your feedback! It's good to see that so many people care about security. To quickly summarize your questions: We are using the secure CBC mode and have always used it ;) You can have a look on the source code directly on the website (because it's all client side JavaScript), but some parts of it are minified. We are working on a detailed description of the technology behind InstantCryptor and will publish it soon via Twitter (@cloudrail). If you are interested in the technology to easily add cloud storage into your application visit cloudrail.com to get a free copy.


It seems you have an authentication problem:

https://www.grc.com/sn/SN-497-Notes.pdf

There should be more details here after the show will be recorded (live now): http://twit.tv/show/security-now/497

I think using ChaCha20-Poly1305 instead of AES-CBC would solve that problem.

https://www.imperialviolet.org/2013/10/07/chacha20.html


I don't know that I'd necessary push for ChaCha20, but lack of ciphertext authentication is a clear problem. AES-GCM or even AES-CBC with an HMAC that's validated prior to decryption can provide the needed authenticity checks.


CBC mode is not inherently secure. Details matter and can often introduce catastrophic problems.


I've built a similar piece of javascript crypto: PasswordProtectMyFile.com. It's a single HTML page that can work with internet turned off. The ciphertext is another HTML page with all the javascript needed to decrypt itself.

It's open source: https://github.com/louissobel/ppmf


We are using CBC as block cipher mode. I totally understand that open sourcing the complete code is the only way for you to review it and trust it completely. We decided to write a detailed report about the encryption and how we use it and will publish the report soon via Twitter.


CBC mode by itself is insecure.


OP: You should listen to tptacek. He's forgotten more about crypto than some people have ever learned. :)


"We decided to write a detailed report about the encryption and how we use it and will publish the report soon via Twitter."

That doesn't sound like releasing the source code...


How do you generate the initialization vector? CBC mode requires an unpredictable IV, which usually equals cryptographic random number.

> var hash = crc.Crypto.Hash.SHA256.hash(password.value),

> crypter = new Crypt.Mode.Licobo(new Crypt.Rijndael256(hash)),

From the code I cannot see any generation of IV, so I can only assume that the same IV is used every time. A predictable IV leads to many kinds of attacks. In particular, since the key is generated without salting, this means that a combination of the same key and IV will be used for multiple files, completely defeats the confidentiality.

And no integrity protection whatsoever? So vulnerable to bit flipping attacks?


via @cloudrail


A small side project to encrypt files for Dropbox and Google Drive. Encryption happens locally in the browser via JavaScript. The key never leaves the local computer. Happy for any feedback or comments ;)


Happy for any feedback or comments

Don't put your crypto experiments online where they could harm someone who naively relies on them.


Yeah, look what happened when someone leaked Ron Rivest's RC4 cipher. People still naively rely on it!


Even with proper algorithms, per-file encryption leaks quite a lot of meta-data, sizes and usage patterns; also the cloud provider can transparently delete, corrupt and revert files to previous versions.


I wrote a backup/archive tool [0] that uses authenticated encryption, scrypt, and local key management. The only thing it leaks [1] is the amount of new data added on each snapshot.

[0] http://goryachev.com/products/secure-archive

[1] hopefully


An encrypted archive with browsing, revision history, and search:

http://goryachev.com/products/secure-archive


And we do not store or even transfer your Dropbox or Google password on our servers. It runs locally in your browser. Feel free to double check this in the source code ;)


That's the problem with in-browser crypto, though: you could change the source code at-will. You could even serve different versions of the source code to different people. You might even be compelled by your state to do so, even if you wished not to.

Better to deliver the end-user a piece of code he can examine once and trust going forward.


Can you link to the source code? In the 2-3 minutes I've spent searching, I can't find it.


If it's all client side JavaScript, then the source code is the webpage.


http://syncthing.net/ open source and transit encrypted between computers you control.


Two things:

1. Cryptor is usually the word used by criminals to describe payload obfuscation to evade antivirus detection.

2. Momma says closed-source crypto is the devil.


1. You're confusing "cryptor" with "crypter"

2. "Closed source" and javascript don't really work together.


I've seen it spelled both ways. Usually on HackForums (a.k.a. the massive script kiddie honeypot).


site:hackforums.net cryptor About 1,790 results (0.32 seconds)

vs

site:hackforums.net crypter About 62,700 results (0.36 seconds)


ooh. I made an app that encrypts files on Android written in Java and has a C# written client for Windows. I have released the java source code. I should post it here on HN to look at it and rip me a new one. What I am sketchy about is how does embedding an unencrypted salt used for the PBKDF2 in the file not potentially make guessing of the passphrase easier


To answer your question about the the salt and the PBKDF2: salt ensures that the hash of my password is different from someone else's, even if we use the same password (or I use the same password on another site). Thus, if someone has the hashes, and wants to attack the system, then need to attack each password independently (they can't just run a password dictionary through the PKDF2 (or SHA256 in this case - very bad choice)) and then compare the results against all of the password hashes. They have to start with the salt (different for each user), and then run each password guess through the algorithm. Much slower. Much better.

Which brings us to PBKDF2 instead of SHA256: SHA256 is designed to be fast. That's bad when hashing passwords, because it makes offline dictionary-based attacks faster. Password Derivation functions are designed to be slow. That makes logging on very slightly slower, but makes offline attacks much, much slower.

However, doing the encryption in Javascript is a fatal problem: At any time, they can update (or be forced to update) the javascript to send the server my password when I use it, and the only way I can protect myself from this is to audit the code, EVERY TIME I USE IT.


Why do you consider unsalted SHA-256 a bad choice here? If neither the password nor its hash are stored and the hash is merely used as a key for the CBC, I don't see how anyone could construct rainbow tables for that. Care to explain?


The point is that any salt, even a hard coded salt, would mean that an attacker would need to regenerate the rainbow tables using the known salt.


How are you going to guess the password given just the salt, not even the hash? Hell, even with the hash itself it's nowhere near easy.


Nice points.


This should be released as OpenSource.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: