Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to compare two cryptographic algorithms. The first algorithm is RSA, and second algorithm is ElGamal elliptic curve cryptography. Now, I’m looking for a way to compare the speed of the two algorithms (time needed to complete calculations).

Someone told me about computing “time complexity”. Is that really an advisable way to compare things?

share|improve this question
Don't compute, measure. And check out which lists performance of both DH on different groups and RSA. Though I heard that the RSA implementation they use might be rather slow. – CodesInChaos Jan 21 '13 at 12:28
Write a sample program that makes note of the current time, do the encryption, then make note of the time a second time. You should be able to compute the time it takes for each algorithm. – ponsfonze Jan 21 '13 at 17:10
Compute time it isn't good measured. because give me time variable each runtime program. I want know. Is calculate Time Complexity good measured. I want link for any book to learn me. Thanks for all. – almodawan Jan 21 '13 at 18:15
Is there general way to calculate speed performance for encrypt and be able to compare between any two algorithms in terms of speed? I need that for my thesis. – almodawan Jan 21 '13 at 18:25
No, there isn't. Big-O complexity is asymptotic - in addition to being an average - and is generally not accurate for realistic key sizes. In addition, some theoretically fast algorithms are terribly slow because they are not amenable to an efficient implementation, etc.. your best bet is to measure it, IMHO. – Thomas Jan 22 '13 at 0:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.