SEGGER - Jobs
emWin upgrade     Trade-In program     Web shop

 

Protects sensitive privacy data
A must-have on the internet

emSSL - Transport Layer Security

emSSL is a SEGGER software library that enables secure connections across the Internet. emSSL offers both client and server capability.

SSL/TLS is a must-have in nearly every application which is connected to the Internet. Products of the IoT, smart grid or home automation markets benefit from securing their communication.

emSSL offers the possibility to establish a secured connection to any server application from your product. It can be used both target independent in native computer applications, as well as in embedded targets.

Features

  • Secures your connection
  • Compatible with any modern server
  • Easy to understand
  • Simple to integrate
  • No additional hardware required
  • No royalties

 

 

Notification Subscribe to emSSL software notifications
Documentation download
Pricing

Why should I use emSSL?

  • emSSL offers all features for current TLS and includes its latest protocol versions.
  • emSSL is a high quality product designed to be used easily but without any cutbacks.
  • emSSL is not covered by an open-source or required-attribution license and can be integrated in any free, commercial, or proprietary product without the obligation to disclose the combined source.
  • emSSL is provided as source code and offers transparency for all included modules, allowing inspection by auditors.
  • emSSL is portable. The complete software is written in ANSI C and is compiler and target independent. It can be implemented in PC applications as well as in embedded software.
  • emSSL is configurable. It is created for high performance and a low memory footprint. The library can be configured to fit any speed or size requirements. Unused features can be excluded, additional features can easily be added.

The emSSL Package

emSSL is a complete package and comes with everything which is needed to secure communication.

It includes all modules which implement the required functionality to use SSL. They are provided in source code, to allow complete control of the code that is used in the product and create transparency to avoid worries about possible back doors or weakness in code, which cannot be checked in precompiled libraries.

emSSL comes with a simple, yet powerful API to make using emSSL in your product as easy as possible.

It also includes sample applications in binary and source code, which demonstrate how and when emSSL can be used in real life scenarios. For a list of included applications, see the chapters below.


Supported Cipher Suites

emSSL includes the most commonly used cipher suites, which allows to connect to nearly every TLS-supporting server.

With emSSL the cipher suites can be added dynamically. When the required cipher suites are known it is possible to create a minimal size configuration by not linking in unused algorithms. This is can be done by the compiler/linker automatically. With the included scan suites application it is possible to find out the required cipher suite(s) to connect to a server.

The following list shows the cipher suites which are available in emSSL.

  • ECDHE-ECDSA-WITH-AES-128-CBC-SHA
  • ECDHE-ECDSA-WITH-AES-256-CBC-SHA
  • ECDHE-ECDSA-WITH-AES-128-CBC-SHA-256
  • ECDHE-ECDSA-WITH-AES-128-GCM-SHA-256
  • ECDHE-ECDSA-WITH-AES-256-CBC-SHA-384
  • ECDHE-ECDSA-WITH-AES-256-GCM-SHA-384
  • ECDHE-ECDSA-WITH-3DES-EDE-CBC-SHA
  • ECDHE-ECDSA-WITH-RC4-128-SHA
  • ECDHE-RSA-WITH-AES-128-CBC-SHA
  • ECDHE-RSA-WITH-AES-256-CBC-SHA
  • ECDHE-RSA-WITH-AES-128-CBC-SHA-256
  • ECDHE-RSA-WITH-AES-128-GCM-SHA-256
  • ECDHE-RSA-WITH-AES-256-CBC-SHA-384
  • ECDHE-RSA-WITH-AES-256-GCM-SHA-384
  • ECDHE-RSA-WITH-3DES-EDE-CBC-SHA
  • ECDHE-RSA-WITH-RC4-128-SHA
  • DHE-RSA-WITH-AES-256-GCM-SHA-384
  • DHE-RSA-WITH-AES-128-GCM-SHA-256
  • DHE-RSA-WITH-AES-128-CBC-SHA-256
  • DHE-RSA-WITH-AES-256-CBC-SHA-256
  • DHE-RSA-WITH-AES-128-CBC-SHA
  • DHE-RSA-WITH-AES-256-CBC-SHA
  • DHE-RSA-WITH-3DES-EDE-CBC-SHA
  • RSA-WITH-AES-256-GCM-SHA-384
  • RSA-WITH-AES-128-GCM-SHA-256
  • RSA-WITH-AES-128-CBC-SHA-256
  • RSA-WITH-AES-256-CBC-SHA-256
  • RSA-WITH-AES-128-CBC-SHA
  • RSA-WITH-AES-256-CBC-SHA
  • RSA-WITH-3DES-EDE-CBC-SHA
  • RSA-WITH-RC4-128-MD5
  • RSA-WITH-RC4-128-SHA
  • ECDH-RSA-WITH-AES-128-CBC-SHA
  • ECDH-RSA-WITH-AES-256-CBC-SHA
  • ECDH-RSA-WITH-AES-128-CBC-SHA-256
  • ECDH-RSA-WITH-AES-128-GCM-SHA-256
  • ECDH-RSA-WITH-AES-256-CBC-SHA-384
  • ECDH-RSA-WITH-AES-256-GCM-SHA-384
  • ECDH-RSA-WITH-3DES-EDE-CBC-SHA
  • ECDH-RSA-WITH-RC4-128-SHA
  • ECDH-ECDSA-WITH-AES-128-CBC-SHA
  • ECDH-ECDSA-WITH-AES-256-CBC-SHA
  • ECDH-ECDSA-WITH-AES-128-CBC-SHA-256
  • ECDH-ECDSA-WITH-AES-128-GCM-SHA-256
  • ECDH-ECDSA-WITH-AES-256-CBC-SHA-384
  • ECDH-ECDSA-WITH-AES-256-GCM-SHA-384
  • ECDH-ECDSA-WITH-3DES-EDE-CBC-SHA
  • ECDH-ECDSA-WITH-RC4-128-SHA

 


Performance

emSSL is built for high performance with target independent code. It is completely written in ANSI C and can be used in any embedded application, as well as in PC applications.

Performance Test

The following results show the connection time of a Cortex-M4, running at 200MHz from internal flash memory, using internal RAM.

Cipher Suite RSA key length [bit] SSL time [ms]1

RSA-WITH-AES-256-CBC-SHA-256

2048 64

ECDHE-RSA-WITH-AES-256-CBC-SHA

2048 470

1: Results may vary depending on the compiler, compiler settings and memory timings of the microcontroller used.

The times are measured for the negotiation phase, connecting to www.segger.com and www.google.com with the key exchange algorithms (marked in bold).

Cipher Suite is the used cipher suite for this connection which is supported by emSSL and the server.

SSL time is the time required by emSSL to fully agree the session keys for a secure connection — it excludes transmission and reception times over the IP transport which are highly variable.

 


Memory footprint

How much ROM will emSSL use?

That will depend entirely on the features that you select and the choices you make for the underlying implementation.

Our hash functions and block ciphers are configurable to tune RAM, ROM, and performance to customer needs. You can choose a fast implementation and burn flash with precomputed lookup tables, or a lean implementation and run a little slower, using less RAM and ROM.

 

Minimal configuration
17 kByte

emSSL with the smallest single cipher suite, RSA_WITH_RC4_128_SHA, and TLS protocol version 1.2, used in an embOS/IP Webserver application.

 

Default configuration
19 kByte

emSSL with one single cipher suite, RSA_WITH_AES_128_CBC_SHA, and TLS protocol version 1.2, used in an embOS/IP Webserver application.
All current major web browsers can establish a HTTPS connection to the server with this cipher suite.

 

Full configuration
43 kByte

emSSL with all supported all cipher suites, all prime elliptic curves, TLS 1.0, TLS 1.1, and TLS 1.2, used in an embOS/IP Webserver application.

Tested with SEGGER Embedded Studio, Cortex-M4, compiler optimizations for size. The values do not include the server certificates, which add another ~1.5 kByte per certificate.

 

Following components are required in order to use RSA_WITH_AES_128_CBC_SHA and TLS 1.2:

Cipher AES128 CBC
Signature verification RSA
Signature algorithm SHA with RSA
Pseudorandom function (PRF) SHA256
Message authentication code (MAC) SHA1, SHA256

 

How much RAM will emSSL use?

Again, this depends upon the cipher suites and how many simultaneous TLS connections you make.

The overall static RAM requirement of TLS is 0 KB - there is none, it's of the order of tens of bytes.

When you create a connection, the amount of RAM required spikes during TLS negotiation because keys need to be exchanged, certificates parsed, and so on. We also cannot control the record-layer packets sent by the server and, in this case, it wholly depends upon the server -- if the server cannot support the TLS record fragmentation extension.

The smallest case is one DES-RC4 cipher suite, a single connection, which is currently in the range of 1.5 kBytes.

What we have done is tune emSSL such that it uses very little memory.  We know it's going to be used in resource-constrained controllers. We know every byte is precious and we are working on trimming things even further. 

 


Included Applications

emSSL includes some sample utilities in source to show how to use emSSL and as precompiled executables. Applications for benchmark and validation tests are part of the package, too.

Application name Target platform Description
BrowseDemo Windows Get a webpage via HTTPS and print it to the console.
PrintCert Windows Read an X.509 SSL certificate and print its information to the console.
ScanSuites Windows Scan a server for its supported cipher suites.
TwitterDemo Windows Show Twitter followers of @SEGGERMicro.

The applications are available as executable for evaluation upon request. For more information contact us at info@segger.com

 


Example application

This application opens a connection to the SEGGER web site and retrieves the HTML index document over a fully secured connection. As you can see, emSSL makes working with secure sockets a breeze!

int main(int argc, char * const argv[]) {
  SSL_SESSION Session;
  unsigned    Socket;
  int         Status;
  //
  // Kick off networking and start TLS.
  //
  SYS_IP_Init();
  TLS_Init();
  //
  // Open a plain socket to www.segger.com on the default
  // HTTPS port, 443.
  //
  Socket = SYS_IP_Open("www.segger.com", 443);
  if (Socket < 0) {
    printf("Cannot open www.segger.com:443!\n");
    return 100;
  }
  //
  // Upgrade the connection to secure by negotiating a
  // session using TLS.
  //
  SSL_Prepare(&Session, Socket, &TLS_IP_Transport);
  if (SSL_Connect(&Session, 0, "www.segger.com") < 0) {
    printf("Cannot negotiate a secure connection to www.segger.com:443!\n");
    return 100;
  }
  //
  // We have established a secure connection, so ask the server
  // for some data.  This sends an HTTP GET request to retrieve
  // the default index page.
  //
  SSL_SendStr(&Session, "GET /index.html HTTP/1.0\r\n");
  SSL_SendStr(&Session, "Host: www.segger.com\r\n");
  SSL_SendStr(&Session, "\r\n");
  //
  // Now read the response.  We requested HTTP 1.0 which causes
  // the underlying socket to be closed once the reply is complete,
  // so we have no need to decode the headers.
  //
  for (;;) {
    char acBuf[256];
    Status = SSL_Receive(&Session, acBuf, sizeof(acBuf)-1);
    if (Status < 0) {
      break;
    }
    acBuf[Status] = 0;
    printf("%s", acBuf);
  }
  //
  // Close the TLS connection.
  //
  SSL_Disconnect(&Session);
  SYS_IP_Close(Socket);
  //
  // Finish up.
  //
  SSL_Exit();
  SYS_IP_Exit();
  //
  return 0;
} 

FAQ

Q: Can I use emSSL with my product?
A: Yes. emSSL can be included in nearly every product, independent from the used target, as well as in native computer applications.
   
Q: Does emSSL support TLS?
A: Yes. emSSL supports TLS 1.0, 1.1 and 1.2.
   
Q: Does emSSL support older versions of SSL?
A: No. emSSL supports only TLS 1.0 and higher. SSL 3.0 and prior are considered insecure and should not be used.
   
Q: I want to connect to a specific server with only one cipher suite. Do I have to include the complete emSSL in my project?
A: No. emSSL allows to select which cipher suites will be included. Unused modules can be removed from the project or may not be linked into the application, reducing the size to a minimum.
   
Q: I want to connect to a server on the internet. Which cipher suites will I need?
A: This depends on the server you want to connect to. emSSL includes an application to scan a server for its available cipher suites. If the server configuration does not change, only one of the available cipher suites needs to be included.
   
Q:
My question is not listed here. What can I do?
A: If you have any further questions about emSSL, feel free to contact us at info@segger.com

 


Glossary

The following table explains the abbrevations used in the cipher suite names.

3DES-EDE Triple data encryption standard algorithm in encrypt-decrypt-encrypt mode.
AES-128/AES-256 Advanced encryption standard algorithms.
CBC Cipher block chaining mode for AES stream ciphers.
DHE Ephemeral diffie-hellman key exchange algorithm.
ECDH Elliptic curves diffie-hellman key exchange algorithm.
ECDHE Ephemeral elliptic curves diffie-hellman key exchange algorithm.
ECDSA Elliptic curves digital signature algorithm.
GCM Galois/Counter-mode for AES stream ciphers.
MD5 Message-digest algorithm 5.
RC4 RC4 stream cipher algorithm.
RSA Rivest, Shamir, Adleman crypto system algorithm.
SHA Secure hash algorithm V1.
SHA-256/SHA-384 Secure hash algorithms (V2).