Encryption Part I: Introduction to Encryption 2

Shane Killian
8 Jul 201406:23

Summary

TLDRThis video explains two types of encryption: asymmetric (private key) and hashing. Asymmetric encryption allows secure communication by generating a public key for encryption and a private key for decryption, making it difficult for third parties to intercept messages. Hashing, on the other hand, is a one-way encryption used for verification purposes, such as password authentication or file integrity checks. The video also covers how these encryption methods ensure secure communication and data integrity, and hints at upcoming topics like random numbers in encryption.

Takeaways

  • 🔐 Encryption is vital for securing data, and this series is designed to teach users how to do so.
  • 🗝️ Symmetric (secret key) encryption requires both parties to share a key, but introduces challenges in securely sharing it.
  • 🎲 Entropy refers to the uncertainty or randomness used to enhance security in encryption.
  • 🔑 Asymmetric (private key) encryption allows secure communication using a pair of keys: a public key for encryption and a private key for decryption.
  • 📩 Alice can share her public key with Bob so that Bob can send her encrypted messages, but Bob needs his own key pair for Alice to send encrypted messages back.
  • 🔗 Asymmetric encryption can be combined with symmetric encryption for better efficiency and secure key exchange.
  • 📝 Digital signatures can be used to verify the identity of the sender, ensuring messages come from the intended party using their private key.
  • 🚫 Hashing is a one-way function used to verify data integrity without revealing the original content, commonly used in password storage.
  • 🔍 Hashing ensures that files have not been tampered with during transmission, as seen in Bittorrent’s use of info-hashes for file verification.
  • 🧮 Different encryption methods address different needs, such as secure communication, identity verification, and data integrity.

Q & A

  • What is the purpose of the video in the series 'Introduction to Encryption'?

    -The purpose of the video is to continue explaining encryption, focusing on asymmetric or private key encryption, and introducing the concept of hashing.

  • Why is 'entropy' important in encryption?

    -Entropy adds uncertainty to a message, ensuring that even if the same key is used, the encrypted data will appear different each time, resembling random noise.

  • What is the main challenge with symmetric (secret key) encryption, and how does asymmetric encryption address it?

    -The main challenge with symmetric encryption is securely sharing the secret key. Asymmetric encryption addresses this by allowing the sender to use a public key for encryption and the receiver to use a private key for decryption, eliminating the need for secure key sharing.

  • How does public key encryption ensure secure communication between Alice and Bob?

    -Alice can generate a public key and share it openly, which Bob can use to send encrypted messages. Alice can decrypt these messages with her private key, which only she possesses, ensuring secure communication.

  • What is a major limitation of asymmetric encryption?

    -Asymmetric encryption is uni-directional, meaning Bob can send encrypted data to Alice, but Alice needs Bob's public key to send encrypted data back to him.

  • How can asymmetric and symmetric encryption be combined for secure communication?

    -Bob can use Alice's public key to send her a secret key, which they can then use for faster symmetric encryption, ensuring secure communication while avoiding the problem of secure key sharing.

  • How does digital signature verification work with asymmetric encryption?

    -Alice can sign a message with her private key, and Bob can verify the signature using Alice's public key. If the signature matches, Bob knows the message was sent by Alice.

  • What risks exist if Alice's private key is stolen?

    -If Eve manages to steal Alice's private key, she can decrypt messages intended for Alice and even impersonate Alice, sending messages to Bob that appear legitimate.

  • What is 'hashing,' and how is it different from encryption?

    -Hashing is a one-way process where data is transformed into a fixed-size output that cannot be reversed. Unlike encryption, hashing is used for verification, not for recovering original data.

  • How does hashing ensure the integrity of files and passwords?

    -For passwords, the hash of a password is stored instead of the password itself. When verifying a file's integrity, the hash of the downloaded file is compared to the original hash. If they match, the file is verified as untampered.

Outlines

00:00

🔐 Understanding Asymmetric Encryption

This paragraph introduces asymmetric or private key encryption, contrasting it with symmetric key encryption. It explains how Alice generates a private key and a corresponding public key to send to Bob, allowing Bob to encrypt messages without compromising security. Even if Eve intercepts the public key, she cannot decrypt messages, as the private key is required for decryption. The paragraph highlights how this method resolves the problem of securely sharing encryption keys.

05:00

📩 The Challenge of Uni-directional Encryption

Asymmetric encryption is described as uni-directional, meaning Bob can send encrypted data to Alice, but she cannot reciprocate using the same key pair. For bi-directional communication, Bob must create his own private key and send Alice his public key. The paragraph explains how asymmetric encryption can be combined with symmetric encryption, allowing Bob to send a secret key encrypted with Alice's public key. This approach enables secure communication without the need for direct key sharing.

🖊️ Digital Signatures and Authentication

This section discusses how digital signatures, verified by a public key, can confirm the sender's identity. Alice signs a message using her private key, and Bob verifies it with her public key. This ensures that the message is authentic and sent by Alice, assuming her private key hasn’t been compromised. If Eve obtains Alice's private key, she could impersonate Alice, highlighting the importance of safeguarding private keys.

🔒 Introduction to Hashing

Hashing is introduced as a one-way encryption technique used for verification rather than encryption. When data is hashed, it produces a unique, scrambled output that cannot be reversed. The same input always generates the same hash, making it useful for tasks like password verification. In this process, only the hash, not the original password, is stored, providing security against password theft.

💻 Verifying File Integrity with Hashes

This paragraph explains how hashing is used to verify file integrity. After downloading a file from Bob, Alice can hash it and compare it to a hash provided by Bob. If the hashes match, she knows the file has not been tampered with. Hashing is commonly used in protocols like Bittorrent, where each file piece is hashed to ensure its accuracy during transfer.

🔐 Conclusion: Encryption Types and Their Uses

The final section summarizes the two encryption methods discussed—asymmetric key encryption for secure communication and digital signatures, and hashing for verification. Hashing is emphasized as a form of one-way encryption that is essential for tasks like password security and file integrity checks. The paragraph closes with a preview of the next video, which will cover encryption implementation and the importance of random numbers in encryption.

Mindmap

Keywords

💡Symmetric Key Encryption

Symmetric key encryption is a type of encryption where the same key is used for both encrypting and decrypting data. It requires that both parties (e.g., Alice and Bob) have access to the same secret key. In the video, this method is introduced as the most basic form of encryption, but it comes with the challenge of securely sharing the key between parties.

💡Asymmetric Key Encryption

Asymmetric key encryption, also known as public-key encryption, uses two separate keys: a public key for encryption and a private key for decryption. This method solves the problem of securely exchanging keys, as the public key can be openly shared without compromising the security of the private key. In the video, it is used as a solution for scenarios where Alice wants to receive encrypted messages from Bob without revealing her private key.

💡Public Key

A public key is part of the asymmetric encryption system, used to encrypt data that can only be decrypted by the corresponding private key. In the video, Alice generates a public key from her private key and shares it with Bob, allowing him to send her encrypted messages securely. Even if an attacker like Eve gets the public key, they cannot use it to decrypt messages or access the private key.

💡Private Key

A private key is a confidential key used in asymmetric encryption that must be kept secret. It is used to decrypt messages encrypted by the corresponding public key and to create digital signatures. In the video, Alice uses her private key to decrypt messages sent by Bob and to sign her communications, ensuring that Bob knows they were truly sent by her.

💡Digital Signature

A digital signature is a way to verify the authenticity of a message by using the sender's private key. In the video, Alice uses her private key to sign a message that Bob can then verify using her public key. If the signature is valid, Bob can be confident that the message was not tampered with and was indeed sent by Alice.

💡Hashing

Hashing is a process that transforms input data into a fixed-size string of characters, which cannot be reversed to recover the original data. Unlike traditional encryption, hashing is a one-way process. In the video, hashing is used to verify data integrity, such as checking if a file downloaded by Alice has been altered or ensuring that a password stored on Bob's server matches the one entered by a user.

💡Entropy

Entropy is the measure of randomness or unpredictability in data. Higher entropy means more uncertainty, making encrypted data more secure. In the video, it is mentioned as an important concept because it ensures that encryption results appear random, reducing the risk of patterns that could be exploited by an attacker like Eve.

💡Key Exchange

Key exchange refers to the process of securely sharing a cryptographic key between parties. In symmetric encryption, it is challenging because both parties need to securely obtain the same key. In the video, asymmetric encryption is introduced as a solution to this problem, where Bob can send a secret key encrypted with Alice’s public key, allowing them to switch to symmetric encryption afterward.

💡Password Hashing

Password hashing is the process of converting a password into a fixed-length string using a hash function, which is stored instead of the original password. In the video, Bob’s server hashes passwords to verify users’ identities without storing their actual passwords, reducing the risk if the server is compromised.

💡File Integrity

File integrity refers to the assurance that a file has not been altered or tampered with during transmission or storage. In the video, hashing is used to check file integrity; Alice downloads a file and then compares its hash to the one provided by Bob to ensure that it has not been modified, ensuring secure and reliable data transfer.

Highlights

Introduction to asymmetric or private key encryption.

Symmetric encryption requires entropy to avoid using the same key for the same data.

Alice generates a private key and a public key for secure communication with Bob.

Public key encryption ensures that only Alice can decrypt messages using her private key.

Alice's public key can be freely shared without risk since it cannot decrypt messages.

Private key encryption is uni-directional; Bob needs to generate his own private key for secure communication.

Combining public and secret key encryption can solve the problem of securely sharing keys.

Digital signatures allow Bob to verify that a message is genuinely from Alice.

Asymmetric encryption can also be used to authenticate communication through digital signatures.

Hashing is introduced as a method for one-way encryption to verify data.

Passwords are stored as hashes instead of in plaintext for secure verification during logins.

Hashing algorithms can verify the integrity of files downloaded from the internet.

Bittorrent uses hashing to ensure files are downloaded correctly without tampering.

Hashing is essential for ensuring file integrity by comparing computed and provided hashes.

Future discussions will cover the implementation of encryption methods and issues surrounding random numbers.

Transcripts

play00:02

Welcome to the second video in our Introduction to Encryption, which is Part I of our series

play00:06

designed to teach you the user how to secure your data.

play00:09

If you haven't watched the first video, I urge you to do so, as it covers the basics

play00:13

of what encryption is and why it's important.

play00:15

We also covered the first type of encryption: symmetric or secret key encryption.

play00:20

We also mentioned the concept of "entropy," which is the amount of uncertainty in a message.

play00:25

Since you should never use the same key on the same data, entropy helps you scramble

play00:29

things up so that the encrypted result resembles random noise.

play00:33

We're going to continue with the next type of encryption: asymmetric, or private key

play00:38

encryption.

play00:39

Remember from Part I that the problem we kept having was how Alice can get the secret key

play00:44

to Bob without Eve getting it.

play00:46

One solution to this is to use asymmetric-key, or private key encryption.

play00:51

With this concept, Alice can generate an encryption key and keep it to herself.

play00:55

This is her private key, and no one else in the world needs to have it.

play01:00

From this private key she generates a public key, which she sends to Bob.

play01:04

This doesn't have to be secure; if Eve gets it, no problem!

play01:08

The reason why is that the public key cannot be used to decrypt anything.

play01:12

It can only encrypt, and Alice uses her private key to decrypt it.

play01:17

Alice can post her public key on the internet, and anyone who wants to can find it and use

play01:21

it to send her a private communication; the private key CANNOT be recovered using only

play01:27

the public key.

play01:29

So this is secure, and Alice is in complete control of the private key.

play01:33

She doesn't have to trust anyone else, but Bob has to trust Alice.

play01:38

Pretty much Eve's only hope at deciphering the message is to get Alice's private key,

play01:42

but since Alice can keep it secret and all to herself, this will be very difficult.

play01:47

The problem is, it's uni-directional.

play01:49

Bob can now send encrypted data to Alice, but Alice cannot send anything encrypted to

play01:54

Bob.

play01:55

Bob would have to generate his own private key and send Alice the public key so that

play01:59

she can send a secure message to him.

play02:01

You can combine methods, however.

play02:03

Remember that the problem with secret key encryption was the difficulty in getting the

play02:07

key to the other person securely.

play02:10

Now, since Bob has Alice's public key, he can generate a secret key and send that to

play02:16

Alice, encrypted with her public key.

play02:18

They can then communicate as usual with secret-key encryption, and Eve has no way of getting

play02:23

the encryption keys.

play02:26

Private key encryption also gives us the ability to verify that a message was written by the

play02:30

person we want to be talking to.

play02:32

Bob has Alice's public key, but he wants to make sure it's Alice and not Eve pretending

play02:36

to be Alice.

play02:37

So he has Alice send him a message--this doesn't have to be encrypted--that is digitally signed

play02:42

using her private key.

play02:43

Bob can then verify the signature using Alice's public key.

play02:47

If everything matches up, then Bob knows that the message was written by someone with access

play02:52

to Alice's private key.

play02:53

As long as Eve hasn't managed to steal Alice's private key, then it must be Alice who sent

play02:58

the message.

play03:00

But if Eve ever does manage to steal the private key, she can read encrypted messages that

play03:04

Bob intends for Alice, and even send messages to Bob pretending to be Alice and the digital

play03:10

signature would match.

play03:11

Our third type of encryption isn't technically encryption, although a lot of the concepts

play03:17

still apply.

play03:18

It's called "hashing," and you can think of it as a sort of one-way encryption.

play03:23

You take a piece of data, run it through a hashing algorithm, and the output is scrambled

play03:27

in a way that can never, ever be descrambled.

play03:30

What's the point?

play03:31

Well, if you take the same piece of data and run it through the same hashing algorithm,

play03:35

you'll get the same hash.

play03:38

You can do this whenever you need to verify a piece of information but don't need to decipher

play03:42

it.

play03:43

That's what hashes are for: some kind of verification.

play03:46

One use for this is passwords.

play03:48

If Alice connects to Bob's server, she creates her password, it gets hashed, and the hash--NOT

play03:54

the original password--is stored in Bob's server.

play03:57

Then, whenever Alice logs in, the password she types gets hashed the same way.

play04:03

Bob's server then compares this hash to the hash stored in his database, and if they match,

play04:09

Alice is logged in.

play04:10

Knowing the original password isn't necessary; we only need to confirm that she typed in

play04:15

the same password.

play04:17

With a good hashing protocol, there will be no hints given as to whether the hacker has

play04:22

gotten close to guessing the password.

play04:24

The hash for the password RoughMilkPaintBattle1 should look as different from the hash for

play04:30

RoughMilkPaintBattle2 as it does from FailedCourageSeldomPhysical.

play04:35

The only way Eve can crack it is to try passwords over and over and over again, until she gets

play04:42

lucky and hits the one that generates the hash on Bob's server.

play04:46

We'll talk more about secure password storage in Part II.

play04:50

Another way is if she wants to verify that a file she gets from Bob hasn't been tampered

play04:55

with.

play04:56

She downloads the file, and then Bob separately gives her the hash.

play05:00

Once she has the file, she runs the hashing algorithm on it, and compares the result to

play05:05

the hash she got from Bob.

play05:06

If they match, she can safely assume the file hasn't been tampered with.

play05:11

The hash acts as a signature that verifies she has the correct file.

play05:16

The Bittorrent protocol uses hashing to verify the integrity of the files it sends.

play05:20

Along with the metadata describing the torrent and what file or files it contains, there

play05:25

is an info-hash which the client runs to verify that no one has monkeyed around with this.

play05:30

Plus, Bittorrent divides its files into pieces, and each piece is given its own hash.

play05:36

Once the client finishes downloading a piece, it verifies the hash, and if the hash is different,

play05:41

it knows an error has occurred and it needs to download the piece again.

play05:46

So that's our other two types of encryption: asymmetric key, or private key, a uni-directional

play05:51

encryption that can also be used to create and verify digital signatures, and hashing,

play05:56

which is a sort of one-way encryption, encryption that cannot be undone.

play06:00

It's used for verification, whether it's verifying that a user typed in the correct password

play06:04

or verifying that we've downloaded a file without error or tampering.

play06:08

In the next video, we'll look at different ways of implementing these different kinds

play06:12

of encryption to deal with certain problems, and we'll also look at issues surrounding

play06:16

those all-important random numbers.

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
Asymmetric EncryptionHashingPrivate KeyPublic KeyDigital SignaturesData SecurityPassword ProtectionFile IntegrityEncryption BasicsCybersecurity
¿Necesitas un resumen en inglés?