Symmetric encryption · 대칭 암호화(Symmetric encryption)
Locking with a key
- Encryption scrambles a message so only someone with the key can read it.
- In symmetric encryption, the same key locks and unlocks. Sender and receiver must both know it.
키를 통한 잠금
- 암호화는 메시지를 난독화하여 키를 가진 사람만이 읽을 수 있게 합니다.
- 대칭 암호화에서는 같은 키로 잠그고 엽니다. sender와 receiver 양쪽 모두 해당 키를 알아야 합니다.
The Caesar cipher
- The oldest example: shift every letter forward by a fixed number. With shift 3,
a → d,b → e, and so on. - The key is the shift. Decrypting just shifts back.
세사르 암호법
- 가장 오래된 예시입니다: 모든 문자를 고정된 개수만큼 앞으로 이동시킵니다. 이동량에 따라 3,
a → d,b → e등이 됩니다. - 키는 이동량입니다. 복호화는 단순히 반대로 이동시키는 것입니다.
text = "attack"
shift = 3
out = "".join(chr((ord(c) - 97 + shift) % 26 + 97) for c in text)
print(out) # dwwdfn
Why Caesar is weak
- There are only 25 possible shifts, so a computer can try them all in a blink.
- This is a brute-force attack on the key — exactly what real encryption must resist.
세사르 암호법이 약한 이유
- 가능한 이동의 경우의 수는 총 25가지뿐이므로, 컴퓨터는 순식간에 모든 경우를 테스트할 수 있습니다.
- 이는 키에 대한 브루트 포스 공격으로, 실제 암호화가 견뎌내야 할 방식과 정확히 동일합니다.
What real ciphers do
- Modern symmetric ciphers like AES use keys with billions of billions of possibilities.
- The big problem they leave: how do two people share the secret key safely? The next lesson solves it.
Covers: IGCSE 2.3 (symmetric encryption), A-Level 17.1.
실제 암호화가 수행하는 일
- AES와 같은 현대 대칭 암호화는 수억억 가지 이상의 가능성을 가진 키를 사용합니다.
- 그들이 남기는 큰 문제: 두 사람이 어떻게 안전하게 공유密钥를 공유할 것인가? 다음 수업에서 이를 해결합니다.
다루는 내용: IGCSE 2.3 (대칭 암호화), A-Level 17.1.
Common mistakes
- One shared key both encrypts and decrypts.
- The hard part is sharing that key safely.
흔한 실수
- 하나의 공유密钥로 암호화와 복호화를 모두 수행합니다.
- 이密钥를 안전하게 공유하는 것이 어려운 부분입니다.
Symmetric encryption · 대칭 암호화(Symmetric encryption)
The Caesar cipher uses one shared key to encrypt and decrypt. · Caesar 암호는 하나의 공유 키를 사용하여 암호화와 복호화를 수행합니다.
Encrypt hello with a Caesar cipher: shift each letter forward by shift places (wrapping past z back to a). Build the encrypted string and print it. · hello를 Caesar 암호로 암호화하십시오: 각 문자를 shift자리 뒤로 이동시키십시오(z를 넘어 a로 감싸임). 암호화된 문자열을 만들고 출력하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Now break it — that is why Caesar is weak. You intercepted cipher, and you suspect the plaintext is attack. Try every shift from 1 to 25, shifting back, and print the shift that turns cipher into attack. · 이제 해킹해 보십시오 — 이것이 쐬사르 암호의 약점입니다. cipher을 탈취했으며, 평문이 attack임을 추측합니다. 1부터 25까지 모든 이동 값을 뒤로 적용하여, cipher을 attack으로 만드는 이동 값을 찾아 출력하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.