Saravanan
Saravanan

Reputation: 7844

comparison of performance difference between RSA, ManagedRijndael & Managed AES in C#

I am comparing these 3 algorithms, i feel that the RSA takes more time, but i am not able to conclude which is best.

The following are the performance profiler results taken for the 3 methods using the code given by microsoft Managed Rijandel Method

Managed AES Method

RSA Method

All the input strings are Here is some data to encrypt!.

Can any one suggest me, i assert that RSA has performance penalty due to the import parameters method and i think of using the ManagedRijandel Method.

I am using this for a place where a normal encryption [not very strong and slow] is needed but it should be performant.

Kindly give me analysis details from your perspective + suggestions.

Note: 1. it is not better to compare symmetric and asymmetric.. but i need some strong analysis.

  1. Also, my memory profiling shows less memory usage with RSA.

  2. Framework : .Net Framework V4 with C# & VS2010 Kindly suggest.

Upvotes: 3

Views: 6083

Answers (1)

rossum
rossum

Reputation: 15693

RSA will be slower than a symmetric cypher like Rijndael or AES. The usual method is to use RSA to encrypt a small key (128 or 256 bits) to send to the destination. The key is then used to encrypt a much larger data file, using AES or Rijndael, which the destination now has the correct key to decrypt at their end.

In short, use RSA for small pieces of data and AES/Rijndael for large pieces of data.

Upvotes: 10

Related Questions