Network security
Introducido
7:25
Redes de computadoras
A network carries your bytes across a planet of machines that owe each other nothing. The first three units move a frame: layering, the link layer with IP, and…
Narración en inglés · subtítulos en inglés y 中文 que puedes cambiar
En esta lección
| English | Significado |
|---|---|
| MAC/mæk/ | message authentication code: a tag computed with a shared key that shows a message has not been changed |
| authentication/ɔːˌθentɪˈkeɪʃn/ | Checking that a claimed identity is valid. |
| Confidentiality/ˌkɒnfɪˌdenʃiˈæləti/ | keeping data secret from anyone not allowed to read it |
| integrity/ɪnˈteɡrɪti/ | The accuracy, completeness and protection of data against unauthorised or unintended alteration. |
| TLS/ˌtiː el ˈes/ | Asymmetric cryptography agrees the key. |
| symmetric/sɪˈmetrɪk/ | simétrico |
| asymmetric/ˌeɪsɪˈmetrɪk/ | asimétrico |
| key/kiː/ | A value used by a cryptographic algorithm to encrypt, decrypt or authenticate information. |
| Diffie–Hellman/ˈdɪfi ˈhelmən/ | a method for two parties to agree a shared secret key over a public channel |
| discrete logarithm/dɪˈskriːt ˈlɒɡərɪθəm/ | finding the secret exponent a from g^a mod p; easy to state but too slow to solve for large primes |
| ephemeral/ɪˈfemərəl/ | (of a key) new for each session and thrown away afterwards |
| forward secrecy/ˈfɔːwəd ˈsiːkrɪsi/ | past sessions stay secret even if a long-term key is stolen later |
| hash/hæʃ/ | a fixed-length digest of data that anyone can compute; it shows change but not who made it |
| digital signature/ˈdɪdʒɪtl ˈsɪɡnɪtʃə/ | a value made with a private key and checked with the public key, so anyone can verify who signed |
Las tres propiedades
- La confidencialidad necesita cifrado; la integridad necesita un MAC; la autenticación necesita una cadena de certificados hacia una raíz que el cliente ya confía. Si falta uno, el protocolo falla de forma distinta: sin cifrado hay espionaje, sin MAC hay alteración, sin certificado hay impostor.
- TLS los superpone: simétrico para los datos (rápido), asimétrico para el acuerdo de claves (una operación costosa), certificados para la identidad.


Integrity without confidentiality still —
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
A MAC catches alteration; encryption catches reading - separate defenses.
El apretón de manos, numerado
- ClientHello (suites + aleatoriedad fresca), ServerHello (suite elegida + aleatoriedad) con certificado, intercambio de claves (premaster bajo la clave pública), ambos derivan las claves de sesión de los tres valores, mensajes Finished verifican — luego fluyen datos cifrados simétricamente.
- Una operación tipo RSA, seguida de criptografía a velocidad de flujo: la asimetría se usa solo para acordar la clave simétrica.
TLS uses asymmetric cryptography —
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
Asymmetric cryptography supports key agreement and server authentication; symmetric cryptography protects the data.
El menú del atacante
- Interceptación pasiva: derrotada por el cifrado. Modificación: derrotada por el MAC (Finished captura manipulaciones en el apretón de manos). Suplantación: derrotada por los certificados. Reenvío del apretón de manos: derrotado por las aleatoriedades frescas.
- Cifrar sin autenticar proporciona un canal seguro hacia la máquina equivocada; HTTPS hace que el canal sea privado y el servidor identificado — el contenido aún puede mentir.
Handshake replay is defeated by —
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
Each handshake carries new randoms; a replayed one derives different keys.
Esta tarjeta es nueva, por eso aparece en inglés hasta que su traducción esté lista.
Agreeing a key in public
- Diffie–Hellman 迪菲赫尔曼密钥交换 agrees a secret over an open line. Everyone knows a prime $p$ and a base $g$:
| Alice | Bob | |
|---|---|---|
| Keeps secret | $a$ | $b$ |
| Sends in the open | $A = g^a$ | $B = g^b$ |
| Computes | $B^a = g^{ab}$ | $A^b = g^{ab}$ |
- All the arithmetic is mod $p$, and both reach the same $g^{ab} \bmod p$. A listener sees $A$ and $B$, but finding $a$ from $A$ (a discrete logarithm 离散对数) is too slow for large $p$.
- With new ephemeral 临时 keys for each session, stealing the server's long-term key later cannot decrypt old traffic. This is forward secrecy 前向保密. Certificates sign the exchange, so the key is agreed with the right server.
With p = 23 and g = 5, Alice picks a = 4. What value does she send?
Dificultad 2/5 · 140 monedas + un pequeño bono en el primer intento de hoy
5^4 = 625, and 625 mod 23 = 625 - 621 = 4.
With ephemeral Diffie-Hellman, stealing the server's long-term key lets an attacker decrypt recorded old sessions.
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
The session keys came from throwaway exponents; the long-term key only signed the exchange.
Esta tarjeta es nueva, por eso aparece en inglés hasta que su traducción esté lista.
Hash, MAC or signature?
- Anyone can compute a hash 哈希, so it proves nothing about who sent the data. A MAC needs a shared secret key: it proves the data came from someone who holds that key.
- A digital signature 数字签名 is made with a private key and checked with the public key. Anyone can check it, and only the key's owner could have made it, so the sender cannot deny it later.
Which lets a third party check that only the sender could have produced a message?
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
A MAC's key is shared, so either holder could have made it.
Esta tarjeta es nueva, por eso aparece en inglés hasta que su traducción esté lista.
Worked example: Diffie–Hellman with small numbers
- Public $p = 23$, $g = 5$. Alice picks the secret $a = 6$ and sends $5^6 \bmod 23 = 8$; Bob picks $b = 15$ and sends $5^{15} \bmod 23 = 19$.
- Alice computes $19^6 \bmod 23 = 2$; Bob computes $8^{15} \bmod 23 = 2$. Both hold the key 密钥 $\mathbf{2}$, which never crossed the wire. Real keys use numbers with hundreds of digits.
$p = 23$, $g = 5$, Alice's secret $a = 6$: the value she sends ($g^a \bmod p$)?
Dificultad 2/5 · 140 monedas + un pequeño bono en el primer intento de hoy
$5^6 = 15\,625$, and $15\,625 \bmod 23 = 8$.
Bob sent 19; Alice's secret is 6. The shared key ($19^6 \bmod 23$)?
Dificultad 2/5 · 140 monedas + un pequeño bono en el primer intento de hoy
Bob gets the same: $8^{15} \bmod 23 = 2$.
Esta tarjeta es nueva, por eso aparece en inglés hasta que su traducción esté lista.
Marks that slip away
- Encryption without authentication. You get a private channel to whoever answered, perhaps the attacker.
- Public-key cryptography for the data. It is slow; TLS uses it once, to agree a symmetric 对称 key.
- Taking HTTPS as proof of content. It identifies the server and protects the channel; the page can still lie.
Esta tarjeta es nueva, por eso aparece en inglés hasta que su traducción esté lista.
Recap
- Encryption gives confidentiality 机密性, a MAC gives integrity, a certificate chain gives authentication.
- TLS: asymmetric cryptography agrees the key; symmetric cryptography moves the data.
- Fresh random numbers stop replay; Finished messages catch tampering.
¿Qué salió mal? Solo el equipo del sitio ve esta información.