As I know the symmetric encryption algorithms are faster than asymmetric encryption algorithms. But when I test GCM AES-128 and Curve25519 encryption time, I find Cure25519Curve25519 is faster than GCM AES-128.
Is that normal?
Is GCM AES-128 slow?
By the way, I use these python libraries for the comparison:
- PyNaCl for Curve25519 (using the
box
) - Cryptography.io for AES-GCM
I performed the tests with Ubuntu 16.04 64-bit on an Intel Core i7-2640M and ran the tests multiple times with differing input lengths.
The speeds for curve25519 are (1 kB):
Encryption 6.29425048828e-05 sec
Decryption 2.31266021729e-05 sec
The speeds for GCM are (1 kB):
Encryption 0.000115156173706 sec
Decryption 0.000576972961426 sec