Handshake
Security protocols byte by byte: watch a TLS 1.3 handshake and an automotive SHE key update happen with real cryptography, then try to break them.
Every key is generated and every byte is computed in your browser with Web Crypto. Nothing is sent anywhere.
Alice's browser connects to Bob's server while Eve watches the network. Follow each message, see every byte and which keys each of them knows.
A backend loads a new key into the SHE module of an ECU with the memory update protocol, while Eve listens on the vehicle network. Change any input to use it as an M1-M5 calculator.
What happens in a TLS handshake?
Every HTTPS connection starts with a TLS handshake. In TLS 1.3 it takes a single round trip: the browser (Alice) sends a ClientHello with its half of an X25519 key exchange, and the server (Bob) answers with a ServerHello carrying the other half. From those two public keys both sides compute the same shared secret, and the key schedule, a chain of HKDF steps, turns it into separate AES-GCM keys for each direction. Everything after the ServerHello is encrypted, including the server's certificate, its CertificateVerify signature and the Finished messages that confirm both sides saw the same handshake.
What can an eavesdropper see?
Someone on the network, like Eve on this page, reads the ClientHello and the ServerHello: the server name (SNI), the cipher suites and both public keys. She cannot compute the shared secret from the public keys, so the rest is opaque to her: encrypted records, their sizes and their timing. And because the key exchange keys are thrown away after the handshake, stealing the server's private key later does not decrypt recorded traffic. That is forward secrecy.
Is this a real TLS implementation?
The cryptography is real: X25519, HKDF, AES-128-GCM, HMAC-SHA256 and ECDSA P-256 run in your browser with the Web Crypto API, and the key schedule, the Finished messages and the record encryption are checked byte for byte against the example handshake of RFC 8448. It is a teaching simulation, not a TLS library: it supports one cipher suite (TLS_AES_128_GCM_SHA256) and one group (x25519), leaves out HelloRetryRequest, session resumption and 0-RTT, sends each handshake message in its own record and uses demo certificates.
What is SHE and its M1-M5 protocol?
SHE (Secure Hardware Extension) is a security module specified by the HIS consortium and AUTOSAR and built into many automotive microcontrollers. It keeps AES-128 keys in slots that software can use for encryption and CMAC but never read. Keys are loaded with the memory update protocol: the backend sends M1 (the ECU's UID and the slot IDs), M2 (the new key, a counter and flags, encrypted with AES-CBC) and M3 (a CMAC), with keys derived from a key the ECU already holds, and the ECU answers M4 and M5 to prove the update. The counter stops replays.
Can I use it as an M1-M5 calculator?
Yes. In the SHE tab, enter the UID, the slot, the authorizing key, the new key, the counter and the flags: the page computes K1 to K4 and M1 to M5, and checks them the way SHE would. It reproduces the test vectors of the AUTOSAR Specification of Secure Hardware Extensions, and everything runs locally, so no key leaves your browser. Even so, keep production keys in your own key management system rather than typing them into a web page.