public and private key

Teaching School Kids about Public and Private Key

Cryptography is an interesting subject for all ages probably because of the mystery and secrecy that surrounds it. School teachers can come up with different games and interesting ways to teach their students about the various concepts related to it. Public and private key are two of the most important concepts. defines public key as: 

“a cryptographic key that can be obtained and used by anyone to encrypt messages intended for a particular recipient, such that the encrypted messages can be deciphered only by using a second key that is known only to the recipient (the private key ).”

Every crypto wallet/account, where you can hold your digital currencies, comes with a public and private key. So, anyone can just use their public key to disguise or camouflage their message by encoding it via cryptographic algorithms. The user (sender) need not have knowledge of how these complex algorithms work. Instead, they simply need to know how to use an online wallet, like the one offered by the Waves Platform.

Bitcoin Wiki offers a rather simple definition of private key:

“A private key in the context of Bitcoin is a secret number that allows bitcoins to be spent. Every Bitcoin wallet contains one or more private keys, which are saved in the wallet file. The private keys are mathematically related to all Bitcoin addresses generated for the wallet.”

Here, the definition might be more specific to Bitcoin, but it can be generalized to other cryptocurrencies as well. Also, the “secret number” (private key) can be used to encrypt messages, which is a feature many crypto platforms offer. After carefully going over these concepts with your kiddos, you can start to focus on the differences between public and private key. 

The Difference between Public and Private Key

As a teacher, you need to familiarize your students with these two widely used terms in the world of cryptography.

Public Key

A public key data encryption cannot work alone. Along with the public key, there is a matching private key; the use of both can help decrypt the data. However, the two public and private keys need to be matching for them to work together. Also, a user cannot use the public key in place of the private key. Since, if the private key is made available publicly, then it allows access to the system by anyone. This way all the data and funds can be compromised. The combination of private and public key helps ensure confidentiality for both the parties.

Private Key

The system works in the opposite direction too by the combination of the use of private and public keys. In case of a private key, it helps decrypt data encrypted using a matching public key. Furthermore, data that has been encrypted with a private key can only be decrypted using a matching or similar public key. However, one cannot use the private key in place of the public key. This combination ensures that the receiver of the message knows that the original owner did use a private key to encrypt the message and the communication originates from that person or entity alone. Thus, they would require a matching public key for decrypting it.

The school kids must be taught the cryptographic methods that work behind the working of the public and private key.

Let’s have a look at the two techniques which make the working of private and public key possible.

Symmetric Encryption

Symmetric encryption only uses private keys. One typical example is the encryption of data to store in a secure device. Sometimes, it may also be used to share data securely between two endpoints.

Example of Symmetric Encryption

For example, Bob and Marleen have a chest to which they both have the same key to open it. They are using this chest to exchange secret letters. Marleen puts a secret letter in the chest and closes it to send to Bob to open it. Bob has the same key as Marleen. He can easily open the chest to have access to the secret letter sent to him by Marleen. This demonstrates the principle of symmetric encryption to use the same key for encrypting and decrypting a message.

Asymmetric Encryption

Asymmetric encryption allows anyone to send an encrypted message to a receiver. It relies on cryptographic algorithms to generate a matching pair of private & public keys. The idea is to generate a private key that no one can guess. The public key then may be published using techniques like digital certificates. However, the private key is configured via encryption while keeping it strictly confidential.

Example of Asymmetric Encryption

For asymmetric encryption, you can give the school kids the example of how a bank locker works. When a customer wants to access their locker, they have their own key. However, there is also another key that is only in possession of the bank staff. But, if the customer wants to access the contents of their locker, they cannot use their own key alone to get them. Similarly, the bank staff cannot use the one key that they have for accessing the locker. Both keys are required simultaneously to open the locker. Thus, an added layer of security, due to the combination of both keys, makes the locker a lot more secure.

In a future blog post, we will cover some other concepts like algorithms, and teaching your kids about them in an intuitive manner.

If you enjoyed reading this article, please check out our monthly magazine with 100% original content!