What is and how is asymmetric cryptography defined

Asymmetric cryptography is a computer security encryption system, also called public and private key.

Asymmetric cryptography is a system used in computer security to encode and decode messages. Cryptography, in fact, is a mathematical discipline capable of encoding, through algorithms, information to make it inaccessible except with a key. Asymmetric cryptography uses two encryption keys: a public key and a private key.

What are public key and private key

Asymmetric cryptography is also called public private key. The public key allows access to anyone who needs to change information with the owning entity. The private key, on the other hand, is guarded and kept secret by the rightful owner. How do these keys work? Basically, whenever a message is encrypted with one of the two keys, it can only be decrypted using the corresponding key. Keep in mind that, knowing one of the two keys, does not allow you to trace the other.

Differences between symmetric and asymmetric encryption

Let's see now what are the main differences between symmetric and asymmetric encryption. The first difference between these two systems relates to the keys. Symmetric encryption uses only private keys, while, as we saw earlier, asymmetric encryption uses a public encryption key and a private encryption key.

In the symmetric encryption system, the same key is used for both encryption and decryption operations. In this case, the security lies in the length of the key that is used and the ability to keep it secret. In a symmetric encryption process, it is possible to use keys as long as the message, which makes the message itself very secure. This system, however, has a disadvantage, which is the need to have to exchange keys in a secure manner.

With asymmetric encryption, on the other hand, there is no need to exchange keys prior to any communication. In a public-key encryption process, there is no need to worry about key exchange, because the algorithms that are used do not allow the private key to be traced from a public key. Asymmetric cryptography lends itself to several uses.

An example of asymmetric cryptography

Digital signature is an example of asymmetric cryptography. The two keys are used to verify the authenticity of the sender and the integrity of the document being signed. Per creare una firma digitale occorre prima di tutto estrarre dal documento quella che viene chiamata impronta digitale, ovvero una stringa di dati che si ottiene da un algoritmo di hash. Questo algoritmo è in grado di sintetizza il testo in modo univoco.

Poi, l’impronta digitale viene criptata attraverso la chiave privata e si ottiene la firma digitale. L’impronta digitale, chiamata anche digest, può essere decodificata da chi riceve il documento tramite la chiave pubblica e confrontata con quella prodotta da lui in base al documento ricevuto, per verificarne l’autenticità e l’integrità.

Ecco quali sono i passaggi necessari per utilizzare la firma digitale:

  • il mittente crea una coppia composta dalla chiave pubblica e dalla chiave privata;
  • il mittente dà al destinatario la propria chiave pubblica;
  • il mittente scrive un messaggio che inserisce in una funzione hash. In uscita si ha un output di lunghezza fissa: il digest;
  • il mittente codifica il digest con la sua chiave e ottiene la sua firma digitale;
  • il mittente spedisce il documento e la firma digitale;
  • il ricevente separa il documento e la firma digitale;
  • il ricevente utilizza la chiave pubblica per decifrare la firma digitale e ottiene il digest;
  • il ricevente utilizza la stessa funzione hash del mittente sul messaggio e ottiene un nuovo digest;
  • il ricevente verifica i due digest assicurandosi che il messaggio non sia stato alterato e verifica l’autenticità del mittente.

Altri utilizzi della cifratura asimmetrica

Un altro esempio di utilizzo della cifratura asimmetrica è rappresentato dal programma Pretty Good Privacy, che serve ad inviare messaggi protetti combinando insieme gli algoritmi di crittografia simmetrica ed asimmetrica. Typically, someone who wants to receive a PGP message will make public their asymmetric key, which is an RSA public key.

Now you know what's behind the digital signature and other systems that use asymmetric encryption to keep your documents secure when you send them.