Encryption and hashing
도입됨
12:11
암호화 작동 원리
브라우저 주소 표시줄의 자물쇠를 보세요. 은행 이름을 입력했는데, 어떻게든 노트북이 이제 정말로 은행과 대화하고 있다고 확신합니다—그리고…
영어 내레이션 · 영어와 중국어 자막 전환 가능
이 수업의 내용
| English | 의미 |
|---|---|
| secret key | A value kept private and used to encrypt or decrypt data. |
| symmetric/sɪˈmetrɪk/ | 대칭 |
| Encryption/enˈkrɪpʃn/ | The process of using a key to turn readable data into unreadable data. |
| codebooks | Books containing codes or keys used to protect secret messages. |
| shared secret/ʃeəd ˈsiːkrɪt/ | Confidential information known to authorised parties and used for a purpose such as authentication or encryption. |
| public channel | A way of sending information that other people can listen to. |
| RSA | An encryption method that uses a public key and a matching private key. |
| private key/ˈpraɪvət kiː/ | 사钥 |
| asymmetric/ˌeɪsɪˈmetrɪk/ | 비대칭 |
| one-way function | A process that is easy to perform but very hard to reverse. |
| hashing/ˈhæʃɪŋ/ | The process of calculating an initial record address from a key. |
| plaintext/ˈpleɪntekst/ | 평문 |
| ciphertext/ˈsaɪfətekst/ | 암호문 |
| decrypt/dɪˈkrɪpt/ | 복호화 |
| confidentiality/ˌkɒnfɪˌdenʃiˈæləti/ | Keeping information private so only authorised people can read it. |
| algorithm/ˈælɡərɪθəm/ | A finite sequence of precise steps for solving a problem or carrying out a task. |
| AES/ˌeɪ iː ˈes/ | A fast encryption method that uses the same key to encrypt and decrypt data. |
| key distribution/kiː ˌdɪstrɪˈbjuːʃn/ | Securely providing or establishing the cryptographic keys that communicating parties need. |
| key pair/kiː peə/ | 키 쌍 |
| public key/ˈpʌblɪk kiː/ | 공钥 |
| key exchange | The process of sharing or agreeing a key for secure communication. |
| client/ˈklaɪənt/ | A device or program that requests a service or resource from a server. |
| session key/ˈseʃn kiː/ | 세션 키 |
| server/ˈsɜːvə/ | A computer or program that provides services or resources in response to requests from clients. |
| byte/baɪt/ | A group of eight bits, commonly used as a unit of data storage. |
| HTTPS/ˌeɪtʃ tiː tiː piː ˈes/ | A secure set of rules for transferring web pages and other web content. |
| SSH | A set of rules for securely connecting to and controlling a computer from another location. |
| Diffie–Hellman key agreement | A method for two parties to agree a shared secret over a public channel. |
| cryptographic hash/ˌkrɪptəˈɡræfɪk hæʃ/ | 암호 해시 |
| digest/ˈdaɪdʒest/ | 요약 |
| salted password hashes | Stored values made by hashing passwords with added random data to make guessing harder. |
| database/ˈdeɪtəbeɪs/ | An organised collection of data that can be accessed and managed. |
| integrity/ɪnˈteɡrɪti/ | The accuracy, completeness and protection of data against unauthorised or unintended alteration. |
| message authentication code | A value made using a secret key to check who sent a message and whether it changed. |
| digital signature/ˈdɪdʒɪtl ˈsɪɡnɪtʃə/ | A cryptographic value created with a signing key and checked with a corresponding public key to verify data integrity and signing origin. |
공개된 공간에서 서로 다른 두 사람이 비밀을 합의하기
- 여기 해결하기 불가능해 보이는 문제가 있습니다. 당신은 상점과 한 번도 만나본 적이 없으며 공유하는 것도 없습니다. 당신들끼리 나누는 모든 대화는 모두에게 들립니다. 비밀 키를 합의하십시오.
- Until 1976 the answer was that you cannot: symmetric encryption needs the key delivered in advance, by courier or in person, which is why wartime codebooks were printed and shipped.
- 이후 디피, 헬만, 그리고 나중에 리베스트, 샴미르, 알드먼은 이것이 가능함을 보여주었습니다. 잠금만 하는 하나의 키와 열쇠만 하는 다른 키를 사용하는 방식입니다. 당신이 온라인으로 해온 모든 구매가 이 원리에 기반하고 있습니다.
- 이번 수업에서는 대칭 및 비대칭 암호화, 실제 시스템이 두 방식을 모두 사용하는 이유, 그리고 해싱이라는 일방향 함수를 다룹니다.
어휘
- 암호화는 키를 사용하여 읽을 수 있는 평문 plaintext를 읽을 수 없는 암호문 ciphertext으로 변환합니다. 복호화 decrypt란 적절한 키로 이를 역으로 복원하는 것입니다.
- 암호화는 비밀성 confidentiality을 보호합니다: 도청된 복사본은 이해할 수 없습니다. 그러나 데이터가 도청되거나 지연되거나 삭제되는 것을 막지는 않습니다.
- 강점은 알고리즘을 비공개하는 데 있는 것이 아니라 키에 있습니다. 알고리즘은 공개되어 연구되며, 이는 취약점이 적대자가 아닌 동료들에 의해 발견되도록 하기 위함입니다.
대칭 암호화
- 대칭 암호화는 암호화와 복호화에 같은 키 same key를 사용합니다. AES가 표준 예시입니다.
- 속도가 빠르기 때문에 대용량 데이터 bulk data에 적합합니다: 전체 디스크, 영상 스트림, 대형 파일 등.
- Its weakness is key distribution: the key must reach the other party without being intercepted, and if it is intercepted the whole scheme is broken. With $n$ people who all wish to talk privately in pairs, the number of keys needed grows with the square of $n$.
A shift cipher (symmetric key)
Caesar's cipher shifts every letter forward by a fixed key. The SAME key both encrypts and decrypts — that is what symmetric means. Try to read the ciphertext without knowing the shift.
Symmetric encryption uses:
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Symmetric encryption shares one secret key — fast, but it must be distributed securely.
비대칭 암호화
- 비대칭 암호화는 각 사용자에게 **키 쌍(key pair)**을 제공합니다: 전 세계에 공개하는 **공용 키(public key)**와 절대 공개하지 않는 **비공개 키(private key)**입니다.
- 공용 키로 암호화된 데이터는 오직 해당 비공개 키로만 복호화할 수 있습니다. 따라서 앨리스에게 기밀 메시지를 보내려면 앨리스의 공용 키로 암호화해야 하며, 오직 앨리스만이 이를 읽을 수 있습니다.
- 이전에 키 교환 과정이 필요하지 않다는 점이, 이 수업에서 제기한 문제를 해결합니다. 단점은 속도가 훨씬 느리다는 것이며, 따라서 대용량 데이터에는 적용되지 않습니다.

하나의 키로 잠그고, 다른 하나의 키로 열며, 그중 하나만 비밀으로 유지함
Match each cryptographic tool to what it uses.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Symmetric is fast but needs key sharing; asymmetric solves that with a key pair; hashing is one-way; HTTPS combines them.
To send a confidential message to Alice using asymmetric encryption, you encrypt with:
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Encrypting with the recipient's public key means only their matching private key can decrypt it.
Match each kind of encryption to its main weakness.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
The hybrid scheme uses each to cover the other's weakness: asymmetric to deliver the key, symmetric to carry the data.
worked example: 기밀 메시지 전송
- 비교등 암호화가 보브가 알리스에게, 두 사람이 한 번도 만난 적이 없더라도 기밀 메시지를 어떻게 보낼 수 있는지 설명하십시오. [3]
- 알리스는 누구나 가질 수 있는, 도청자를 포함한 모든 사람에게 공개되는 공개키를 게시합니다.
- 보브는 알리스의 공개키로 메시지를 암호화합니다. 생성된 암호문은 매칭되는 개인키로만 복호화할 수 있습니다.
- Alice decrypts it with her private key, which she has never shared. An eavesdropper holding the public key and the ciphertext cannot recover the message.
- 가장 흔한 오류는 보브가 자신의 키로 암호화한다고 말하는 것입니다. 각 단계에서 어떤 키가 사용되는지 추적해 보십시오.
Bob wants Alice to be sure a message really came from him. Which key does Bob use to create the digital signature?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Only Bob holds his private key, so only he can produce the signature; Alice checks it with Bob's public key. Confidentiality uses the receiver's keys, a signature uses the sender's.
실제로 이루어지는 하이브리드 방식
- 대칭 암호화는 빠르지만 키를 공유할 수 없습니다. 비교등 암호화는 키를 공유할 수 있지만 속도가 느립니다. 실제 시스템에서는 각 방식의 장점을 활용하여 사용합니다.
- The client generates a random session key, encrypts that small key with the server's public key, and sends it. The server decrypts it with its private key, and now both sides hold the same session key.
- 이후 실제 대화의 모든 바이트는 해당 세션 키로 대칭적으로 암호화됩니다: 빠르며, 느린 비교등 단계는 몇 바이트에 대해 단 한 번만 발생했습니다.
- 이것이 HTTPS와 SSH가 작동하는 정확히 같은 원리입니다.

키 합의에는 비교등을, 데이터 전송에는 대칭을 사용함
In the hybrid approach used by HTTPS, asymmetric encryption is used to:
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Slow asymmetric crypto just shares a session key; the bulk data then uses fast symmetric encryption.
Put the steps of this example hybrid encryption scheme in order.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
The slow asymmetric step runs once, on a few bytes; everything after it is fast symmetric encryption.
해싱
- 암호 해시는 임의 크기의 입력을 고정 길이의 디지스트로 변환합니다. 동일한 입력은 항상 동일한 디지스트를 생성하며, 입력에 미세한 변화가 있어도 디지스트는 완전히 달라집니다.
- 이는 단방향입니다: 디제스트로부터 입력을 복원할 수 없습니다. 이것이 해시의 핵심 목적이며, 역행하도록 설계된 암호화와 구별되는 지점입니다.
- Uses: storing passwords, where the system keeps only the digest and compares digests at login, so a stolen database yields no passwords; and checking integrity, where a file's digest is recomputed and compared to detect any change.

A cryptographic hash produces a fixed-size ____ from an input of any size.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
The same input always gives the same digest, a small change gives a completely different one, and the input cannot be recovered from it.
풀이 예제: 해시 함수를 사용하는 것이 암호화보다 나은 이유
- 웹사이트는 사용자 비밀번호를 암호화된 텍스트가 아닌 해시 값으로 저장합니다. 그 이유를 설명하십시오.
- 암호화는 복원 가능하여, 저장된 값을 다시 비밀번호로 변환할 수 있는 키가 어디에나 존재합니다. 공격자가 데이터베이스에 접근하면 키도 함께 확보할 수 있습니다.
- 해시는 단방향이므로 도난당한 해시 값 데이터베이스로부터 비밀번호를 복원할 수 없으며, 사이트 내부 직원조차도 내용을 읽을 수 없습니다.
- 로그인 기능은 정상적으로 작동합니다. 시스템은 사용자가 입력한 값을 해시하여 해시 값끼리 비교하며, 실제 비밀번호 자체를 대조하지 않기 때문입니다.
Hashing and the avalanche effect
A hash is one-way: easy to compute, practically impossible to reverse. A tiny change in the input flips a large, unpredictable part of the output — the avalanche effect that makes hashes good for passwords.
A cryptographic hash is one-way (you cannot recover the input from the digest) and shows the avalanche effect — a tiny change in the input flips a large, unpredictable part of the output.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
One-wayness plus avalanche is what makes hashes good for storing passwords and checking integrity.
Why store passwords as hashes rather than encrypted? Select 모든 that apply.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
A fixed-size digest may indeed be shorter, but that is not the security reason. Irreversibility is.
놓칠 수 있는 점
- To send someone a confidential message you use their public key, not yours. Say whose key at every step.
- 대칭 키 방식의 약점은 키 분배이며, 비대칭 키 방식의 약점은 속도입니다. 하이브리드 방식은 이 두 가지를 상호 보완하여 사용합니다.
- 해시는 일방향이며 암호화가 아닙니다: 키가 없으며 복호화할 대상도 없습니다.
- 암호화는 기밀성만 보호합니다. interception(수신 차단), 삭제, 또는 감지되지 않게Message(메시지)가 변조되는 것을 막지는 못합니다: 이러한 목적에는 해시가 필요합니다.
이해했습니다
- 암호화는 평문을 키를 사용하여 암호문으로 변환하며 기밀성만 보호합니다; 강도는 알고리즘을 숨기는 데 있는 것이 아니라 키에 있습니다.
- 대칭: 하나의 공유 키, 빠름, 대량 데이터에 적합, 키 분배에 취약 · 비대칭: 공개 키로 암호화, 개인 키로 복호화, 사전 교환 불필요, 느림
- HTTPS와 SSH에서 사용하는 하이브리드 방식은 무작위 세션 키를 비대칭 방식으로 암호화한 후, 데이터를 대칭 방식으로 전송합니다.
- 암호학적 해시는 고정 크기의 디제스트를 생성하며 일방향이며, 비밀번호 및 무결성 검증에 사용됩니다.
어떤 문제가 있었나요? 사이트 팀만 이 내용을 볼 수 있습니다.