# The Basic Functionality of a Public-Key Cryptosystem

Let's learn how the public-key cryptosystems work and how digital signatures help to provide data integrity.

## Key generation

The revolutionary proposal by Diffie and Hellman is based on the idea that Alice and Bob no longer use the same key, but two different keys. This happens with the use of an asymmetric cryptosystem, which consists of two pieces of a pair of complementary keys, namely a private key $k_{p r i v}$ and a public key $k_{p u b}$. If any plaintext $m$ was encrypted into ciphertext $c$ with one of these keys, it can only be decrypted again into plaintext $m$ with the other key, and vice versa.

The figure below illustrates the basic scheme of the two corresponding keys $k_{\text {priv }}$ and $k_{p u b}$, where both of them can be used for encryption or decryption. If encryption of asymmetric keys in public-key cryptography plaintext into ciphertext happened by $k_{\text {priv }}$, then decryption back into plaintext can only happen by using $k_{p u b}$ and vice versa.

Hence, the key pair is mathematically related. We’ll outline in the following section how this key pair is to be used in a public-key cryptosystem.

### Figure 1

Get hands-on with 1200+ tech skills courses.