Skip to content
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

CHACHA20 to replace the bulky AES-GCM?? #76

Closed
victoroldschool opened this issue May 7, 2024 · 1 comment
Closed

CHACHA20 to replace the bulky AES-GCM?? #76

victoroldschool opened this issue May 7, 2024 · 1 comment

Comments

@victoroldschool
Copy link

Hey, it mentioned to contact you if anyone is aware of encryption cyphers that are supported in the various languages you listed - "ChaCha20-Poly1305" looks like it will fit the bill. It's arguably even better than security wise than GCM, and runs waaaay faster than GCM even on the devices that have hardware AES-NI support.

  • I think Apple calls it something slightly different "chachapoly". I see a Swift cipher package on github called "Cryptoswift" that includes the chacha20 cipher.

  • Kotlin has several implementations if I'm looking correctly... Jetbrains, Romain-P.

  • I also see both a GO & Rust implementation as well.

This would definitely make a BIG difference as ChaCha20 runs absolutely beautifully even on super low powered or low performing hardware. Many folks will see a drastic speed increase with an equal or lower CPU usage, especially on slower/older hardware.

Cheers!

@spieglt
Copy link
Owner

spieglt commented May 20, 2024

The desktop Flying Carpet versions used to use libsodium's xchacha20poly1305 secretstream API. I swapped it for AES-GCM when I wrote the mobile versions, mostly because it's the AEAD that Apple offered directly through CryptoKit. I don't see that CryptoSwift has been audited, so I'm not going to swap it for Apple's officially supported option. I haven't released a version in a while so my memory is fuzzy, but I think Apple applies additional scrutiny in the review process if you use third-party cryptography.

As for performance, I've tested it with encryption disabled, and seen very minimal differences in speed. I think the WiFi cards are likely to be the bottleneck even for low-powered devices. Thanks for the recommendation but I probably won't change this unless and until Apple releases their own xchacha20poly1305 implementation or a serious problem is found with AES-GCM.

@spieglt spieglt closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants