Asymmetric encryption · 비대칭 암호화(Asymmetric encryption)
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.
하나의密钥 대신 두 개의密钥
- 대칭 암호화에는 문제가 있습니다: 먼저 공유密钥를 무언가方式으로 공유해야 합니다.
- 비대칭 암호화는 키 쌍을 사용합니다: 공용密钥와 비밀钥.
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.
자물쇠의 개념
- 당신의 공용 키는 모든 사람에게 내어주는 열린 자물쇠와 같습니다.
- 누구나 이 자물쇠로 메시지를 잠글 수 있지만, 이를 여는 것은 오직 당신의 개인 키만이 가능합니다.
- 즉, 사람들은 비밀 키를 절대 공유하지 않고도 안전하게 비밀을 전달할 수 있습니다. 이것이 혁신입니다.
A tiny RSA
- RSA is real asymmetric encryption. With tiny numbers you can see it work:
- Encrypting and decrypting use different keys, yet the message comes back.
작은 RSA
- RSA는 실제 비대칭 암호화 방식입니다. 작은 숫자를 사용하여 작동 원리를 확인해 볼 수 있습니다:
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
- 복호화와 호환에는 서로 다른 키가 사용되지만, 메시지는 원래대로 복원됩니다.
Where you use it daily
- It also works in reverse for digital signatures (next lessons).
- Every time you see HTTPS, asymmetric encryption is quietly setting up a secure connection.
Covers: IGCSE 2.3 (asymmetric, public/private keys), A-Level 17.1, AP CSP.
일상에서 사용하는 곳
- 또한 디지털 서명(다음 수업)에도 역으로 적용됩니다.
- HTTPS를 볼 때마다, 비대칭 암호화가 배경에서 안전한 연결을 설정하고 있습니다.
내용: IGCSE 2.3 (비대칭, 공용/개인 키), A-Level 17.1, AP CSP.
Common mistakes
- A public key encrypts; only the matching private key decrypts.
- Never share the private key.
흔한 실수
- 공용密钥로 암호화하고, 일치하는 비밀钥만으로 복호화합니다.
- 개인 키는 절대 공유해서는 안 됩니다.
Public & private keys · 공钥 및 사钥
Anyone encrypts with your public key; only your private key decrypts. · 누구든 공钥으로 암호화할 수 있으며, 오직 사钥으로만 복호화할 수 있습니다.
Here is a tiny RSA with public key (e, n) and private key (d, n). Encrypt message with the public key (cipher = message**e % n), then decrypt with the private key (plain = cipher**d % n). Print plain — it should return to the original. · 여기公開密钥이 (e, n)이고 개인密钥이 (d, n)인 초소형 RSA가 있습니다. message을 공개密钥(cipher = message**e % n)으로 암호화한 후 개인密钥(plain = cipher**d % n)으로 복호화하십시오. plain을 출력하십시오 — 원래 값으로 되돌아와야 합니다.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
The same keys also work in reverse — that is a digital signature. Sign with the private key (sig = message**d % n), then let anyone verify with the public key (sig**e % n). Print whether the verified value equals message. · 같은 키로 반대 방향으로도 작동합니다 — 이것이 디지털 서명입니다. 사钥(sig = message**d % n)으로 서명하고, 누구나 공钥(sig**e % n)로 검증하게 하세요. 검증된 값이 message과 같은지 출력하세요.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.