Sneak-peak at our #TPMDEV2026 Conference. One slide from each main talk. Expect the recordings soon as we are migrating to Youtube. The news from today is that we are resuming our monthly calls and we will have in-person #TPMDEV2027! Check TPM.dev for more info.
Hi All, #Beignnersquestion I have below question. I am a beginner in TPM . 1. working on decrypting an...
Hi All,
#Beignnersquestion
I have below question.
I am a beginner in TPM .
1. working on decrypting an encrypted challenge in the preboot UEFI environment using TPM 2.0. Since tpm2-tss is not available, I need to submit commands directly to the TPM.
So far, I have successfully:
• Read the Endorsement Key (EK).
• Created a Registration Key (RK) under the Storage Root Key (SRK).
• Used TPM_SE_PW as the session handle (with nonce 0, parent auth size 0, and session attributes 0).
• Initialized the sensitive area with 0.
• Created a policy combining two conditions: Activate and Signed.
• Set the policy authorization in the TPM2_PUBLIC template.
• Submitted the command successfully and generated the RK key.
After that, I sent the RK public key, EK public key, and service tag to the server. In response, I received an encrypted challenge, HMAC, and seed. Now, I need to decrypt this challenge using TPM2_ActivateCredential.
However, when constructing and submitting the TPM2_ActivateCredential command, I receive response code 0x12F. I would appreciate any guidance on how to resolve this issue and correctly implement TPM2_ActivateCredential in this environment.
2. Additionally, I also need to create an encryption key using the Platform Root Key (PRK) as the parent handle.
Any help on these two tasks would be highly appreciated.
Thanks in advance!
#Beignnersquestion
I have below question.
I am a beginner in TPM .
1. working on decrypting an encrypted challenge in the preboot UEFI environment using TPM 2.0. Since tpm2-tss is not available, I need to submit commands directly to the TPM.
So far, I have successfully:
• Read the Endorsement Key (EK).
• Created a Registration Key (RK) under the Storage Root Key (SRK).
• Used TPM_SE_PW as the session handle (with nonce 0, parent auth size 0, and session attributes 0).
• Initialized the sensitive area with 0.
• Created a policy combining two conditions: Activate and Signed.
• Set the policy authorization in the TPM2_PUBLIC template.
• Submitted the command successfully and generated the RK key.
After that, I sent the RK public key, EK public key, and service tag to the server. In response, I received an encrypted challenge, HMAC, and seed. Now, I need to decrypt this challenge using TPM2_ActivateCredential.
However, when constructing and submitting the TPM2_ActivateCredential command, I receive response code 0x12F. I would appreciate any guidance on how to resolve this issue and correctly implement TPM2_ActivateCredential in this environment.
2. Additionally, I also need to create an encryption key using the Platform Root Key (PRK) as the parent handle.
Any help on these two tasks would be highly appreciated.
Thanks in advance!
👍
1❤️
👍
💡
👏
😂
Explore More Posts
Random Number Generator (TPM2)
1. IntroductionAmong other features, Trusted Platform Modules (TPM) comes with a True Random Number Generator (TRNG) that can be used for various applications including cryptographic purposes. This RNG module serves as the source for randomness for the TPM 2.0 Chip. A RNG module in TPM2 will typically contain the following -
An entropy source and collector
State Register
A mixing func.
There can be two types of calls to the TPM’s Random Number Generator, Internal call and External Call. RNG is capable to provide enough randomness for all the internal calls made. As well as, RNG is capable of providing 32 octets of randomness as per the specification to an external call. Another thing to note here is, each call made to the RNG produces a new value irrespective of the type of call. 1.1 The source of RandomnessThe source of entropy in the TPM is the entropy collector. As the name suggests, entropy collector collects entropy from entropy sources and also removes bias. A TPM2.0 has at least one internal source of entropy. These sources can include noise, clock variations, air movement amongst other events. As depicted in Fig 1.1 the entropy collector provides input to the State Register. 1.2 Stages involved Various algorithms and process supported by TPM calls RNG for unpredictable numbers, which is actually obtained from “RNG Protected Capability”. The “Deterministic Random Bit Generator (DRBG) Protected Capability“ obtains entropy from “Entropy Protected Capability”. Along with Entropy Protected Capability, TPM2_StirRandom() can also gather entropy from other entropy sources within the same TPM. 2. Random Numbers via TPM2 ToolsIf one needs to use TPM’s RNG for other external applications, then TPM2 Tools Command Line tools can be a great option. TPM2 Tools Command : tpm2_getrandom - - hex 16 - - hex : Converts output to hexadecimal 16 : Size in bytes Now, if one wants to have additional randomness, TPM2 Tools provides a convenient utility for this purpose called tpm2_stirrandom. To inject entropy via TPM2_StirRandom() to “Entropy Protected Capability” , we can use some file or use stdin. TPM2 Tools Command : echo -n “some_random_data” | tpm2_stirrandom Note : 128 bytes can only be injected using stdin at once through stirrandom() 3. ConclusionThe TPM2 provides in a sense True Random Numbers for use. These unpredictable numbers are coming from a dedicated hardware, hence can be trusted to be given as input to Crypto Algorithms amongst other applications. TPM2 also uses this for its internal use, and TCG claims it to be as secure as the strongest algorithm that TPM supports. Also, using the RNG is pretty straight forward via TPM2 Tools. #Tutorials
The latest tpm2-tools 5.8 release addresses three GitHub security advisories. One is a heap overflow in tpm2_getekcertificate, and the other is an out-of-bounds write that happens when too many sessions are in use. I don’t have information on the third advisory. Beyond the fixes, 5.8 extends EK certificate handling. It adds the option to read EK certificates from NV RAM, introduces new EK templates and supports a marshaled quote format. https://github.com/tpm2-software/tpm2-tools/releases/tag/5.8



Comments
Start the Conversation
24932845FC38F855DD4CB315DB327821
This is the Rk AuthPolicy which im using while creating a rk key..
…more
The hash is passed in AuthPolicy in TPM2Public upon creation, but for satisfying the policy afterwards, you need a policy session. Since you have PolicyOR when satisfying you need to perform only one of the two. Please check this TC1102 lecture https://www.youtube.com/watch?v=B0Bjhcd-WYM
But yes afterthat, i have started a policysession for rk and ek both.
…more
I have gone through the video..I’m trying to satisfy the policy for RK and ek handle with above mentioned steps..
sounds like you need hands-on help then and if this is a work related project I suggest asking at work for a paid consultant to help you. David Garske and wolfSSL offer such services. Maybe Thore Sommer or Er …more
Thank you for your guidance and support . I have successfully created a valid command and decrypted the challenge.
Sachin Sharma this is great news, what was the issue? please share so other in the community benefit from our discussion :)
Sure!
I realized that I was setting the authorization policy incorrectly. While setting up the authorization …more