Summary
In this chapter, we have learned about the concept of deriving an encryption key from a password. Then we learned about what key derivation functions are and what the requirements are for good PBKDFs. We finished the theoretical part with a review of key derivation functions supported by OpenSSL and a recommendation on which KDF to use for password-based key derivation.
In the practical part, we learned how to derive a symmetric encryption key from a password on the command line. Then we also learned how to derive the same key programmatically in C code. We compared the resulting keys derived by both methods and, to our satisfaction, confirmed that both methods produced the same secret key.
In the next chapter, we will start learning about asymmetric cryptography.