비대칭 암호화(Asymmetric encryption)
이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Two keys instead of one
- Symmetric encryption has a problem: you must somehow share the secret key first.
- Asymmetric encryption uses a pair of keys: a public key and a private key.
English
The padlock idea
- Your public key is like an open padlock you hand out to everyone.
- Anyone can lock a message shut with it — but only your private key can open it.
- So people send you secrets safely without ever sharing a secret key. That is the breakthrough.
English
A tiny RSA
- RSA is real asymmetric encryption. With tiny numbers you can see it work:
n, e, d = 33, 3, 7 # public key (e, n), private key (d, n)
cipher = (7 ** e) % n # lock 7 with the public key
print((cipher ** d) % n) # unlock with the private key -> 7
- Encrypting and decrypting use different keys, yet the message comes back.
English
Where you use it daily
- It also works in reverse for digital signatures (next lessons).
- Every time you see HTTPS, public-key techniques are quietly setting up a secure connection: they prove the site's identity and agree a shared key, then fast symmetric encryption carries the data.
Covers: IGCSE 2.3 (asymmetric, public/private keys), A-Level 17.1, AP CSP.
English
Common mistakes
- A public key encrypts; only the matching private key decrypts.
- Never share the private key.
탐색하기
공용 키 및 개인 키
누구나 당신의 공용 키로 암호화할 수 있으며, 오직 당신의 개인 키만이 복호화할 수 있습니다.
난이도 4/5 · 280코인 + 오늘 첫 완료 시 작은 보너스 추가
여기公開密钥이 (e, n)이고 개인密钥이 (d, n)인 초소형 RSA가 있습니다. message을 공개密钥(cipher = message**e % n)으로 암호화한 후 개인密钥(plain = cipher**d % n)으로 복호화하십시오. plain을 출력하십시오 — 원래 값으로 되돌아와야 합니다.
출력을 보려면 '실행'을 클릭하세요.
난이도 4/5 · 280코인 + 오늘 첫 완료 시 작은 보너스 추가
동일한 키를 반대 방향으로도 사용할 수 있습니다. 이것이 디지털 서명입니다. 개인 키(sig = message**d % n)로 서명하고, 공용 키(sig**e % n)로 누구나 검증할 수 있게 하십시오. 검증된 값이 message과 같은지 출력하십시오.
출력을 보려면 '실행'을 클릭하세요.
난이도 4/5 · 280코인 + 오늘 첫 완료 시 작은 보너스 추가
encrypt(m)을 공용 키로, decrypt(c)을 개인 키로 작성하십시오. n, e, d = 33, 3, 7(c = m ** e % n, m = c ** d % n)을 사용하여 2에서 32까지의 모든 메시지가 변경 없이 반환되도록 하십시오.
출력을 보려면 '실행'을 클릭하세요.