1
00:00:00.05 --> 00:00:02.06
- [Instructor] Now, as
promised in the previous video

2
00:00:02.06 --> 00:00:04.04
I wanna spend a little
bit of time talking about

3
00:00:04.04 --> 00:00:06.09
the two different types of encryption.

4
00:00:06.09 --> 00:00:11.06
Specifically, Asymmetric or
public private key encryption.

5
00:00:11.06 --> 00:00:15.05
And Symmetric or shared key encryption.

6
00:00:15.05 --> 00:00:17.05
Now there are few fundamentals
we need to talk about.

7
00:00:17.05 --> 00:00:21.00
So Symmetric encryption
or shared key encryption

8
00:00:21.00 --> 00:00:24.08
is a method of encryption
where both parties involved

9
00:00:24.08 --> 00:00:27.05
share a common key.

10
00:00:27.05 --> 00:00:30.07
That common key is used,
and must be kept secret

11
00:00:30.07 --> 00:00:32.04
by both parties.

12
00:00:32.04 --> 00:00:36.07
So in a traditional Alice and
Bob example of cryptography,

13
00:00:36.07 --> 00:00:40.01
Alice will encrypt a
message using the shared key

14
00:00:40.01 --> 00:00:42.08
and send it to Bob who can then decrypt it

15
00:00:42.08 --> 00:00:45.05
using the same shared key.

16
00:00:45.05 --> 00:00:48.06
Obviously, the issue with
symmetric encryption is

17
00:00:48.06 --> 00:00:52.01
that both parties must
have a secured mechanism

18
00:00:52.01 --> 00:00:54.02
by which to share that key,

19
00:00:54.02 --> 00:00:58.02
and often on the public
internet that is not possible.

20
00:00:58.02 --> 00:00:59.07
Now, asymmetric encryption

21
00:00:59.07 --> 00:01:02.06
or public/private key pair encryption

22
00:01:02.06 --> 00:01:05.04
is based on the concept that the two keys

23
00:01:05.04 --> 00:01:07.07
are mathematically related

24
00:01:07.07 --> 00:01:11.06
therefore I can use one to
encrypt and the other to decrypt.

25
00:01:11.06 --> 00:01:14.07
So, in this example Alice will create

26
00:01:14.07 --> 00:01:17.06
a public key and a private key

27
00:01:17.06 --> 00:01:21.07
and she will then share her
public key openly to everyone.

28
00:01:21.07 --> 00:01:25.04
She can therefore encrypt a message

29
00:01:25.04 --> 00:01:29.01
with her private key and send it to Bob.

30
00:01:29.01 --> 00:01:33.06
Bob can then decrypt the
message using Alice's public key

31
00:01:33.06 --> 00:01:36.02
and read it in plain text.

32
00:01:36.02 --> 00:01:38.09
Now, the interesting
side effect of this is,

33
00:01:38.09 --> 00:01:42.07
that if Bob wants to send
a private message to Alice

34
00:01:42.07 --> 00:01:47.08
he actually can encrypt the
data using Alice's public key

35
00:01:47.08 --> 00:01:51.09
and she can then decrypt
it using her private key.

36
00:01:51.09 --> 00:01:55.05
So, asymmetric encryption works both ways.

37
00:01:55.05 --> 00:01:58.06
Now, the uses of these
are very, very different

38
00:01:58.06 --> 00:02:01.06
but you might guess
that the asymmetric keys

39
00:02:01.06 --> 00:02:04.02
work really good on distributed systems,

40
00:02:04.02 --> 00:02:05.05
where symmetric keys

41
00:02:05.05 --> 00:02:09.06
tend to work really
good on private systems.

42
00:02:09.06 --> 00:02:12.00
Now there are some
performance considerations

43
00:02:12.00 --> 00:02:13.04
between the two.

44
00:02:13.04 --> 00:02:18.01
Shared key block or stream
ciphers are relatively quick

45
00:02:18.01 --> 00:02:21.07
when you consider the
operations being performed.

46
00:02:21.07 --> 00:02:23.03
Public key encryption, however,

47
00:02:23.03 --> 00:02:25.08
is extremely slow

48
00:02:25.08 --> 00:02:27.00
in relation

49
00:02:27.00 --> 00:02:30.01
to symmetric key encryption.

50
00:02:30.01 --> 00:02:31.06
Now often what happens is,

51
00:02:31.06 --> 00:02:33.08
is you use PKI

52
00:02:33.08 --> 00:02:37.02
for the operation to solely transfer

53
00:02:37.02 --> 00:02:38.07
a shared key

54
00:02:38.07 --> 00:02:43.00
and then do all other
communications using that shared key

55
00:02:43.00 --> 00:02:45.02
because now you have a way of sharing it

56
00:02:45.02 --> 00:02:48.08
between two parties in a secure fashion.

57
00:02:48.08 --> 00:02:52.02
And as a matter of fact,
this is exactly how TLS

58
00:02:52.02 --> 00:02:56.09
often confused for SSL works
on the public internet today.

59
00:02:56.09 --> 00:03:00.05
The handshake operation
between a client and the server

60
00:03:00.05 --> 00:03:03.04
is really designed to get a shared key

61
00:03:03.04 --> 00:03:06.07
between the two for that session.

62
00:03:06.07 --> 00:03:10.09
Now, symmetric keys
have very distinct uses.

63
00:03:10.09 --> 00:03:13.08
Most of the time when
we have data at rest,

64
00:03:13.08 --> 00:03:16.06
such as in a database or messaging system,

65
00:03:16.06 --> 00:03:18.05
or even on a file system.

66
00:03:18.05 --> 00:03:23.03
We're gonna sue symmetric block
cipher to encrypt that data.

67
00:03:23.03 --> 00:03:28.02
We also use symmetric block
encryption for data in motion.

68
00:03:28.02 --> 00:03:29.09
We used to use stream ciphers

69
00:03:29.09 --> 00:03:31.06
but I alluded to the last chapter

70
00:03:31.06 --> 00:03:35.03
how stream ciphers can actually be broken.

71
00:03:35.03 --> 00:03:39.09
And streams like RC4 are
considered no longer secure

72
00:03:39.09 --> 00:03:43.09
and TLS want to actually
remove them from the list.

73
00:03:43.09 --> 00:03:47.09
Now, asymmetric has some
very distinct uses as well.

74
00:03:47.09 --> 00:03:49.08
We've talked a few times about TLS

75
00:03:49.08 --> 00:03:52.03
or Transport Layer Sockets,

76
00:03:52.03 --> 00:03:57.03
and this is really how the
internet works over the HGDPS.

77
00:03:57.03 --> 00:03:59.09
Digital signatures or non repatriation

78
00:03:59.09 --> 00:04:03.02
is actually based on a
symmetric encryption.

79
00:04:03.02 --> 00:04:05.02
And we're gonna talk a lot about that

80
00:04:05.02 --> 00:04:08.02
in the chapter on Digital signatures.

81
00:04:08.02 --> 00:04:12.03
Certificate trusts are really
based on the same concept

82
00:04:12.03 --> 00:04:15.01
so you create a public
key and a private key

83
00:04:15.01 --> 00:04:19.08
and you sign that with the
trusted authorities private key

84
00:04:19.08 --> 00:04:22.07
and can confirm that signature
with their public key.

85
00:04:22.07 --> 00:04:24.06
And the chain goes on and on.

86
00:04:24.06 --> 00:04:28.05
And that is how trust
is build on the internet

87
00:04:28.05 --> 00:04:30.08
from a central CA.

88
00:04:30.08 --> 00:04:32.00
So, now that we've talked about

89
00:04:32.00 --> 00:04:34.02
asymmetric and symmetric encryption.

90
00:04:34.02 --> 00:04:36.01
Let's actually jump into symmetric

91
00:04:36.01 --> 00:04:38.07
and perform the actual operations.

