Cryptology Academy · Lesson

Public-Key Cryptography Concepts

Understand key pairs, public distribution, and private-key secrecy.

Lesson 1 of 413 steps

Public-Key Cryptography Concepts is a free Cryptology Academy lesson on CoddyKit. This is lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, and your progress syncs across the web and the CoddyKit app. The Cryptology Academy course includes 4 lessons in total.

Welcome

Public-key cryptography solved the ancient key distribution problem. In this lesson we understand key pairs, public vs private keys, and the trust model.

The Key Distribution Problem

Before 1976, two parties needed to exchange a secret key before communicating securely. This required a secure channel — but if you had a secure channel, why encrypt at all?

The Key Pair Concept

Asymmetric cryptography uses a mathematically linked key pair: public key (shareable with everyone) and private key (never shared). They are inverse operations: Enc(pub, M) → C; Dec(priv, C) → M.

One-Way Trapdoor Function

Public-key crypto relies on trapdoor one-way functions: easy to compute forward (multiply large primes), infeasible to reverse (factor the product) without the trapdoor (the prime factors).

Confidentiality with Public Keys

Alice wants to send Bob a secret: she encrypts with Bob's public key. Only Bob's private key can decrypt. Eve can see Bob's public key but cannot decrypt the message.

Authentication with Private Keys

Bob proves his identity: he signs a message with his private key. Anyone with Bob's public key can verify the signature. Forging requires the private key — infeasible if secure.

Asymmetric vs Symmetric Speed

RSA-2048 encryption: ~100,000× slower than AES-128. This is why asymmetric crypto is only used to encrypt a short symmetric key, then AES handles bulk data. This is hybrid encryption.

Key Pair Generation Overview

RSA: choose two large primes p, q. ECC: choose a random scalar k on an elliptic curve. Both generate a key pair. Private key is the random secret; public key is derived from it.

Trust & Public Key Distribution

How do you know a public key really belongs to Alice? You need a trusted third party: a Certificate Authority (CA) signs Alice's public key, creating a certificate. This is PKI.

Web of Trust

PGP uses a decentralized web of trust: friends sign each other's keys. If you trust Carol and she signed Bob's key, you can trust Bob's key — no central CA required.

Public Key Infrastructure (PKI) Preview

PKI is the infrastructure for issuing, distributing, revoking, and validating public key certificates. TLS relies on PKI. Browser trust stores contain ~150 root CA certificates.

Quick Check

To send an encrypted message that only Bob can read, which key do you encrypt with?

Recap

Public-key concepts are clear! Next we generate RSA keys step by step and trace the mathematical operations.
Free to start

Learn Cryptology Academy with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
67
Lessons
261

Frequently Asked Questions

Is the “Public-Key Cryptography Concepts” lesson free?

Yes — the full text of “Public-Key Cryptography Concepts” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO. The Cryptology Academy course includes 4 lessons in total.

What will I learn in “Public-Key Cryptography Concepts”?

Understand key pairs, public distribution, and private-key secrecy. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.

How long does the “Public-Key Cryptography Concepts” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Public-Key Cryptography Concepts
  2. RSA Key Generation Step by Step
  3. RSA Encryption & Decryption Math
  4. RSA Real-World Use Cases & Key Sizes
← Back to Cryptology Academy