WEBVTT

00:00:01.247 --> 00:00:03.368
Let's now talk about where people make the most

00:00:03.368 --> 00:00:07.062
common mistakes in requirement 3, which is encrypting cardholder data.

00:00:07.062 --> 00:00:08.434
Yes.

00:00:08.434 --> 00:00:09.422
My view is that,

00:00:09.422 --> 00:00:11.719
and I know you've got some thoughts about encryption;

00:00:11.719 --> 00:00:14.146
my view is you shouldn't do it, right?

00:00:14.146 --> 00:00:16.975
Unless you're really good and you know what you're doing.

00:00:16.975 --> 00:00:18.666
It's radioactive.

00:00:18.666 --> 00:00:23.225
Because it's so hard to do right and easy to do wrong.

00:00:23.225 --> 00:00:24.269
I mean, not just easy to do wrong,

00:00:24.269 --> 00:00:33.202
but easy to do wrong in ways that are spectacularly bad and not apparently so.

00:00:33.202 --> 00:00:34.061
So talk to me about that.

00:00:34.061 --> 00:00:38.772
Well, so I mean the biggest pitfall is, I mean are implementation problems,

00:00:38.772 --> 00:00:39.121
right?

00:00:39.121 --> 00:00:43.025
We are going to develop some software that handles the PAN and we're

00:00:43.025 --> 00:00:45.557
going to encrypt it and then we're going to insert those encrypted

00:00:45.557 --> 00:00:47.774
values into the database or whatever, right?

00:00:47.774 --> 00:00:51.996
So we have to write our cryptographic routines, right?

00:00:51.996 --> 00:00:55.697
And I mean we could do a whole course on sort of what not to

00:00:55.697 --> 00:00:58.302
wear in terms of like cryptographic usage,

00:00:58.302 --> 00:00:58.760
right?

00:00:58.760 --> 00:01:04.269
And I recommend we do it a sort of drunk-history style.

00:01:04.269 --> 00:01:07.901
But it's very, very easy to make very severe implementation errors,

00:01:07.901 --> 00:01:11.838
right, to sort of develop your own functions rather than use like a reputable,

00:01:11.838 --> 00:01:18.006
crypto API for the programming, to misuse cryptographic primitives.

00:01:18.006 --> 00:01:21.389
You know, even if you pick good ciphers,

00:01:21.389 --> 00:01:23.972
well, we're going to use AAS 256, that's a good cipher,

00:01:23.972 --> 00:01:24.116
right?

00:01:24.116 --> 00:01:26.947
It's still very easy to muck that up,

00:01:26.947 --> 00:01:32.546
it's still very easy to not generate good

00:01:32.546 --> 00:01:36.155
cryptographic keys or to mishandle those keys.

00:01:36.155 --> 00:01:39.201
Key management is actually very difficult to do.

00:01:39.201 --> 00:01:41.226
I'm going to get on to key management, so look,

00:01:41.226 --> 00:01:44.552
the first thing is that even if you pick a library,

00:01:44.552 --> 00:01:47.405
so I'm going to use AES rather than,

00:01:47.405 --> 00:01:49.455
well I have seen people try to write their own functions,

00:01:49.455 --> 00:01:50.524
but yeah, yeah.

00:01:50.524 --> 00:01:52.231
Oh, me too, it's bad.

00:01:52.231 --> 00:01:52.913
You know,

00:01:52.913 --> 00:01:56.331
the difference between ECB and CVC in terms of your

00:01:56.331 --> 00:01:59.363
implementation mode is really chalk and pyramids,

00:01:59.363 --> 00:02:01.869
I mean chalk and cheese.

00:02:01.869 --> 00:02:03.674
It's like one is a good way of encrypting data,

00:02:03.674 --> 00:02:05.923
and the other one, you've just wasted your time on that,

00:02:05.923 --> 00:02:06.102
yeah.

00:02:06.102 --> 00:02:07.795
Yeah, that's an enormously bad idea, right?

00:02:07.795 --> 00:02:12.051
So again, it's radioactive because you can spectacularly fail, right?

00:02:12.051 --> 00:02:19.045
So the requirements in DSS, you know, from 3.5, 3.5 onwards isn't it?

00:02:19.045 --> 00:02:21.614
Yeah, 3.5 and 3.6 are about key management.

00:02:21.614 --> 00:02:25.037
About how you do key management then, how you do cryptography.

00:02:25.037 --> 00:02:26.818
It doesn't talk about algorithms, though.

00:02:26.818 --> 00:02:33.616
So tell me, you know, it doesn’t say, don't use DES, don't use Triple DES?

00:02:33.616 --> 00:02:34.757
No, it doesn't say that, right?

00:02:34.757 --> 00:02:37.779
It's a little bit sneaky, right?

00:02:37.779 --> 00:02:40.411
It uses the phrase, strong cryptography,

00:02:40.411 --> 00:02:44.084
which it defines in the glossary, right,

00:02:44.084 --> 00:02:47.252
and points to strong cryptography as using sort of

00:02:47.252 --> 00:02:49.703
industry-accepted kind of practices?

00:02:49.703 --> 00:02:51.321
Yeah.

00:02:51.321 --> 00:02:54.747
And if you talk to Council folks or you read some guidance documents,

00:02:54.747 --> 00:02:57.891
they point to the NIST, the U.S.

00:02:57.891 --> 00:03:01.428
National Institute of Standards and Technology,

00:03:01.428 --> 00:03:03.840
usually the Special Publications, kind of 800 series?

00:03:03.840 --> 00:03:05.788
Yeah, I'm thinking 853 off the top of my head.

00:03:05.788 --> 00:03:07.224
Yeah, 53, 57,

00:03:07.224 --> 00:03:14.175
22 even for some of the kind of guidance about how to cryptography right.

00:03:14.175 --> 00:03:16.260
And I'll tell you why that is.

00:03:16.260 --> 00:03:18.381
The Council doesn't want to be a crypto standards body.

00:03:18.381 --> 00:03:20.957
No, they don't, because it's radioactive.

00:03:20.957 --> 00:03:21.686
Yes.

00:03:21.686 --> 00:03:25.255
It's actually, you know, having sat on the working group that wrote DSS,

00:03:25.255 --> 00:03:28.534
we did not want to, the Council never wants to get there,

00:03:28.534 --> 00:03:30.220
the Browns never want to get there.

00:03:30.220 --> 00:03:30.507
NIST?

00:03:30.507 --> 00:03:32.228
NIST are really good at this.

00:03:32.228 --> 00:03:33.732
They're good at it.

00:03:33.732 --> 00:03:35.395
Yeah, they do this full time, and if you're in Europe,

00:03:35.395 --> 00:03:37.388
ENISA also do the same thing, right?

00:03:37.388 --> 00:03:41.059
So strong cryptography means if NIST says it's okay for doing it,

00:03:41.059 --> 00:03:42.469
it's okay for doing it.

00:03:42.469 --> 00:03:43.494
Right.

00:03:43.494 --> 00:03:44.393
And because crypto changes really quickly.

00:03:44.393 --> 00:03:47.128
The DSS has got a three-year lifecycle.

00:03:47.128 --> 00:03:48.436
You couldn't say well,

00:03:48.436 --> 00:03:52.318
we have an example of where DSS did say strong cryptography,

00:03:52.318 --> 00:03:53.834
brackets, e.g.

00:03:53.834 --> 00:03:54.592
SSL.

00:03:54.592 --> 00:03:55.171
Right.

00:03:55.171 --> 00:03:59.233
And that's taken four and a half years to unravel.

00:03:59.233 --> 00:04:02.294
So as a standards body, it does not want to set crypto standards.

00:04:02.294 --> 00:04:03.537
Right, it doesn't, it doesn't,

00:04:03.537 --> 00:04:06.271
and then occasionally sort of does something like that,

00:04:06.271 --> 00:04:07.427
which is problematic,

00:04:07.427 --> 00:04:12.821
because there was this about six-month stretch between those sort of first

00:04:12.821 --> 00:04:16.793
kind of POODLE attacks that showed SSL v3 was broken,

00:04:16.793 --> 00:04:20.081
and when DSS published the update saying,

00:04:20.081 --> 00:04:23.231
here's your transition period, and in that six months,

00:04:23.231 --> 00:04:26.423
there were a few sort of weirdoes like me that were going

00:04:26.423 --> 00:04:30.059
to organizations running SSL v3 saying, this is not strong cryptography,

00:04:30.059 --> 00:04:31.091
you have to stop that.

00:04:31.091 --> 00:04:34.327
I know, and that was almost a matter of luck,

00:04:34.327 --> 00:04:40.368
because if you remember, the POODLE attack came out just at the refresh to 3.1,

00:04:40.368 --> 00:04:44.420
and 3.1 was supposed to be a change to fix the typos.

00:04:44.420 --> 00:04:45.091
Right.

00:04:45.091 --> 00:04:46.760
Because there's always typos in the standard,

00:04:46.760 --> 00:04:49.261
but usually in requirement 12, because if you're proofreading it,

00:04:49.261 --> 00:04:51.453
by the time you get to like the 200th page,

00:04:51.453 --> 00:04:54.054
people are getting a bit.

00:04:54.054 --> 00:04:56.422
Right, you're exhausted or you've had far too much coffee,

00:04:56.422 --> 00:04:59.126
and in either case you're useless for proofreading.

00:04:59.126 --> 00:04:59.535
And actually,

00:04:59.535 --> 00:05:02.378
the really interesting thing was that came out just was the Council

00:05:02.378 --> 00:05:05.402
was about to do a new release with typos in it,

00:05:05.402 --> 00:05:08.365
and so it was a really good opportunity to change that,

00:05:08.365 --> 00:05:09.226
but that's why.

00:05:09.226 --> 00:05:09.918
So firstly,

00:05:09.918 --> 00:05:14.214
strong cryptography is not defined in the standard; go to NIST to find out.

00:05:14.214 --> 00:05:15.559
Yeah, NIST or ENISA, yes,

00:05:15.559 --> 00:05:20.368
or I mean there are there a handful of standards bodies that are workable.

00:05:20.368 --> 00:05:24.075
So now if I want to do my own crypto, I've now got some algorithms I can use,

00:05:24.075 --> 00:05:25.738
but you're saying that even that's dangerous,

00:05:25.738 --> 00:05:28.204
even knowing what the algorithms are is dangerous.

00:05:28.204 --> 00:05:34.089
So there is a sort of parallel in subsidiary standard to PCI DSS called PA-DSS.

00:05:34.089 --> 00:05:36.286
It's the payment application data security standard.

00:05:36.286 --> 00:05:39.213
It's for assessing payment applications,

00:05:39.213 --> 00:05:42.154
point-of-sale software, shopping carts, things like that,

00:05:42.154 --> 00:05:43.623
and there's a separate credential, right,

00:05:43.623 --> 00:05:47.424
a PA QSA to assess those, and for a very,

00:05:47.424 --> 00:05:48.544
very long time,

00:05:48.544 --> 00:05:52.917
the thing that we ran into for a number of organizations developing these

00:05:52.917 --> 00:05:56.230
payment applications and wanting PA-DSS validation for them,

00:05:56.230 --> 00:05:59.039
it's something that I think has maybe a couple of names.

00:05:59.039 --> 00:06:01.006
I call it the Frankenstein key.

00:06:01.006 --> 00:06:04.197
It's the idea where the organization says,

00:06:04.197 --> 00:06:04.565
oh, well,

00:06:04.565 --> 00:06:06.773
I don't want a data encrypting key and a key encrypting key

00:06:06.773 --> 00:06:08.319
and store them separately and protect them.

00:06:08.319 --> 00:06:12.274
They say I just want to dynamically sort of generate this key on the fly,

00:06:12.274 --> 00:06:16.087
and so I'm going to take you know, some constant that's you know,

00:06:16.087 --> 00:06:17.161
hard-coded into the binary,

00:06:17.161 --> 00:06:19.091
and then I'm going to stitch it together with the serial

00:06:19.091 --> 00:06:21.151
number for the license of the software,

00:06:21.151 --> 00:06:24.737
and then you put some other bits together and then animate it with some dark

00:06:24.737 --> 00:06:27.672
ritual and then it shambles around moaning for BRAINS,

00:06:27.672 --> 00:06:30.788
but it's a terrible way of doing cryptography,

00:06:30.788 --> 00:06:35.309
right, because your key is very deterministic.

00:06:35.309 --> 00:06:36.183
It's predictable,

00:06:36.183 --> 00:06:40.003
it could be reassembled because of course it could be reassembled,

00:06:40.003 --> 00:06:41.325
which means the bad guy can do that as well.

00:06:41.325 --> 00:06:45.057
That's not AES 256, that's like AES 8, right?

00:06:45.057 --> 00:06:48.136
Or I have seen the best one was that we made the key from the transaction

00:06:48.136 --> 00:06:53.413
date and the value of the transaction and the till number,

00:06:53.413 --> 00:06:53.895
right?

00:06:53.895 --> 00:06:55.344
The point-of-sale number.

00:06:55.344 --> 00:06:56.449
Right.

00:06:56.449 --> 00:06:57.356
Which all also go with the message.

00:06:57.356 --> 00:06:59.434
So you've actually got the keying information in the message,

00:06:59.434 --> 00:07:02.574
which is an astonishing terrible idea, right?

00:07:02.574 --> 00:07:05.650
And go read any of those cryptographic standards and they

00:07:05.650 --> 00:07:08.131
will tell you that the only keys worth, you know,

00:07:08.131 --> 00:07:12.447
the time of day are ones that are randomly generated using an appropriate

00:07:12.447 --> 00:07:15.677
sort of cryptographically sound random number generator,

00:07:15.677 --> 00:07:16.028
right?

00:07:16.028 --> 00:07:20.225
Which is not Fred just randomly hitting the keyboard.

00:07:20.225 --> 00:07:22.742
Not usually, no.

00:07:22.742 --> 00:07:23.582
Right.

00:07:23.582 --> 00:07:26.232
So number one, implementation of crypto is hard.

00:07:26.232 --> 00:07:27.555
Right.

00:07:27.555 --> 00:07:29.174
Secondly, let's talk about key management.

00:07:29.174 --> 00:07:30.201
Key management is hard.

00:07:30.201 --> 00:07:32.085
The DSS is really weak on key management.

00:07:32.085 --> 00:07:34.747
It says do it well, but it doesn't tell you what well looks like,

00:07:34.747 --> 00:07:36.922
whereas like the point-to-point encryption standard

00:07:36.922 --> 00:07:39.446
tells you what key should look like.

00:07:39.446 --> 00:07:43.674
What it looks like to a significantly greater degree, yes.

00:07:43.674 --> 00:07:44.289
And more to the point,

00:07:44.289 --> 00:07:46.910
I think a lot of organizations and a lot of assessors sort of

00:07:46.910 --> 00:07:49.540
misunderstand some of the particulars of it,

00:07:49.540 --> 00:07:49.985
right?

00:07:49.985 --> 00:07:55.161
And I know there's some bits about making sure that if you're using a

00:07:55.161 --> 00:07:57.359
key-encrypting key to protect the data-encrypting key,

00:07:57.359 --> 00:08:01.436
then those need to be, you know, the keys of equivalent strength,

00:08:01.436 --> 00:08:02.926
and every time I say those words,

00:08:02.926 --> 00:08:05.469
I think of the Princess Bride's rodents of unusual size,

00:08:05.469 --> 00:08:08.600
and every time you will think that, too,

00:08:08.600 --> 00:08:13.202
but that's easy if you know, they're both AES keys,

00:08:13.202 --> 00:08:13.523
right?

00:08:13.523 --> 00:08:18.880
Is the AES 256 key-encrypting key enough for the AES 256 data-encrypting key?

00:08:18.880 --> 00:08:21.683
Yes, yes it is, but if you're say,

00:08:21.683 --> 00:08:27.053
protecting your data-encrypting key with an RSA asymmetric key pair,

00:08:27.053 --> 00:08:27.590
right?

00:08:27.590 --> 00:08:29.867
And I run into this quite a bit.

00:08:29.867 --> 00:08:30.175
Right?

00:08:30.175 --> 00:08:34.877
Like oh, we have an RSA 2048 module that’s protecting our AES 256 key, and.

00:08:34.877 --> 00:08:35.624
And it's like it's not big enough.

00:08:35.624 --> 00:08:37.179
It's not big enough, right?

00:08:37.179 --> 00:08:38.432
But there's a table; where is that table?

00:08:38.432 --> 00:08:40.066
Is it in the PCI standard?

00:08:40.066 --> 00:08:45.850
It's in the P2E2 standard, right, and it's in the NIST 857 document,

00:08:45.850 --> 00:08:48.076
which is where P2P cribbed it from.

00:08:48.076 --> 00:08:49.776
Yeah.

00:08:49.776 --> 00:08:52.738
And really it should go in the DSS somewhere.

00:08:52.738 --> 00:08:55.478
Okay, so now we're in danger that people are looking at this,

00:08:55.478 --> 00:08:59.297
there are two blokes talking about crypto keys; this is not interesting.

00:08:59.297 --> 00:09:00.420
It's not interesting.

00:09:00.420 --> 00:09:01.220
So let's stop talking about crypto keys,

00:09:01.220 --> 00:09:04.490
because the interesting point is it's really hard to do.

00:09:04.490 --> 00:09:06.735
It's very complicated and there are a lot of facets.

00:09:06.735 --> 00:09:09.580
So how do you do it well?

00:09:09.580 --> 00:09:11.893
Do you get your QSA to come in beforehand,

00:09:11.893 --> 00:09:14.981
or most, I'm going to be asking really terrible questions.

00:09:14.981 --> 00:09:17.573
Are most QSAs capable of telling you how to do crypto well?

00:09:17.573 --> 00:09:18.791
No.

00:09:18.791 --> 00:09:22.513
Right, so number one, don't ask your QSA how to do crypto well?

00:09:22.513 --> 00:09:23.026
Well,

00:09:23.026 --> 00:09:27.829
I would say maybe throw your QSA a little bit of a

00:09:27.829 --> 00:09:31.218
test and if they can understand it, but if you don't know?

00:09:31.218 --> 00:09:31.980
You don't know how to do it.

00:09:31.980 --> 00:09:35.349
Right, if you don't know, yeah, that's tough,

00:09:35.349 --> 00:09:39.078
but a lot of QSAs don't have a lot of cryptographic experience,

00:09:39.078 --> 00:09:39.523
right?

00:09:39.523 --> 00:09:41.785
And so this is a bit of a challenge, right?

00:09:41.785 --> 00:09:48.928
So maybe one of the things you're looking for when selecting a QSA is at least,

00:09:48.928 --> 00:09:51.824
you know, their ability to speak, you know,

00:09:51.824 --> 00:09:53.374
to be conversantly intelligent about cryptography.

00:09:53.374 --> 00:09:55.174
But that's really hard as a merchant if you don't speak

00:09:55.174 --> 00:09:56.276
intelligently about cryptography.

00:09:56.276 --> 00:09:58.111
That's true.

00:09:58.111 --> 00:10:01.095
And my experience is that developers think they can do crypto really well,

00:10:01.095 --> 00:10:04.175
because they've read a book on it.

00:10:04.175 --> 00:10:05.099
Right.

00:10:05.099 --> 00:10:09.783
Or they've gone to that Stack Exchange thing and gone, how do I do this thing?

00:10:09.783 --> 00:10:10.165
Right.

00:10:10.165 --> 00:10:14.061
So like my one thing, and I buy a lot of software,

00:10:14.061 --> 00:10:17.679
so I buy, I do a lot of RFPs for people,

00:10:17.679 --> 00:10:22.618
and I always say, you know, you need encrypt all data it's stored and everything,

00:10:22.618 --> 00:10:24.961
and I speak to people about how are you doing the crypto,

00:10:24.961 --> 00:10:27.465
and they tell me, and it's like well, that's not how crypto works.

00:10:27.465 --> 00:10:28.485
Right.

00:10:28.485 --> 00:10:28.794
Right?

00:10:28.794 --> 00:10:31.974
You would not use a 2048-bit RSA key for doing that,

00:10:31.974 --> 00:10:34.807
because we'd still be waiting here for the transaction to happen,

00:10:34.807 --> 00:10:35.824
for example, right?

00:10:35.824 --> 00:10:42.480
So I guess the answer is to find an expert, which would be a P2P QSA?

00:10:42.480 --> 00:10:46.002
A P2P QSA would have more cryptographic knowledge and

00:10:46.002 --> 00:10:49.361
would be able to speak to that, even if you're not interested in P2P services,

00:10:49.361 --> 00:11:01.186
somebody that's capable of that can help you sort the wheat from the chaff.
