For our privacy-preserving protocol, an encrypted channel is established. In order to protect our system from man-in-the-middle attacks, a signature-based approach is used. After we've implemented it with RSA, we decided to optimize the protocol a bit by using ECDSA. The result was very surprising: on Android, signing and verifying in the case of ECDSA was 10 times slower than for RSA with the corresponding key length!
Any viable explanation for this?
Maybe the android smartphones don't have hardware support for elliptic curves, and for RSA operations they do?
The exact parameters are below:
RSA: signing: 52ms, verifying: 6ms
ECDSA: signing: 692ms, verifying: 975ms
Smartphone: Samsung Galaxy S Advance, GT-I9070P with CPU: 1 GHz STE U8500 DualCore
Crypto-lib: SpongyCastle 1.50.0.0
The elliptic curve used: 224 bit, secp224r1
ECC signature: SHA256 with ECDSA
RSA 2048 signature: SHA1 with RSA
getProvider()
on the signature. It may be that ECDSA ran as byte code using Spongy and that the other ran using OpenSSL in the background. Also, the hash algorithm gains in imporance the bigger the data. $\endgroup$ – Maarten Bodewes♦ May 13 '14 at 14:44