Suas escolhas de privacidade

O KiwiBee usa cookies opcionais do Google Analytics, Google Ads e Meta Pixel para entender os visitantes adultos, medir cadastros concluídos e melhorar as campanhas. Os cookies essenciais ficam sempre ativos. O Pixel de anúncios do ChatGPT da OpenAI também mede visitas e consultas enviadas após o consentimento publicitário e pode usar dados de contato com hash para correspondência. Política de privacidade

Pular para o conteúdo principal

Cryptography & Key Exchange

Sobre esta simulação

[Pt] Cryptography & Key Exchange demystifies the mathematics protecting modern internet security. Three illuminated stations represent Alice (left), Eve the Eavesdropper monitoring the public channel (center), and Bob (right). In Diffie–Hellman mode, Alice mixes her secret integer a with the public generator g and prime modulus p to send A = gᵃ mod p across the bridge, while Bob sends B = gᵇ mod p. Even though Eve intercepts g, p, A, and B on her modular arithmetic clock ring, she faces the hard Discrete Logarithm Problem, whereas Alice computes Bᵃ mod p and Bob computes Aᵇ mod p to unlock the exact same glowing shared secret S = gᵃᵇ mod p. Switching to RSA mode shows asymmetric encryption C = Mᵉ mod n and decryption M = Cᵈ mod n.

O que os alunos podem explorar

  • [Pt] Drag or click Alice's blue private key crystal (a) or Bob's green private key crystal (b) and verify that both top vaults always light up with the exact same Shared Secret number and color!
  • [Pt] Inspect Eve's Public Channel readout in the center to see everything crossing the wire (g, p, A, B), and notice why knowing gᵃ mod p does not directly reveal a.
  • [Pt] Switch Prime modulus p between 23, 19, and 29 and watch the central Modular Clock hand jump to the new remainder S mod p.
  • [Pt] Change Protocol to RSA Public/Private Padlock and adjust Alice's message M to watch it encrypt into ciphertext C = M³ mod 33 over the public bridge and decrypt back to M at Bob's station.
  • [Pt] Drag Eve's red interceptor orb in the center to scrub the travelling public courier packets back and forth between Alice and Bob.

Objetivos de aprendizagem

  1. 1[Pt] Trace the four steps of the Diffie–Hellman key exchange using modular exponentiation gᵃ mod p and gᵇ mod p.
  2. 2[Pt] Prove algebraically why Alice and Bob arrive at the same shared secret: (gᵇ)ᵃ mod p = (gᵃ)ᵇ mod p = gᵃᵇ mod p.
  3. 3[Pt] Explain why modular exponentiation acts as a one-way trapdoor function (easy forward, hard to invert via discrete logarithms).
  4. 4[Pt] Contrast symmetric key establishment (Diffie–Hellman) with asymmetric public/private padlock encryption (RSA).

Perguntas frequentes dos professores

[Pt] How can Alice and Bob agree on a secret key when Eve sees every message they send?

[Pt] They never send their private numbers a or b. Instead, they send the mixed modular results A = gᵃ mod p and B = gᵇ mod p. Because raising to a power modulo p wraps around the clock ring repeatedly, Eve cannot easily undo A to find a, yet Alice and Bob can each apply their own secret power to the other's public number to reach gᵃᵇ mod p.

What is the Discrete Logarithm Problem?

[Pt] Computing gᵃ mod p is fast even for 2048-bit numbers, but given g, p, and the remainder A = gᵃ mod p, finding the exponent a requires searching through an astronomical number of possibilities when p is a large prime.

[Pt] Why does this simulation use small primes like p = 23 instead of huge primes?

[Pt] Small primes like p = 23 let you verify every calculation by hand (for example, 5⁶ mod 23 = 15625 mod 23 = 8). Real TLS connections use the exact same equation with primes hundreds of digits long so Eve cannot brute-force them.

How does RSA differ from Diffie–Hellman?

[Pt] Diffie–Hellman lets two parties jointly create a shared secret key. RSA is an asymmetric padlock: Bob publishes a public lock (e, n) that anyone like Alice can snap shut on a message (C = Mᵉ mod n), while only Bob holds the private key d needed to open it (M = Cᵈ mod n).

Incorporar esta simulação

Coloque no seu AVA, blog ou site da turma — de graça.

<iframe src="https://kiwibee.io/pt/simulations/public-key-cryptography-diffie-hellman-3d-simulation/embed" title="Cryptography &amp; Key Exchange | KiwiBee" loading="lazy" allowfullscreen style="width:100%;height:min(70vh,620px);min-height:420px;border:0;border-radius:16px"></iframe>

Continue explorando

Leve a ciência interativa para a sua sala de aula

O espaço gratuito do professor da KiwiBee reúne em um só lugar o planejamento de aulas, as atividades, as ferramentas de sala e o diário de classe.

Comece grátis e crie sua primeira turma

ou conheça o espaço do professor →