I'm trying to "manually" compute how the premaster_secret is computed using the RSA key exchange in TLS 1.2, but can't manage to make numbers meet. I am using Scapy SSL to generate a TLS session:
- I retrieve the e and n parameters from the first certificate's pubKey (Certificate message)
- I retrieve the premaster_secret from Scapy
- I compute (premaster_secrete mod n)
- I compare this result to the Encrypted Premaster sent in the Client Key Exchange message, but it is never the same
Am I missing something?