Symmetric Encryption vs Public Key Encryption

This entry is part 4 of 7 in the series Computer Network Security
How many keys are involved for symmetric key encryption? How about public key encryption?

Suppose you have N people who want to communicate with each other using symmetric keys. All communication between any two people, i and j, is visible to group N. Only person i and person j can decrypt each others messages.

How many keys would Symmetric Encryption require to protect group N?

I solved this with the following python function:

def count_symmetric_keys( N=2 ):
    """Provide the number of entities in group N.
    return the number of symmetric keys needed for this group"""
    keys = 0
    for i in range( 0, N ): keys += i
    return keys
A reader suggested the following optimized formula:
def calc_symmetric_keys( N=2 ):
    """Provide the number of entities in group N.
    return the number of symmetric keys needed for this group"""
    return N*(N-1)/2

If group N had 10 members, it would need to generate and maintain 45 Symmetric Keys.

If group N had 50 members, it would need to generate and maintain 1225 Symmetric Keys.

Symmetric keys are also susceptible to man-in-the-middle attacks. This attack occurs when an entity poses as a trusted entity. Let i and j be trusted entities. Let k be an untrusted attacker. If k determined the Symmetric key it could send or receive messages posing as i or j.

How many keys would Public-key Encryption require to protect group N?

Public Key Encryption requires 2n keys or two keys per person in group N. Public key encryption also does not require ‘pre sharing’ the secret key before communication may start. Each member would need 1 public key and 1 private key.

If group N had 10 members, it would need to generate and maintain 20 Public/Private Keys.

If group N had 50 members, it would need to generate and maintain 100 Public/Private Keys.

Series NavigationAttributes of an 8-block cipherWhy does a Hash provide better message integrity then an Internet checksum?

3 thoughts on “Symmetric Encryption vs Public Key Encryption

  1. Looks like you made a typo or Python calculated it wrong:

    n(n-1)/2= keys needed

    50(50-1)/2= 1,225 symmetric keys needed.

    I thought I didn’t have the formula correct when I first saw your article, but I double checked it. Thanks for helping me learn that formula even better! ;)

Leave a Reply

Your email address will not be published. Required fields are marked *