# Encryption cost comparison...

Will Peacock

Greenhorn

Posts: 4

posted 14 years ago

hi, sorry this isn't really a java question, but someone here might know...

does anyone know anything about the relative computational cost of using public key encryption as opposed to symmetric key? say RSA v. DES or 3DES

i know that specific figures depend on what algorithm is being used, key length, etc, but wondered what kind of orders of magnitude the difference could be?

thanks.

will

does anyone know anything about the relative computational cost of using public key encryption as opposed to symmetric key? say RSA v. DES or 3DES

i know that specific figures depend on what algorithm is being used, key length, etc, but wondered what kind of orders of magnitude the difference could be?

thanks.

will

Mark Herschberg

Sheriff

Posts: 6037

posted 14 years ago

Generally speaking, public key encryption is far more expensive then symmetric key encrption. I haven't paid close attention to recent implamentations, but suffice it to say it often is a performance issue.

For this reason, hybrid SSL-like solutions. Namely, you create a symmetric key for each session and first send it using a public key encryption scheme. This means you only need public key encryption in the beginning of the protocol, and the rest of the time you use the faster symmetric encryption.

Check out SSL for an example. It's fairly easy to understand if you are familiar with the basic cryptographic primatives.

--Mark

For this reason, hybrid SSL-like solutions. Namely, you create a symmetric key for each session and first send it using a public key encryption scheme. This means you only need public key encryption in the beginning of the protocol, and the rest of the time you use the faster symmetric encryption.

Check out SSL for an example. It's fairly easy to understand if you are familiar with the basic cryptographic primatives.

--Mark