Jason: Email message security. 2 2
Earlier we talked about MIME, 3 3
but there's another extension that we can use 4 4
known as S/MIME. 5 5
S/MIME is the Secure/Multipurpose Internet Mail Extensions. 6 6
And this is the ability 7 7
for an email to have an encryption standard 8 8
that adds digital signatures and public key cryptography 9 9
to traditional MIME communications. 10 10
Now for this to work, 11 11
every user has to be issued a digital certificate 12 12
containing his or her public key 13 13
in order for them to use S/MIME. 14 14
Now in addition to that public key, 15 15
there's going to be a matching private key. 16 16
Now, this private key has to be kept secret by the user. 17 17
Nobody else in the world can ever know 18 18
what their private key has, 19 19
but that public key is one they should have 20 20
and share with everybody else. 21 21
Let's talk about how this works. 22 22
Let's assume I want to send Mary some information. 23 23
Well, if I wanted to do that using S/MIME, 24 24
first, I would have to send Mary my digital certificate. 25 25
That contains my public key and it validates my digital ID, 26 26
my distinguished subject name and email address, 27 27
and then I'm going to sign this message using my private key. 28 28
After that, Mary is going to use the public key 29 29
in the certificate to decode my signature 30 30
and the signature of the CA, 31 31
which is the authority who signs 32 32
those public and private keys. 33 33
And this is going to validate my digital certificate 34 34
and the digital ID, 35 35
and then she can decide if she's going to trust me or not. 36 36
And in this case, she would because she saw 37 37
that it was validated using the CA. 38 38
Then we go into the third step, 39 39
and Mary is going to respond with her digital certificate, 40 40
which has her public key, 41 41
and I am going to be able to follow the same process, 42 42
and I'll be able to start deciding to trust Mary. 43 43
So at this point, 44 44
both Mary and I have each other's public key. 45 45
Now, both Mary and I have each other's certificates 46 46
in our trusted certificate stores, 47 47
and this means we both have each other's public keys 48 48
or a copy of them, 49 49
so now we can start sending information securely. 50 50
Let me show you how that's going to work. 51 51
So now both Mary and I have 52 52
each other's public key certificates 53 53
inside of our trusted certificate stores. 54 54
So at this point, 55 55
if we start encrypting data with our private keys, 56 56
the other one can decrypt it using our public keys 57 57
because we've already done this trade. 58 58
Let's take a look at how this looks 59 59
when I want to send an email securely. 60 60
Now, there's two different ways I can talk about security 61 61
when I'm sending an email. 62 62
One is integrity and non-repudiation 63 63
and the other is confidentiality. 64 64
Let's take them one at a time. 65 65
First, we're going to talk about integrity and non-repudiation. 66 66
Let's say I wanted to send a message to Mary, 67 67
but Mary wants to make sure 68 68
that only Jason could have sent this information. 69 69
Well, to make sure that happens, 70 70
what we are going to do is I'm going to take my message, 71 71
and I am going to do a digital hash of it. 72 72
I'm going to take that hash, 73 73
and I'm going to encrypt it using my private key. 74 74
And then I have this plaintext message 75 75
and this encrypted ciphertext hash, 76 76
and I send them both over to Mary. 77 77
When Mary gets it, she's going to use that public key 78 78
that she just got from me in our earlier exchange 79 79
from her trusted key store to unlock my private key. 80 80
Because remember, if you encrypt with private, 81 81
you have to decrypt with public. 82 82
You learned this back in your Security+ classes. 83 83
At this point, we now have a plaintext of the message, 84 84
which has always been plaintext, 85 85
and we now have a plaintext of the hash. 86 86
Mary's computer is going to run a hash 87 87
against the message itself. 88 88
She's then going to compare that hash to the one I sent. 89 89
If those two match, that means this message 90 90
has not changed during transit, and we have integrity 91 91
because the hash that I sent her 92 92
matches the hash that she calculated based on that message. 93 93
Now, how do we get non-repudiation? 94 94
Well, what did I use to sign that hash? 95 95
I used my private key. 96 96
Who is the only person in the world 97 97
who has that private key? 98 98
Me, and therefore, you have non-repudiation 99 99
because only Jason could have sent this message. 100 100
Because Jason, me, used his private key 101 101
to encrypt that hash. 102 102
That's why using a digital signature, 103 103
which is an encrypted hash of the digital message 104 104
and being sent over to the other person, 105 105
gives you integrity and non-repudiation. 106 106
But that doesn't stop anyone 107 107
from actually reading this message, 108 108
so there's no confidentiality 109 109
because that email I sent was unencrypted or decrypted 110 110
the entire time and sent in plaintext. 111 111
So we need to do something else to give you confidentiality. 112 112
And that brings us to our second part of this. 113 113
When we're dealing with confidentiality, 114 114
let's say I want to send that same message, 115 115
I'm going to do both of these at the same time, 116 116
but we're taking the confidentiality part. 117 117
Now, I'm going to use Mary's public key. 118 118
I'm going to take my message at the top, my email, 119 119
and I'm going to encrypt it. 120 120
Now, I take that encrypted email 121 121
that's encrypted with Mary's public key, 122 122
which means even I can't read it at this point, 123 123
and I'm going to send it over to Mary. 124 124
When she gets it, 125 125
she's going to unlock that using her private key. 126 126
Now, the great thing about this is the only person 127 127
in the whole world who has that private key is Mary, 128 128
so she's going to be the one who's able to read that message. 129 129
Even if they could grab it in transmission, 130 130
it's going to be encrypted and they won't be able to read it. 131 131
Now, could they read some part of this message? 132 132
Yes, they could read the digital hash 133 133
that I digitally signed. 134 134
Why? 135 135
Because I encrypted it with my private key, 136 136
going back to our last section here. 137 137
And when I encrypted something with my private key, 138 138
like that digital hash, anyone in the world can read it. 139 139
But they can't read the message associated, 140 140
only the hash value. 141 141
And that's why we put these two things together 142 142
by using the integrity and non-repudiation of the hash 143 143
with the confidentiality of using Mary's public key 144 144
for the message. 145 145
By using both of these together, 146 146
this is going to give you the digital signature of the email 147 147
for encryption and non-repudiation 148 148
and the digital encryption of the message 149 149
using Mary's public key. 150 150
Now, the email client is going to be able to determine for you 151 151
if your digital signature is valid, 152 152
and it will display an icon for you when it does that. 153 153
As I said in my explanation, 154 154
when Mary got that first message from me, 155 155
her machine takes that message, it runs it through the hash, 156 156
and compares it against the hash that I sent, 157 157
digitally signed. 158 158
When it does that, if they match, 159 159
you're going to see something that looks like this. 160 160
In this case, 161 161
you could see it says "Signed by" the person who signed it 162 162
and it has that little ribbon off to the right side. 163 163
This means that was a valid signature 164 164
and everything was good. 165 165
Now, if Mary's machine went through and checked that 166 166
and it didn't have a hash that matched 167 167
the one that was sent, 168 168
then she's going to see something like this. 169 169
It's going to be an email with a red X. 170 170
This is going to tell you that that message was not sent 171 171
with a digital certificate. 172 172
And that's the difference here. 173 173
When you see that little ribbon, you know that that message 174 174
was digitally signed by that person. 175 175
When you see something looks like this, it means you don't.