# Certificate public key keyexchange, Which key exchange is used in browsers?

I have a question regarding the keyexchange happening in web browsers. If you check the certificate here on crypto.stackexchange you can go under details and see that the public key is type RSA (2048 Bits). Does this mean that StackExchange is generating a private key via RSA between them and me to encrypt my messages?

The RSA encryption algorithm implies two types of keys: a public key and a private key. The public key is composed from the public exponent $e$ and modulus $n$. The private key is composed from the private exponent $d$ and modulus $n$. The relationship between them is $(e,d)\ ≡\ 1\ (mod\ φ(n))$. To encrypt, you rise the plaintext to the power $e$ and to decrypt you rise the ciphertext to the power $d$ (both operations are done modulo $n$). More detalis here. The traffic between you and StackExchange is encrypted under the TLS protocol. The TLS protocol uses a hybrid encryption scheme. That is, you first generate a random key, say K, that you'll encrypt with RSA using the public key of StackExchange. The StackExchange will decrypt the key K using its private key. From now on you will both use a symmetric algorithm (AES 256) to encrypt your data. The encryption key for this symmetric algorithm will be the K key, which you previously encrypted using RSA. More detils about TLS here.
• The part reading "you first generate a random key, say K, that you'll encrypt with RSA using the public key of StackExchange" usually does not hold. My connection to https://crypto.stackexchange.com is reported as "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 128 bits, TLS 1.2". An AES-128 key is negotiated using Elliptic-Curve Diffie-Hellman (with an RSA signature of authentication data made by the server and verified by the client), rather than chosen and enciphered by the client as described in this answer. – fgrieu Sep 16 '18 at 15:05
• There are also various issues with the description of RSA: padding is omitted, as well as the possibility of signing. The relation $(e,d)\ ≡\ 1\ (mod\ φ(n))$ uses a comma where multiplication is though, and some valid RSA keys do not match that relation, which should be $e\cdot d\equiv1\pmod{\lambda(n)}$ where $\lambda$ is Carmichael's function; see PKCS#1v2. – fgrieu Sep 16 '18 at 15:17