-
Notifications
You must be signed in to change notification settings - Fork 68
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
Consider adding ChaCha as alternate encryption cipher to AES #15
Comments
I wouldn't mind using it (either as the only solution or as an alternative), but as long as there is no underlying iOS support for this, I would prefer not to use it. Mainly to keep any the number of dependencies low and to not implement a crypto-algorithm myself (copy-paste from CryptoSwift would still need to be maintained). Of course if you are willing to swap out AES for ChaCha, I would definitely pull the code in (if not to master, then to a separate branch). |
Note that CryptoSwift is completely written in Swift and while I do not have timings for ChaCha the timings I have dome for AES show it to be over 1000 times slower than Common Crypto, that is probably a deal breaker. |
AES if fast on iPhones because of hardware support - and I presume CommonCrypto uses this AES hardware support. From the iOS Security—White Paper | June 2015:
I'm not suggesting that the Heimdall implementation of AES should change to use the CryptoSwift AES software implementation. Rather, I was suggesting that it may be useful to implement Cha Cha as an additional cipher option given suggestions that it is becoming more popular and possibly more secure (even if it is software implementation). There is an interesting article on the Cloudflare Blog about ChaCha performance vs AES which is interesting - Do the ChaCha: better mobile performance with cryptography. Depending on the application, we may need to consider the performance of decryption on the other end (rather than just on the iPhone). |
On older phones chacha20 is much faster and is used by chrome on Android, but Google engineer tweeted that on newer phones with ARMv8 chip AES GCM is faster than Chacha20 (due to hardware support for AES) and Chrome switches to AES GCM in such cases |
I have done some timings of Common Crypto AES vs CryptoSwift AES and CryptoSwift ChaCha20: iPhone 6S: iPhone 5S: iPhone 4S: Conclusions:
|
Feature request: Would you consider adding ChaCha as an alternate cipher to AES for message encryption??
Marcin Krzyżanowski's CryptoSwift library implements this and suggests that this cipher is now starting to be used by Apple and Google in his presentation here.
The text was updated successfully, but these errors were encountered: