c - How to properly implement HKDF Expand with openssl EVP_KDF - Stack Overflow
I am trying to manually get around bitwarden's encryption, and getting wrong results from using openssl according to this page: .php/EVP_Key_Derivation . I want to use openssl to hkdf-expand the "master key" in bitwarden to the "stretched master key."
I discovered that python cryptography library's HKDFExpand produces correct results after finding this project: (lines 133-139), so how can I implement openssl to behave similar to HKDFExpand?
The only changes I have made in the example is remove the salt param and instead add a mode param using
int a = EVP_KDF_HKDF_MODE_EXPAND_ONLY;
*p++ = OSSL_PARAM_construct_int("mode", &a);
also changed the key (censored here) and info params:
*p++ = OSSL_PARAM_construct_octet_string(
"key", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=", (size_t)44);
*p++ = OSSL_PARAM_construct_octet_string("info", "enc", (size_t)3);
and the rest is the same just with the error() replaced by printf(). The code works but converting the hex output to b64 shows a different stretched key than on .html and the one generated by that python file
- visual studio code - Azure Functions HTTPTrigger running locally with VSCode weird bug but API still works .NET - Stack Overflow
- Unable to create a azure synapse workspace? - Stack Overflow
- oauth - SSO to 3rd party through AzureAD - Stack Overflow
- TGUI Using raylib backend with cmake - Stack Overflow
- audio - How can i improve my sound module in Java? - Stack Overflow
- WHM API - start_autossl_check_for_one_user - Stack Overflow
- python - How to sub-class LangGraph's MessageState or use Pydantic for channel separation - Stack Overflow
- express - How can I access a cookie (refreshToken) on the server side in Next.js? - Stack Overflow
- python - Filtering from index and comparing row value with all values in column - Stack Overflow
- android - How to setImageCaptureResolutionSelector() in CameraController? - Stack Overflow
- kotlin - How to triegger LauncedEffect on user navigating to page OR value change - Stack Overflow
- Flutter GoRouter: ShellRoute with Subroutes - Stack Overflow
- spring boot - Hibernate search backend elastic search with multiple data bases - Stack Overflow
- c++ - Why does changing the thread language and back fail for known folders? - Stack Overflow
- reactjs - How to keep the modal open after navigating and returning from a certain screen in react native? - Stack Overflow
- c++ - Member of struct constructed twice in custom constructor? - Stack Overflow
- GHC unable to find mingwinclude directory on Windows - Stack Overflow