RSA

From SEGGER Wiki
Jump to: navigation, search


RSA (named after its inventors, Rives, Shamir, Adleman), invented in 1977, is a well-established public key algorithm for encryption and decryption of data with a public and private key pair.

It has been standardized for digital signatures in the 1990s.

To encrypt and decrypt data, or to compute and verify a digital signature, rather simple modular arithmetic equations are used. While relatively simple to compute, there is no known solution to get the private key from the knowledge of the public key and the encrypted data or signature. This is the RSA problem and makes RSA secure.

Key Size

RSA can work with private keys of any size. Commonly used key sizes (modulus lengths) are: 1024 bits ("industrial grade") and 2048 bits ("military grade"), while NIST recommends a minimum key size of 2048 - 3072 bits for new systems.

Resource Use

For RSA digital signatures, verification can be implemented in about 6 KiB ROM and requires about 3 KiB of stack memory. (Implementation of RSA in emSecure)

Storage requirements for the public key are equal to the key size.

RSA can encrypt data of the size of the private key. RSA digital signatures are the size of the private key.

Performance

The common use for RSA in embedded systems is signature verification. Verifying an RSA digital signature can be described as two parts:

  1. Hashing the data, which depends on the data size and the hash algorithm.
  2. Signature decryption and verification, which depends on the public key size.
Hashing
emCrypt SHA-1 Hash computation 12.51 MiB/s
emCrypt SHA-224 Hash computation 3.66 MiB/s
emCrypt SHA-256 Hash computation 3.66 MiB/s
emCrypt SHA-512 Hash computation 2.82 MiB/s
Signature verification
emCrypt RSA 512 bit signature verification 0.87 ms
emCrypt RSA 1024 bit signature verification 2.18 ms
emCrypt RSA 2048 bit signature verification 7.40 ms
emCrypt RSA 3072 bit signature verification 15.89 ms
emCrypt RSA 4096 bit signature verification 25.53 ms
emCrypt RSA 8192 bit signature verification 92.94 ms
emCrypt RSA 16384 bit signature verification 333.19 ms
Signature generation
emCrypt RSA 512 bit signature generation 14.36 ms
emCrypt RSA 1024 bit signature generation 65.71 ms
emCrypt RSA 2048 bit signature generation 376.71 ms
emCrypt RSA 3072 bit signature generation 1185.00 ms
emCrypt RSA 4096 bit signature generation 2637.16 ms
emCrypt RSA 8192 bit signature generation 17678.06 ms
emCrypt RSA 16384 bit signature generation 139206.44 ms

Related Products

emCrypt - Cryptographic Algorithm Library

emSecure - Digital Signature Suite

emSSL - SSL/TLS Library