Cryptosystem Demo

Demostración de Criptosistema

We use cryptosystems to send secret messages and to read them. This demo lets you send and receive secret messages using two kinds of encryption: Symmetric-Key Encryption and Public-Key Encryption. Be aware that this demonstration does not use real encryption algorithms. If you really need to send secret messages, be sure to use a real cryptosystem.

Usamos criptosistemas para enviar mensajes secretos y leerlos. Esta demostración te permite enviar y recibir mensajes secretos usando dos tipos de cifrado: Cifrado de Clave Simétrica y Cifrado de Clave Pública. Ten en cuenta que esta demostración no utiliza algoritmos de cifrado reales. Si realmente necesitas enviar mensajes secretos, asegúrate de usar un criptosistema real.

Javascript is disabled. Please enable Javscript for the buttons below to work.
Symmetric-Key EncryptionCifrado de clave simétrica
Public-Key EncryptionCifrado de clave pública

Symmetric-Key Encryption

Cifrado de Clave Simétrica

Like traditional door locks that use one key for both locking and unlocking a door, Symmetric-Key Encryption uses one key for both encrypting and decrypting a message.

Como las cerraduras tradicionales que usan una llave para cerrar y abrir una puerta, el Cifrado de Clave Simétrica usa una llave para cifrar y descifrar un mensaje.

Follow these steps to send a secret message to someone. First, think who you want to send a message to. It needs to be someone whom you can securely send a Symmetric Key to. (That's one of the disadvantages of Symmetric-Key Encryption: you need to find a secure way to distribute your Symmetric Key before you can send a message!)

Sigue estos pasos para enviar un mensaje secreto a alguien. Primero, piensa a quién quieres enviar un mensaje. Debe ser alguien a quien puedas enviar una Clave Simétrica de forma segura. (Esa es una de las desventajas del Cifrado de Clave Simétrica: necesitas encontrar una forma segura de distribuir tu Clave Simétrica antes de poder enviar un mensaje!)

Step 1: Generate a Symmetric Key

Paso 1: Generar una Clave Simétrica

The first step in sending a secret message is to generate a Symmetric Key. Do this by pressing the button below.

El primer paso para enviar un mensaje secreto es generar una Clave Simétrica. Haz esto presionando el botón de abajo.

 

You and the recipient of your secret message both will use this key, and so you need to securely send it to the recipient of your message. But since this is just a demo, you can send this Symmetric Key any way you like. Normally, you never would use email to send a Symmetric Key!

Tú y el destinatario de tu mensaje secreto usarán esta clave, por lo que necesitas enviarla de forma segura al destinatario de tu mensaje. Pero como esto es solo una demostración, puedes enviar esta Clave Simétrica de cualquier manera que desees. Normalmente, nunca usarías el correo electrónico para enviar una Clave Simétrica!

Step 2: Encrypt a Message

Paso 2: Cifrar un Mensaje

Here's how to encrypt a message before sending it to someone else. If you just received a message, then follow the next step instead. We call your message the plaintext. Enter the plaintext of your message and your Symmetric Key. Then press the button to encrypt the plaintext of your message into its ciphertext.

Aquí te mostramos cómo cifrar un mensaje antes de enviarlo a otra persona. Si acabas de recibir un mensaje, sigue el siguiente paso en su lugar. Llamamos a tu mensaje el texto plano. Ingresa el texto plano de tu mensaje y tu Clave Simétrica. Luego presiona el botón para cifrar el texto plano de tu mensaje en su texto cifrado.

 

Send the ciphertext to your recipient. They will follow Step 3 to decrypt the ciphertext using the shared Symmetric Key that you and they already have.

Envía el texto cifrado a tu destinatario. Ellos seguirán el Paso 3 para descifrar el texto cifrado usando la Clave Simétrica compartida que tú y ellos ya tienen.

Step 3: Decrypt a Message

Paso 3: Descifrar un Mensaje

Did you just receive a message from someone else? Then follow this step. If you are sending a message, then follow the previous step instead. Here you decrypt the message using the Symmetric Key. We call the encrypted message the ciphertext. Enter the ciphertext of the message followed by your Symmetric Key, and press the button to decrypt the ciphertext of the message into plaintext.

¿Acabas de recibir un mensaje de otra persona? Entonces sigue este paso. Si estás enviando un mensaje, sigue el paso anterior en su lugar. Aquí descifras el mensaje usando la Clave Simétrica. Llamamos al mensaje cifrado el texto cifrado. Ingresa el texto cifrado del mensaje seguido de tu Clave Simétrica, y presiona el botón para descifrar el texto cifrado del mensaje en texto plano.

 

Practice

Práctica

1. Generate a Symmetric Key and share it with a friend.

1. Genera una Clave Simétrica y compártela con un amigo.

2. Using your shared Symmetric Key, see if you and your friend can send and read short encrypted emails by copying and pasting text with Steps 2 and 3 above.

2. Usando tu Clave Simétrica compartida, ve si tú y tu amigo pueden enviar y leer correos electrónicos cortos cifrados copiando y pegando texto con los Pasos 2 y 3 anteriores.


In the previous section you should have been able to use the same Symmetric Key to encrypt and decrypt messages. In the next section you use Public-Key Encryption. This kind of cryptosystem really should be called Public/Private-Key Encryption because you use a matched pair of keys: one key that you keep to yourself and another key that you send to others freely. But the industry calls this technique just Public-Key Encryption—probably because it's unexpected that any key that is public could help with security in any way.

En la sección anterior deberías haber podido usar la misma Clave Simétrica para cifrar y descifrar mensajes. En la siguiente sección usarás Cifrado de Clave Pública. Este tipo de criptosistema realmente debería llamarse Cifrado de Clave Pública/Privada porque usas un par de claves emparejadas: una clave que guardas para ti y otra clave que envías a otros libremente. Pero la industria llama a esta técnica simplemente Cifrado de Clave Pública—probablemente porque es inesperado que cualquier clave pública pueda ayudar con la seguridad de alguna manera.

Public-Key Encryption

Cifrado de Clave Pública

Remember how in the previous section you needed to find a secure way to send your Symmetric Key to the recipient of your message? Public-Key Encryption solves the key-distribution problem!

¿Recuerdas cómo en la sección anterior necesitabas encontrar una forma segura de enviar tu Clave Simétrica al destinatario de tu mensaje? ¡El Cifrado de Clave Pública resuelve el problema de la distribución de claves!

Step 1: Generate a Key Pair

Paso 1: Generar un Par de Claves

Generate a pair of matched keys by pressing the button below. You will get a Public Key and a Private Key. You will keep the Private Key to yourself. Unlike the Symmetric Key of the previous section, you never send your Private Key to anyone! The Public Key, however, can be seen by anyone.

Genera un par de claves emparejadas presionando el botón de abajo. Obtendrás una Clave Pública y una Clave Privada. Guardarás la Clave Privada para ti. A diferencia de la Clave Simétrica de la sección anterior, nunca envías tu Clave Privada a nadie! La Clave Pública, sin embargo, puede ser vista por cualquiera.

 

Record these two keys in a safe place.

Guarda estas dos claves en un lugar seguro.

Public and Private Keys are unusual: any message that is encrypted with one of them can be decrypted with the other. However neither key acts like a Symmetric Key. That is, a message never can be decrypted using the same key that encrypted it.

Las Claves Públicas y Privadas son inusuales: cualquier mensaje que se cifre con una de ellas puede ser descifrado con la otra. Sin embargo, ninguna clave actúa como una Clave Simétrica. Es decir, un mensaje nunca puede ser descifrado usando la misma clave que lo cifró.

These keys are used differently depending on what you want to do. You can send a secure message, or you can sign a message. While deciding which key to use for what, remember what I just said, "You never send your Private Key to anyone!" When encrypting and signing, you need to consider the order. Let's look at all of the possibilities.

Estas claves se usan de manera diferente dependiendo de lo que quieras hacer. Puedes enviar un mensaje seguro, o puedes firmar un mensaje. Mientras decides qué clave usar para qué, recuerda lo que acabo de decir, "¡Nunca envías tu Clave Privada a nadie!" Al cifrar y firmar, necesitas considerar el orden. Veamos todas las posibilidades.

Step 2a: (Optional) Sign a Message

Paso 2a: (Opcional) Firmar un Mensaje

Before sending a message, you may want to sign it. By signing a message you are proving to your recipient that the message has come from you. You sign plaintext by encrypting it using your Private Key.

Antes de enviar un mensaje, es posible que desees firmarlo. Al firmar un mensaje, estás demostrando a tu destinatario que el mensaje proviene de ti. Firmas el texto plano cifrándolo usando tu Clave Privada.

 

How is this secure? Anyone can get your Public Key and decrypt the ciphertext! Yes, and that's the point. Signing a message does not protect it. After you sign a message with your Private Key, anyone can show that the message must have been signed by you because they can decrypt it using only your Public Key.

¿Cómo es esto seguro? ¡Cualquiera puede obtener tu Clave Pública y descifrar el texto cifrado! Sí, y esa es la idea. Firmar un mensaje no lo protege. Después de que firmes un mensaje con tu Clave Privada, cualquiera puede demostrar que el mensaje debe haber sido firmado por ti porque pueden descifrarlo usando solo tu Clave Pública.

Step 2b: Encrypt a Message

Paso 2b: Cifrar un Mensaje

When sending a message to someone, encrypt it using their Public Key. Remember that a message never can be decrypted using the same key that encrypted it, and so once a message is encrypted with someone's Public Key, it can be decrypted only using the matching Private Key.

Al enviar un mensaje a alguien, cifralo usando la Clave Pública de esa persona. Recuerda que un mensaje nunca puede ser descifrado usando la misma clave que lo cifró, y por lo tanto, una vez que un mensaje se cifra con la Clave Pública de alguien, solo puede ser descifrado usando la Clave Privada correspondiente.

 

Send the ciphertext to your recipient. They will follow Step 3 to decrypt the ciphertext.

Envía el texto cifrado a tu destinatario. Ellos seguirán el Paso 3 para descifrar el texto cifrado.

Step 3a: Decrypt a Message

Paso 3a: Descifrar un Mensaje

Did you just receive a message from someone else? Then follow this step. If you are sending a message, then follow the steps 2a and 2b instead. The sender already has encrypted the message using your Public Key, and so you decrypt it using your Private Key.

¿Acabas de recibir un mensaje de otra persona? Entonces sigue este paso. Si estás enviando un mensaje, sigue los pasos 2a y 2b en su lugar. El remitente ya ha cifrado el mensaje usando tu Clave Pública, por lo que lo descifras usando tu Clave Privada.

 

If you still can't read the decrypted message, it may be signed. So go to the next step (enable advanced mode).

Si aún no puedes leer el mensaje descifrado, puede estar firmado. Así que ve al siguiente paso (activa el modo avanzado).

Step 3b: (Optional) Verify a Signature

Paso 3b: (Opcional) Verificar una Firma

Someone claims that they have sent you a message? Confirm their signature by decrypting the message using their Public Key.

¿Alguien afirma que te ha enviado un mensaje? Confirma su firma descifrando el mensaje usando la Clave Pública de esa persona.

 

Realize that when we say we "verify a signature," really we are removing a layer of encryption from the entire message. There is no separate signature appended to the message—a signature in the form of encryption has been applied to the entire message.

Date cuenta de que cuando decimos que "verificamos una firma," realmente estamos eliminando una capa de cifrado de todo el mensaje. No hay una firma separada adjunta al mensaje—una firma en forma de cifrado se ha aplicado a todo el mensaje.

The four steps 2a–2b and 3a–3b above are not all applied to each message! Instead, you apply the steps depending on what you need to do. When sending a signed message, you do steps 2a and 2b, in that order. When receiving a signed message, you do steps 3a and 3b, in that order. Consider for a moment why the order is important.

Los cuatro pasos 2a–2b y 3a–3b anteriores no se aplican todos a cada mensaje! En su lugar, aplicas los pasos dependiendo de lo que necesites hacer. Al enviar un mensaje firmado, haces los pasos 2a y 2b, en ese orden. Al recibir un mensaje firmado, haces los pasos 3a y 3b, en ese orden. Considera por un momento por qué el orden es importante.

Step 2a signs a message, and step 2b protects the message and the signature. So the protection must be applied second. Similarly, when decrypting someone else's signed message, their signature is protected along with the message, and so you decrypt the ciphertext first, and then you verify their signature.

El paso 2a firma un mensaje, y el paso 2b protege el mensaje y la firma. Por lo tanto, la protección debe aplicarse en segundo lugar. De manera similar, al descifrar el mensaje firmado de otra persona, su firma está protegida junto con el mensaje, por lo que descifras el texto cifrado primero, y luego verificas su firma.

Consider what could happen if you encrypted a message first and then signed it. Signing last is a bad idea because someone could remove your signature and then add their own, claiming that the message came from them. So we always encrypt last.

Considera lo que podría suceder si cifraras un mensaje primero y luego lo firmaras. Firmar al final es una mala idea porque alguien podría eliminar tu firma y luego agregar la suya, afirmando que el mensaje proviene de ellos. Por eso siempre ciframos al final.

Practice

Práctica

3. Generate a public/private key pair, and share just the Public Key with a friend.

3. Genera un par de claves pública/privada y comparte solo la Clave Pública con un amigo.

4. Have your friend do the same, sharing just their Public Key with you. At this point, you each have your own Private Key and the other's Public Key.

4. Haz que tu amigo haga lo mismo, compartiendo solo su Clave Pública contigo. En este punto, cada uno tiene su propia Clave Privada y la Clave Pública del otro.

5. Exchange unsigned messages. The sender uses just step 2b, and the recipient uses just step 3a.

5. Intercambia mensajes no firmados. El remitente usa solo el paso 2b, y el destinatario usa solo el paso 3a.

6. Note that you can't decrypt a message unless you use the proper key. Encrypt a message to your friend using their Public Key, but don't send it yet. Can you decrypt the ciphertext using their Public Key?

6. Ten en cuenta que no puedes descifrar un mensaje a menos que uses la clave adecuada. Cifra un mensaje para tu amigo usando su Clave Pública, pero no lo envíes aún. ¿Puedes descifrar el texto cifrado usando su Clave Pública?

7. Now exchange signed messages. The sender uses steps 2a and 2b, and the recipient uses steps 3a and 3b.

7. Ahora intercambia mensajes firmados. El remitente usa los pasos 2a y 2b, y el destinatario usa los pasos 3a y 3b.


Copyright © 2014–2023 Kerry Veenstra
Multi-language support and translation to Spanish by Javier Peletier