Learn how to use your Trusted Platform Module (TPM)
Clone or download


Interactive TPM simulator with codelabs


TPM-JS lets you experiment with a software TPM device in your browser. It's an educational tool that teaches you how to use a TPM device to secure your workflows. The codelab like sessions cover topics such as key generation, measured boot, remote attestation and sealing.


Welcome screen: Welcome Screen

Keys codelab: Keys codelab

PCRs codelab: PCRs codelab


TPM-JS includes the following libraries:

The libraries are compiled to WebAssembly, and accessed via Javascript.



Initialize git submodules:

git submodules update --init

Activate emsdk:

source {EMSDK PATH}/emsdk_env.sh

Build TPM-JS:

mkdir bulid-web
cd build-web
emconfigure cmake ..
make -j4

Run unit-tests: shell make check

Serve Files

Add the line application/wasm wasm to /etc/mime.types.

Serve files from the built web package:

cd build-web/web
python3 -m http.server --bind 8000


This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.