-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importance of Shadowsocks-ChromeApp #1
Comments
No, it hasn't been stopped. Everything that can be done has be done. At the moment, I'm still waiting for Chrome to implement the Web Cryptography API. |
Thanks. Look forward to seeing its birth :) |
Hi. web crypto API is shipped in current stable versions in chrome. Any chance you'll continue development? |
Wonderful work, I'll check if we share any same cipher. |
Yes we can use AES-CFB8. But it's 16x slower than AES-CFB128. Why did they choose this algorithm? |
@clowwindy Highly recommend you to use AES-GCM if possible. |
Using GCM requires us to encapsulate each packet. This is suitable for each end of the communication. For a middle proxy, doing this will split each packet of a full MTU 1500 into two packets: a packet of length 1500, and a packet of a small length, resulting in low throughput and being vulnerable to detect. ref: |
Actually WebCrypto API requires us to encrypt the whole data at one time. Thus those ciphers are not stream ciphers. |
Oh right I remember that. I was also disappointed when I found out there was no .update() and .digest() methods for even a SHA1 digest. web crypto API seems pretty weak Is it really too slow to use crypto-js for the ciphers? I imagine it would be too much work to try to use some c library which supports streaming mode with pnacl. |
I wonder is there actually one JavaScript crypto library that has implemented stream cipher and CFB mode correctly. I looked at some of them a year ago, like crypto-js, forge, but none of them meet the requirement for Shadowsocks. If you know any library that will allow us to encrypt and decrypt |
I haven't used crypto-js stream ciphers, but according to the documents, it supports RC4 at least |
You can use AES-CTR as a stream cipher. It is extremely easy to implement if you have code for AES. PS. RC4 is (almost) broken, so please use other cipher suites if you can. See https://www.schneier.com/blog/archives/2013/03/new_rc4_attack.html |
Shadowsocks is not for serious encryption since it's not even CCA secure. |
For AES-CTR, I may write a small js lib based on webcrypto api to make it output progressively, later today when I have time. |
Added AES-CTR mode from OpenSSL EVP interface in server: |
@kzahel Tested crypto-js with RC4. Still broken. The implementation does not behave like a real stream cipher. Test code:
Expected:
Actual:
|
Will use an RC4 library written by myself just now. https://github.com/clowwindy/jsrc4/blob/master/jsrc4.js On Chrome 37: |
Wow, @clowwindy that is really, really great. I am eagerly following your progress. I very much would like to have a lightweight RC4 for bittorrent protocol encryption. |
@kzahel I created a TCP server that does nothing but piping data from one socket to another. It takes 150% CPU with 2.5MB/s throughput. One RC4 encryption is quite fast compared to that. The code I use can be simplified as:
|
@clowwindy It seems Chrome hasn't fully implemented APIs for AES-CTR yet, although it's in the w3 specification. I tried to build my own (progressive) AES-CTR by using AES-CBC as an underlying block. It is working but very slow. |
@zhuzhuor I implemented RC4 in JavaScript and it's around 180MB/s on Chrome. But after I then found that the new socket API provided by Chrome is terrible. It's not only slow, but requires us to keep creating new |
@clowwindy you're using "chrome.sockets", not "chrome.socket" API, right? I found that the newer one performs better. You don't call .recv() anymore, you set pause/unpaused and have an event listener for when there is data to be read from the socket. I found it increased the throughput. I do notice my app which uses chrome.sockets heavily is a very CPU bound app. But I haven't done any good benchmarking to see exactly where it's CPU bound. I am very interested in seeing example code gist of your sockets piping example that uses a lot of CPU. Maybe making a "crbug" would bring it to google's attention and somebody would work on it I didn't ever try simply reading from one socket and writing the same arraybuffer to another socket, it's strange that that would give an error (it throws some kind of exception, or what?) |
Hi All Developers,
I notice that this Shadowsocks Client (as Chrome Extension) has been stopped developed for over 1 year. Sincerely encourage you to take a look on it again and see if it can be re-developed now or not. Being able to deploy Shadowsocks is a big convenience for users. It also fully utilize the advantage of Shadowsocks, which is the rare one fully support Javascript client (needed for Chrome extension).
Pat
The text was updated successfully, but these errors were encountered: