Olujoba Kolawole
2 min readNov 15, 2023

Practical Asymmetric Cryptography — Example with Alice and Bob

The storyline of a file transfer between Alice and Bob involves a series of steps to ensure the secure and successful exchange of a file. In asymmetric (public key) cryptography, both communicating parties , Alice and Bob have two keys of their own , that is four keys total. Each party has their own public key, which they share with the world, and their own private key which they keep private and as a closely guarded secret. The file transfer between Alice and Bob will follow this process.

1.File Encryption (Alice’s Perspective): Alice wants to send a sensitive file to Bob. She uses Bob’s public key to encrypt the file. Now, only Bob, possessing the corresponding private key, can decrypt and access the original content.

2.Encrypted File Transmission: Alice sends the encrypted file to Bob through an insecure channel, such as the internet or an email. Even if an eavesdropper intercepts the file during transmission, they won’t be able to decrypt it without Bob’s private key.

3.File Reception (Bob’s Perspective): Bob receives the encrypted file. Since he is the only one with the private key corresponding to the public key used for encryption, he can decrypt the file and access its original content. See illustration in Figure 1.

4.Authentication (Optional): If Alice wants to prove that the file truly comes from her and hasn’t been tampered with, she can sign the file using her private key. Bob, using Alice’s public key, can verify the signature to ensure the file’s authenticity and integrity.

5.Acknowledgment: After successfully decrypting the file, Bob sends an acknowledgment to Alice, confirming the receipt and, if applicable, the verification of the file’s authenticity.

6.Private Key Protection: Throughout the process, both Alice and Bob need to ensure the security of their private keys. Private keys should be stored securely to prevent unauthorized access or misuse.

This storyline illustrates how asymmetric cryptography allows secure file transfer between Alice and Bob. The public key is used for encryption, enabling anyone to send confidential information to Bob securely.
However, only Bob, with the corresponding private key, can decrypt and access the original content. Additionally, the option for Alice to sign the file provides an added layer of security and authenticity verification. The security of the system relies on the confidentiality of the private keys and the mathematical relationship between the public and private keys.

Illustration Figure 1 showing sequence of action in transferring message from Alice to Bob using asymmetric cryptography.