Edit: Changed my post here from trying to give fair and neutral criticisms to joining the whole “online upmanship” this guy seems to be participating in, why not ?
Hint: Lay your criticisms really thick on and try to avoid giving any real suggestions that could be picked apart. Lets go!
hplus0603 said:
source61 said:
If using TLS is too much of a hassle, consider using plain RSA.
This is not a good idea for most users.
What's good for any user is to follow whatever path they're on. If you want to lecture someone you should save it for OP for already having decided to try to implement cryptography on his own, I just gave him the tool he asked for and you're basically nose diving in just to say “you're wrong” in 30 lines of generalities and buzzwords. Nice.
RSA is also super slow in practice.
I already indicated exactly how much RSA costs (with the obvious caveat that it will vary depending on the hw used), so I'm not sure why you felt the need to say this (twice).
It's great to verify signatures, and verify that the other side is who they say they are, it also provides a convenient channel over which to exchange encryption keys for a more efficient symmetric cypher, but it also fails hard if you don't have a very strong certificate/key management scheme.
What a nice little ensemble of armchair buzzwords. May I ask if you have a youtube channel?
1024bit RSA costs about an average of 1ms of CPU time per encryption / decryption separately
1024 bits aren't considered particularly secure these days.
That's kind of a fair criticism (although afaik RSA 1024 still isn't cracked, it's just good practice to double it), although it should be completely trivial to upgrade to 2048 bits, so it sounds to me like you're honestly just nitpicking for whatever +1 internet points you can get, so lets play that game then.
And you don't want to implement it yourself if you can help it
Once again you already said this at the beginning.
even if you have a good infinite-precision math library to fall back on, specifics about seed primes and such end up being important. Libraries like Crypto++ and Botan are already tested and debugged; I would highly recommend using those if you need that particular feature.
Fair.
you can use RSA → XTEA.
I used to be a fan of TEA/XTEA because of the low runtime overhead myself, but it's not actually a part of any real cryptographic standard, which means it doesn't get the level of scrutiny that a standard algorithm gets, and thus there may be weaknesses in the algorithm that you don't know about, but a potential attacker does. XTEA is also a 64 bit block cipher, which is pretty small by today's standards.
Valid criticism for say a F500 company, not sure what you're on about preaching this stuff to indie game developers on an internet forum when fun fact: RSA → XTEA is used by a multi-million dollar game company CipSoft (Revenues in 2018: €14,026,000), a massive 2D MMORPG that's been going good for almost 25 years now that's still using RSA → XTEA to this day. Then again if you're trying to defend yourself against say the NSA or something you might want to drop the XTEA, sure.
Modern CPUs all have AES instructions built in, and they will encrypt data faster than any software implementation of an encryption algorithm. This is one of many benefits of actually sticking to a standard algorithm!
I'm not a cryptography expert (and I'm pretty sure you're not one either considering you're recommending using AES here, a symmetric cryptography suite, for online encryption purposes) so I'm unable to dispute or review these claims as a whole, all I know is when I experimenting with using AES with the most popular Python cryptography library out there a couple of years ago AES was really slow for small chunks data.
Either way AES can't afaik be properly used on its own for online encryption, so the whole criticism/suggestion kinda falls flat on its feet on those grounds.
All of that said, yes, if you have a TLS library and the technical resources to use it available then go for it, otherwise I personally at least would recommend giving RSA a try, it's been the gold standard for online encryption for a long time, and although plain RSA was dropped from the latest version of TLS 1.3 due to a lack of “forward secrecy”, an additional (optional) security layer for encryption in case of key compromise, RSA with a combination of other suites is still available (source).
Some more reading material about RSA in 2019 forward for anyone interested: https://crypto.stackexchange.com/questions/67145/is-rsa-in-decline-across-the-board?noredirect=1