AES encryption, what are public and private keys?

YOYO picture YOYO · Nov 7, 2008 · Viewed 83.6k times · Source

In AES encryption (.net framework), how are the public and private keys used?

Are the public and private keys combined to form a full key, and then the algorithm uses the public + private key to encrypt the data?

(simplified keys used below for example purposes)

e.g. public key = 12345 private key = 67890

so the key used when generating the encryption result is: 1234567890

Answer

HTTP 410 picture HTTP 410 · Nov 7, 2008

As others have said, AES is a symmetric algorithm (private-key cryptography). This involves a single key which is a shared secret between the sender and recipient. An analogy is a locked mailbox without a mail slot. Anybody who wants to leave or read a message needs to have a key to the mailbox.

If you really want to know the gory details of AES, there's a superb cartoon to guide you along the way.

Public-key cryptography involves two related keys for each recipient involved - a private key which is a secret known only by the recipient, and a related public key which is known by all senders.

The sender encrypts the message using the recipient's public key. That message can only be decrypted by a recipient with a private key matching the public key.

An analogy for public-key encryption is a locked mailbox with a mail slot. The mail slot is exposed and accessible to the public. Its location (the street address) is the public key. Anyone knowing the street address can go to the door and drop a written message through the slot. But only the person who possesses the private key can open the mailbox and read the message.