[MUSIC] Welcome back. For this lesson, we´re going to talk about cryptography as it applies to threat models. The outline of this lesson is, we are going to basically address the question of how the cryptography that we learned earlier addresses issues with our threat modeling that we have been learning so far. With the threats of spoofing, tampering, and information leakage, connecting these threats with the mitigations that cryptography offers allows us to have a much better understanding of both threat modeling and basic applied cryptography. For a larger set of example threats and possible mitigations, see the very excellent book called Threat Modeling, Designing for Security by Adam Shostack. Specifically, the appendix B called threat trees. So after this lesson, you will be able to explain how cryptography addresses issues with spoofing, tampering, and information disclosure. You will also be able to connect the concepts of cryptographic hash functions, message authentication codes, and encryption to the STRIDE method, and how these cryptography concepts apply to threat models. But first, let's begin by reviewing the STRIDE acronym. We're now going to review STRIDE. Remember that STRIDE is our way of collecting or brainstorming different ways that threats can occur to our system. S stands for spoofing. T stands for tampering. R stands for repudiation. I stands for information disclosure or information leakage. D stands for denial of service. E stands for elevation of privilege. So one threat that can happen with systems is a man-in-the-middle attack when two or more parties in that system need to authenticate. So this an example of a spoofing threat. This example threat can be mitigated when we can authenticate the parties that are involved in the communication process. Here we can use asymmetric key encryption to perform proper key exchange and authenticate each party. Previously, we had chatted about how it was recommended that Diffie-Hellman key exchange can be used. And an example of this is SSH tunneling using diffie-hellman-group14-sha256 key exchange. And another example is using TLS 1.2 as a means of identifying the server when a client and a web browser need to talk to a particular server. Moving on to tampering threats, an example of threat based on tampering threat would be the data flow between two entities having weak or no message integrity. This example can be mitigated when we can authenticate messages that we receive before we use them. We can use message authentication code algorithms in this case. And previously, we talked about how HMAC using SHA-256 hash functions as building blocks for that as a recommended way of performing message authentication. Now, in terms of the information disclosure threats that we can see. We can see threats when data is in transit. So for example, an example threat would be unencrypted communication between two or more parties, for example, HTTP requests and responses. And this when you only use HTTP with session management between the web browser and the server. Somebody could eavesdrop on that session and basically obtain session information such that they can further perform other types of attacks, for example. This example threat can be mitigated if we can encrypt the data that's being sent between the two entities. In this case, we can use AES in CBC mode with random initialization vector or random IV. And another way that information disclosure threats could happen is during so-called data at rest. An example threat could be threats to stored data, like data backups that are not encrypted. And again, we can use encryption in this case. So we would use the recommended AES algorithm in CBC block cipher mode with random IV. In conclusion, we looked at STRIDE threats that could be mitigated using the applied cryptography basics that we learned in the previous lesson. Looking at STRIDE in this point of view is a good way to connect the applied cryptography basics that we learned, and also addressing the threats in your particular threat model. Now, given this information, this gives you a good base for which to develop your threat modeling skills.