0

As I understand it, to encrypt data, you need to use the BCyptEncrypt function, but it takes BCRYPT_KEY_HANDLE hKey as a parameter, which can only be obtained from the BCryptGenerateSymmetricKey, BCryptGenerateKeyPair, or BCryptImportKey functions. The question is how to use the BCyptEncrypt function having a key obtained through BCryptDeriveKeyPBKDF2 that does not create BCRYPT_KEY_HANDLE hKey

  • A guess: `BCryptDeriveKeyPBKDF2` is used to derive the key (or keymaterial), which is then imported with `BCryptImportKey`, which in turn provides the handle for `BCryptEncrypt`. [This](https://stackoverflow.com/q/68165673/9014097) could be interesting. – Topaco Dec 13 '22 at 07:54

0 Answers0