Skip navigation


emSecure-RSA is the default version of emSecure, based on RSA asymmetrical encryption.

Using emSecure-RSA

All emSecure products are created to be simple but powerful, and easy to integrate. It can be used in new products and even extend existing ones as emSecure is a software solution and no additional hardware is required. The code is completely written in ANSI C and can be used platform- and controller-independent. The required key pairs can be generated with the included tool. A pass-phrase can be used to regenerate the keys. The generated keys can be exported into different formats to be stored on the application code or loaded from a key file. This allows portability and exchangeability between different platforms. Signing data, for instance firmware images, can be performed with the included tool. It is also possible to integrate the signing process directly into a production application running on any PC or even on a microcontroller. Once a signature is generated, the signed data can be verified by its signature in an embedded application or on an external application communicating with the device. Verifying data takes less than 40 ms on a Cortex-M4, running at 200 MHz, which is not significantly more time for a bootloader to start firmware.


emSecure-RSA aims for portability and is designed to fit speed and size requirements for different targets. The process of verifying data is technically split up into two steps:

  • Compute the hash of the data.
  • Decrypt the signature and compare the hash values.

Step 1, the computation of the hash, depends on the size of the data, whereas step 2 is dependent on the key length and takes the same time to verify any data.


Hash computation

9.30 MB/sec
RSA 512 bit
Signature decryption and verification
3.20 ms
RSA 1024 bit
Signature decryption and verification
8.50 ms
RSA 2048 bit
Signature decryption and verification
24.63 ms
RSA 512 bit
Signature generation and encryption
41.53 ms
RSA 1024 bit
Signature generation and encryption
192.95 ms
RSA 2048 bit
Signature generation and encryption
1026.00 ms

Verifying Data

The following table shows some total values to verify different amounts of data.

Data sizeKey lengthDecryption and verificationHash computationTotal time
1 kByte512 bit3.20 ms 0.11 ms 3.31 ms
100 kByte 512 bit3.20 ms 11.30 ms 14.50 ms
1 kByte1024 bit 8.50 ms 0.11 ms 8.61 ms
100 kByte 1024 bit 8.50 ms 11.30 ms 19.80 ms
1 kByte2048 bit 24.63 ms0.11 ms 24.74 ms
100 kByte 2048 bit 24.63 ms11.30 ms 35.93 ms

Signing Data

The following table shows some total values to sign different amounts of data. 

Data sizeKey lengthDecryption and verificationHash computationTotal time
1 kByte512 bit41.53 ms 0.11 ms 41.64 ms
100 kByte 512 bit41.53 ms 11.30 ms 52.83 ms
1 kByte1024 bit 192.95 ms 0.11 ms192.06 ms
100 kByte 1024 bit 192.95 ms 11.30 ms 204.25 ms
1 kByte2048 bit 1026.00 ms0.11 ms 1026.11 ms
100 kByte 2048 bit 1026.00 ms11.30 ms 1037.30 ms

The performance values are for a Cortex-M4 microcontroller, running at 200 MHz.

Memory Footprint

The following table lists the memory requirements of emSecure-RSA configured for operation with a 2048 bit key. There are two components to the ROM use, one for the emSecure-RSA code and one for the emCrypt component that can be shared with other security products such as emSecure-ECDSA, emSSL, and emSSH.

Sign only

0.21 KB

5.42 KB

5.63 KB

0.01 KB

2.12 KB

Verify only

0.21 KB

4.35 KB

4.56 KB

0.01 KB

2.93 KB

Sign and verify

0.34 KB

5.70 KB

6.04 KB

0.01 KB

2.93 KB

Test configuration:

  • SEGGER Embedded Studio 3.20
  • Cortex-M4 microcontroller running at 168 MHz (SEGGER emPower)

Included Applications

emSecure includes all basic applications needed for securing a product. Additional applications for benchmark and validations are part of emSecure-RSA, too. The applications' source-code is included and provides an easy to use starting point for modifications and integration into other applications.

Application nameTarget platform Description
emKeyGenWindowsGenerates a key pair with a given key length, either random or from a given seed.
emSignWindowsDigitally signs a file with your private key.
emVerifyWindowsVerifies the signature of a digital asset with its public key.
emPrintKeyWindowsExports keys and signatures into C source format, to be included into any application.
emBenchmarkWindowsTests the speed of operations with different key lengths.
emValidateWindowsValidates the modules of emSecure.

The sign and verify tools are available for evaluation. For more information contact us at

The utilities are PC applications, ready-to-use for the setup step to secure your product.

Key generation

emKeyGen generates a public and a private key. The generation parameters can be set with command line options. The keys are saved in a common key file format and can be published and exchanged. Usage: emKeyGen.exe [<options>]</options>

Exporting Keys

emPrintKey exports key and signature files into a compileable format. The output can be linked into your application, so there is no need to load them from a file at runtime. This is especially useful for embedded applications

Signing Data

emSign digitally signs the file content, usually the data to be secured, with a given (private) key file and creates a signature file.

Verifying Data

emVerify decrypts a signature file and verifies if the corresponding data file matches the signature.

Speed Test

emBenchmark tests the speed performance of the most common used functions like signing and verifying and prints the results.

Validation Tests

emValidate tests the implementation of the algorithms and modules in emSecure with defined test vectors and parameters.

Technical Background

emSecure Signing Technical Details:

The emSecure-RSA signing operation starts by using a secure hash algorithm (SHA1) to generate a hash from the original data. Using the 2kBit RSA private key along with the hash, a digital signature is generated using RSA encryption.

emSecure Verification Technical Details:

The emSecure-RSA verification process starts with the data one wishes to verify and the digital signature which was created from the original file. A hash file is generated for the unverified data. The public key and RSA decryption is used to generate the original hash and then compared to verify whether the data file is genuine.