emSecure-ECDSA
Digital signatures
emSecure-ECDSA offers digital signatures based on the modern elliptic curve digital signature algorithms.
Using emSecure-ECDSA
Using elliptic curves requires smaller key sizes for the same level of security. The keys use less memory when stored in an application, the algorithms run faster with smaller numbers, resulting in higher speeds. With a default key data can be signed in less than 160 ms.
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. 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 done immediately 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 typically takes less than 100 ms on a Cortex-M7, running at 216 MHz, which is not significantly more time for a bootloader to start a firmware.
Performance
emSecure-ECDSA 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.
- Compare the hash value against the one stored in the signature
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.
Step | Performance |
---|---|
SHA-256 | 3.70 MB/sec |
ECDSA P-256 Signature verification | 67.45 ms |
ECDSA P-256 Signature generation | 141.43 ms |
Verifying Data: The following table shows some total values to verify different amounts of data.
Data size | Key curve | Signature verification | Hash computation | Total time |
---|---|---|---|---|
1 kByte | P-256 | 67.45 ms | 0.27 ms | 67.72 ms |
100 kByte | P-256 | 67.45 ms | 27.00 ms | 94.45 ms |
Signing Data: The following table shows some total values to sign different amounts of data.
Data size | Key curve | Signature generation | Hash computation | Total time |
---|---|---|---|---|
1 kByte | P-256 | 141.43 ms | 0.27 ms | 141.70 ms |
100 kByte | P-256 | 141.43 ms | 27.00 ms | 168.43 ms |
Test configuration:
- SEGGER Embedded Studio 3.35 using clang 5.0.1 compiler
- SHA-256 algorithm configured for speed optimization
- Using twin multiply for ECDSA verification
- Test on a STM32F746 microcontroller, running at 216 MHz
Memory Footprint
ROM | Static RAM | Stack P-256 key | |
---|---|---|---|
Verification only: | 9.2 KByte | 0.04 KByte | 2.4 KByte |
Verification & Generation: | 10.8 KByte | 0.04 KByte | 6.2 KByte |
Test configuration:
- SEGGER Embedded Studio 3.35 using GCC compiler
- SHA-256 algorithm configured for size optimization
- Not using twin multiply for ECDSA verification
- Compiled for Thumb-2 instruction set, optimized for size
Included Applications
emSecure includes all basic applications needed for securing a product. The applications' source-code is included and provides an easy to use starting point for modifications and integration into other applications.
Application name | Target platform | Description |
---|---|---|
emKeyGen ECDSA | Windows | Generates a key pair with a given curve. |
emSign ECDSA | Windows | Digitally signs a file with your private key. |
emVerify ECDSA | Windows | Verifies the signature of a digital asset with its public key. |
emPrintKey ECDSA | Windows | Exports keys and signatures into C source format, to be included into any application. |
The sign and verify tools are available for evaluation. For more information contact us at info@segger.com
The utilities are PC applications, ready-to-use for the setup step to secure your product.
Key generation:
emKeyGen ECDSA 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: emKeyGenECDSA.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 ECDSA 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 ECDSA decrypts a signature file and verifies if the corresponding data file matches the signature.
Technical Background
emSecure Signing Technical Details:
The emSecure-ECDSA signing operation starts by using a secure hash algorithm (SHA256) to generate a hash from the original data. Using the ECDSA private key a digital signature is created following the digital signature algorithm.
emSecure Verification Technical Details:
The emSecure-ECDSA verification process starts with the data one wishes to verify and the digital signature which was created from the original file. A hash value is generated for the unverified data. The ECDSA public key is used to extract the original hash from the signature and then compare it with the generated hash to verify whether the data file is genuine or not.