You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

2 Días
0 Hrs
21 Min
37 Seg

Glosario criptográfico

8/27
Resources

Talking about cryptography can be quite complex, mathematically, but it is essential to understand cryptography to be a good blockchain developer. You will see that you don't need a great deal of mathematical knowledge. Fundamentally knowing how the algorithms work will be enough for you to progress and succeed.

Difference between Hash and Signature

Two of the most commonly used words in the crypto world are "hash" and "signature". Often, and incorrectly, used as synonyms. A good starting point for an introduction to cryptography is to understand the difference between these two terms.

Encryption is divided into two main families of algorithms: symmetric and asymmetric.

Symmetric encryption algorithms

Symmetric encryption algorithms use a "key", usually created from a mapping between letters, numbers, other algorithms, or a seed to generate random keys. This key will be used for both encryption and decryption of a given text. That is, anyone in possession of the key will be able to encrypt and decrypt anything.

Asymmetric encryption algorithms

On the other hand, asymmetric encryption algorithms work on the basis of public and private keys. The operation is simple: the public key allows encryption, but not decryption. The private key is the only one that can decrypt information previously encrypted with the public key.

The public key is derived from the private key using complex algorithms. The public key can be obtained from the private key, but it is not possible to obtain the private key from the public key. Hence the importance of meticulously guarding the private key, and for this reason the private key is "private".

In this way, public and private key algorithms revolutionized cryptography and managed to build great security mechanisms on the basis of cryptography. Such as blockchain.

Hashing of information

The hashing process is similar to data encryption, but with important differences to understand. Both processes, hashing and encryption, derive in an unreadable and alphanumeric text that protects information on the back. The main difference is that in encryption it is possible to reverse the process, with the private key. In hashing, it is not possible to reverse the result.

Hashing is deterministic; this means that, given an input, we will always receive the same output. This allows us, for example, to verify the integrity of the information. If we hash a PDF, we will get a hash that represents it. If a single byte of the PDF is modified, we will get a completely different hash.

Another great feature of hashing algorithms is the reduction of the size of the information. Regardless of the size of what is to be hashed, we will get a 32-byte hash. This makes hashing irreversible, since, as we lose information, it is not possible to recover the original content.

Digital signature

Digital signature is a slightly more complex cryptographic process that combines encryption and hashing concepts. It is often used for authentication purposes, where a user signs a hash with his private key.

Let's analyze what happens in a digital signature: we know that the hash of a text has a certain length and is irreversible. This hash is signed, but this time the private key of a set of keys is used. Unlike asymmetric encryption, where we used the public key.

(original text -> hash) + private key = signature

Through the resulting signature, it is possible to prove that a person signed a certain information and that he/she agrees with it. The text that is hashed before signing with the private key, can be a simple "hello world" or a whole blockchain transaction.

This information that we sign using the key pair is recoverable, but actually hiding the information is not what we are interested in at this point. Rather, using this signature for authority purposes, being able to verify that a certain user signed a previously hashed content.

Verification of digital signatures

The importance of digital signatures is their verification. Knowing the original message, it is hashed again with the same algorithm that was used to be signed. Combining this data with the signature itself, through mathematical processes, we can obtain the public key of the user who signed the message with his private key. Without the need to reveal it.

(original text -> hash) + signature = public key

In this way, we manage to verify that a user agrees with what may be a text message, or authorized an entire blockchain transaction to move funds between wallets.

Conclusion

The basis of how cryptography works in blockchian is through public and private keys, hashes and digital signatures.

You may have noticed throughout this class that we did not need to understand complex mathematical formulas. Just conceptually analyzing what happens to information when it is hashed or encrypted is enough for you as a future blockchain developer.


Contributed by: Kevin Fiorentino (Platzi Contributor).

Contributions 12

Questions 1

Sort by:

Want to see more contributions, questions and answers from the community?

La encripcion es el proceso de tomar un texto plano, pasarlo por un algoritmo y obtener un texto cifrado como resultado. Hay algunas caracteristicas para tomar en tomar en cuenta:

  • El algoritmo utiliza un tipo de llave (que suele ser un mapeo entre letras, clave o numero) que sirve como seed para que el algoritmo pueda hacer mas dificil de descifrar el resultado. Dicho esto la misma llave CIFRA y DESCIFRA. esto es ENCRIPCION SIMETRICA.
  • La ENCRIPCION ASIMETRICA en donde tenemos un par de llaves. Ayuda a encriptar informacion y sirve tambien para firmas digitales. Aqui se parte de la generacion de una llave privada cuyo origen debe ser de una fuente confiable y todo el modelo de seguridad se basa en que nadie conozca esta llave privada. De esta misma se aplica una operacion matematica para generar la llave publica. Una vez con la llave publica se repite el mismo procedimiento para cifrar o descifrar. La gran diferencia en este modelo es que no será posible para todos descifrar el contenido, para recuperar la informacion inicial sera necesario conocer la llave privada.
  • Hashing: No se asemeja en nada al cifrado. El hashing es determinista porque siempre genera el mismo output con la misma entrada y es de tamaño fijo. Sin embargo no podemos regresar la funcion de hashing del resultado a su input inicial. Se suele utilizar como verificacion de integridad comparando hashes. Un hash reduce el campo de resultado y se pierde informacion en el proceso.
  • Firma Digital: es muy similar al concepto de hash. Recibe de input un texto plano, se hashea y se obtiene un hash de tamaño fijo. Se utiliza un algoritmo de firma digital que genera una firma. Esta firma es una pieza criptografica que valida el contenido ingresado inicialmente. El algoritmo de firma digital particularmente estara utilizando la llave privada. Lo que interesa no es esconder la informacion del hash sino presentar autoridad sobre la informacion. Es una forma de asegurarnos q alguien estuvo de acuerdo con un contenido

Que es la criptografia?

  • Practica que consiste en proteger informacion mediante el uso de algoritmos codificados.
  • El origen de la criptografia se remonta a los jeroglificos.

La criptografia tiene 3 estados

  1. Reposo: Como un archivo en disco duro
  2. Transito: Comunicandose entre 2 puertos
  3. Uso: Mientras ejecuta operaciones de computo con los datos.

La criptografia tiene 4 objetivos principales:

  1. Confidencialidad: Poner la informacion unicamente a un autorizado.
  2. Integridad: Asegurar que la informacion no se ha manipulado.
  3. Autenticidad: Confirmar la autenticidad del usuario y/o informacion.
  4. No repudio: Evitar que un usuario deniegue compromisos o acciones previas.

Una clase muy potente! me gusto como lo explico.

¡Vi la luz con esta clase!!

Solo una acotación, por favor no traduzcan literal del inglés, **no existe** la palabra "**encripción**" en español, la traducción de **encrypt o encription** es **encriptación o cifrado**.
  • hash + llave privada = firma (proceso de firma)
  • hash + firma = llave pública (verificación de firma)

Un caso de uso en la vida real de un hash:
En lugar de guardar las contraseñas en texto plano, se aplica una función de hash a cada contraseña y se guarda el resultado. Cuando un usuario ingresa su contraseña, se aplica la misma función de hash y se compara con el valor almacenado para verificar la autenticidad, sin revelar la contraseña real en caso de una violación de seguridad.

Ernesto es muy buen profesor, todos sus cursos o charlas son muy buenos.

Ernesto es el mejor docente que encontrarán en la escuela de blockchain de Platzi. Gran explicación!

Una firma digital es un mecanismo que garantiza la autenticidad e integridad de un mensaje o documento. Por ejemplo: 1. **Firma de correos electrónicos**: Cuando envías un correo, puedes usar tu firma digital para verificar que realmente eres tú quien envía el mensaje. 2. **Transacciones de criptomonedas**: Al enviar criptomonedas, tu firma digital asegura que tú, como propietario de la wallet, autorizas la transacción. 3. **Documentos legales**: Al firmar digitalmente un contrato, se utiliza tu clave privada para crear una firma que puede ser verificada por la parte receptora usando tu clave pública. Estos ejemplos ilustran el uso de firmas digitales en diversas aplicaciones.

Muy buena Explicación. Excelente

Realmente conocia la terminologia de forma muy general, garcias por aclararnos sus diferencias.