|
| 1 | +# Recipes |
| 2 | + |
| 3 | +## Recipe #1 Minimum Footprint |
| 4 | + |
| 5 | +Many users are on deeply embedded systems, where memory resources are tight. |
| 6 | +For those users, this section describes methods to reduce the footprint size of wolfSSL. |
| 7 | + |
| 8 | +1. Limit supported protocol versions to only those required, for example only allowing TLS 1.2 |
| 9 | +connections. |
| 10 | +2. Remove unnecessary library features at compile time - section |
| 11 | +[2.4.1](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html) of the |
| 12 | +wolfSSL Manual. |
| 13 | +3. Choose a limited set of cipher suites: |
| 14 | + a. Memory usage difference between RSA, ECC, PSK. |
| 15 | + b. Choose smaller key sizes - section |
| 16 | + [4.3](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-4-features.html) of the wolfSSL |
| 17 | + manual. |
| 18 | +4. Take advantage of hardware crypto if available - section |
| 19 | +[4.4](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-4-features.html) of the wolfSSL manual. |
| 20 | +5. Use compiler and toolchain optimizations. |
| 21 | +6. Decrease maximum SSL record size if you control both ends of the connection. |
| 22 | + |
| 23 | +## Recipe #2 Maximum Speed |
| 24 | + |
| 25 | +Adding SSL/TLS to a connection will always result in an inevitable reduction of performance. |
| 26 | +Our goal is to make that PERFORMANCE decrease as small as possible. |
| 27 | +This section describes ways to speed up wolfSSL, both during and after the handshake. |
| 28 | + |
| 29 | +There are two main areas of concern regarding performance: |
| 30 | + |
| 31 | +1. SSL/TLS handshake speed. |
| 32 | +2. Data flow rate (bulk data transfer, after the SSL handshake). |
| 33 | + |
| 34 | +When optimizing SSL handshake performance, items to consider include: |
| 35 | + |
| 36 | +1. Use a faster math library (big integer vs. fastmath). |
| 37 | +2. Take advantage of hardware crypto if available - section |
| 38 | +[4.4](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-4-features.html) of the wolfSSL manual. |
| 39 | +3. Key size - [Chapter 4](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-4-features.html) of |
| 40 | +the wolfSSL manual. |
| 41 | +4. Key type (RSA vs ECC for example). |
| 42 | +5. Trade off between handshake speed and security level (such as client/server cert verification |
| 43 | +- section [4.8](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-4-features.html) |
| 44 | +- of the wolfSSL manual). |
| 45 | +6. Consider using PSK (pre-shared keys) - |
| 46 | +section [4.7](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-4-features.html) of the wolfSSL |
| 47 | +manual. |
| 48 | + |
| 49 | +**Maximum data flow rate** in a streaming media environment for example, such as a video game, |
| 50 | +VoIP application, or cloud infrastructure, cipher suite choice is critical. In this recipe, |
| 51 | +there are many options depending on the hardware environment and number of connections. To simplify |
| 52 | +the recipe to make it usable, we will focus on a single connection environment running on a |
| 53 | +typical cloud-based server. |
| 54 | + |
| 55 | +When optimizing for maximum data flow rate, items to consider include: |
| 56 | + |
| 57 | +1. Choose cipher suites to prioritize faster algorithms over slower ones: Stream Ciphers, Rabbit, |
| 58 | +HC-128. |
| 59 | +2. Take advantage of better compiler optimization. (I am not sure if this is a |
| 60 | +user’s practical option). |
| 61 | +3. Take advantage of hardware crypto if available. |
| 62 | + |
| 63 | +## Recipe #3 Maximum Security |
| 64 | + |
| 65 | +The security of a SSL/TLS connection should be of high concern, since having a secure |
| 66 | +communication channel is the primary reason for adding SSL/TLS to a project. |
| 67 | + |
| 68 | +As with all cryptography-based protocols, SSL/TLS security recommendations can change as new |
| 69 | +attacks and vulnerabilities are discovered and released. Optimizing for maximum security can |
| 70 | +have negative effects on both memory usage and performance, depending on configuration. |
| 71 | + |
| 72 | +1. Cipher suite choices based on the best currently available information. |
| 73 | +2. Key size choices based on the best currently available information. |
| 74 | +3. Other considerations… |
| 75 | + |
| 76 | +As you can see from the basic recipes above, optimizing SSL is a complex multivariate problem |
| 77 | +that depends heavily on a wide range of assumptions about your initial environment. We are here |
| 78 | +to help. The wolfSSL team has successfully guided a vast number of our customers through these |
| 79 | +choices. We can support you in an entire spectrum of ways, from the simple question and answer |
| 80 | +process of typical commercial support, to short term professional design consulting, up to |
| 81 | +managing the entire implementation of your SSL project. |
0 commit comments