Topic: Cryptography, Hashing, Keys, TIPC
I have an interesting problem: I have someone who implements a cryptographic function for me as follows:

- There is a HSM that contains a secret k that I know
- The HSM creates a derived key using a HKDF
- The derived key is then usable for communication

Above operations are deterministic. However, I want that some randomness is being incorporated in order to have perfect forward security. The current idea is to take the deterministic derived key of the HKDF and hash it together with some random number to get a session key as follows: session_key = sha(derived key, random)

But now I have different problem: On the running system I cannot verify whether the session key is really the product of randomness or whether a backdoor has been implemented. Is there mechanism that allows me to make the procedure verifiable?

Topic: Cryptography, Hashing, Keys, TIPC
1.Input Parameters: HMAC takes two inputs: a secret key (K) and the message or data (M) that needs to be authenticated. Additionally, it requires a cryptographic hash function (H), such as SHA-256 or SHA-3.
2.Key Padding: If necessary, the secret key (K) is padded or truncated to match the block size of the hash function (typically 512 bits for SHA-2).
3.Inner Padding: XOR (exclusive OR) operations are performed on the padded key (K) with two fixed values known as the inner and outer padding constants (ipad and opad). These constants are specific to the HMAC algorithm.
ipad is used to XOR with the key before hashing.
opad is used to XOR with the key after hashing.
4.Inner Hash: The inner padding (ipad XOR K) is concatenated with the message (M), and this combined value is hashed using the chosen hash function (H). This produces an intermediate hash result, denoted as H(ipad XOR K || M).
5.Outer Hash: The outer padding (opad XOR K) is concatenated with the intermediate hash result from the previous step (H(ipad XOR K || M)), and this combined value is hashed again using the same hash function (H). This final hash operation yields the HMAC, represented as H(opad XOR K || H(ipad XOR K || M)).
HMAC Output: The output of the second hash operation is the HMAC, which is a fixed-size value that can be appended to the message to create a MAC.  Based on above " Explain about Hmac"