WEBVTT

00:00:03.453 --> 00:00:07.971
Requirement 3.5 was all about how keys are protected from unauthorized access.

00:00:07.971 --> 00:00:12.184
Requirement 3.6 now looks at how the keys are managed to make

00:00:12.184 --> 00:00:13.746
sure they're cryptographically correct,

00:00:13.746 --> 00:00:18.354
and before we get into the guts of requirement 3.6,

00:00:18.354 --> 00:00:19.894
some more personal advice.

00:00:19.894 --> 00:00:23.054
If you want to keep encrypted cardholder data,

00:00:23.054 --> 00:00:26.500
then get a specialist to help you with the policies and

00:00:26.500 --> 00:00:28.205
procedures of these requirements.

00:00:28.205 --> 00:00:31.015
It's really easy to make a mistake that cannot only

00:00:31.015 --> 00:00:33.520
affect your PCI DSS compliance,

00:00:33.520 --> 00:00:36.749
but it also makes it easy for criminals to steal and decrypt your data.

00:00:36.749 --> 00:00:38.960
As I said before,

00:00:38.960 --> 00:00:41.970
there've been countless breaches of encrypted cardholder data where the

00:00:41.970 --> 00:00:45.838
criminals were able to steal or subvert the encryption keys,

00:00:45.838 --> 00:00:48.390
because remember that really good criminals are

00:00:48.390 --> 00:00:50.236
actually experts at cryptography as well,

00:00:50.236 --> 00:00:55.880
and so the over-arching demand of requirement 3.6 is that all key management

00:00:55.880 --> 00:01:00.971
processes and procedures are documented and implemented.

00:01:00.971 --> 00:01:03.220
This requirement is badly worded, because again,

00:01:03.220 --> 00:01:06.419
it talks about the keys used for the encryption of cardholder data,

00:01:06.419 --> 00:01:08.805
but it really means secret keys,

00:01:08.805 --> 00:01:11.208
so that's the one key for using symmetric algorithm,

00:01:11.208 --> 00:01:15.034
and the private key if you're using an asymmetric algorithm.

00:01:15.034 --> 00:01:16.764
As I'm sure you'll have guessed,

00:01:16.764 --> 00:01:21.439
the testing procedure is for the QSA to look at the documentation.

00:01:21.439 --> 00:01:24.874
Requirement 3.6 has eight sub requirements,

00:01:24.874 --> 00:01:27.659
all of which will need to be included in the

00:01:27.659 --> 00:01:31.156
documentation and implemented properly.

00:01:31.156 --> 00:01:35.542
The first sub requirement is the only strong keys generated,

00:01:35.542 --> 00:01:39.395
and a quick reminder of the definition of strong is found in the PCI

00:01:39.395 --> 00:01:42.355
Glossary of Terms; we looked at it in requirement 3.4,

00:01:42.355 --> 00:01:47.532
and it's that a minimum length of 112 bits is used,

00:01:47.532 --> 00:01:49.841
and practically for anything other than legacy systems,

00:01:49.841 --> 00:01:54.261
this means the lowest strength's life you should consider is 127-bit AES,

00:01:54.261 --> 00:01:57.312
and it's not just about the length of the key.

00:01:57.312 --> 00:01:59.203
So, as well as the length of the key,

00:01:59.203 --> 00:02:04.078
the key needs to be non-deterministic so ideally generated randomly.

00:02:04.078 --> 00:02:08.595
The QSA is going to check the documentation and according to the

00:02:08.595 --> 00:02:12.137
standard is going to want to observe the procedures for generating

00:02:12.137 --> 00:02:15.737
keys to verify that strong keys are generated.

00:02:15.737 --> 00:02:21.971
Now this might cause a problem because unless you plan ahead,

00:02:21.971 --> 00:02:24.874
the key generation is something that's typically done rarely and will

00:02:24.874 --> 00:02:29.867
often have been done well before the QSA comes on site.

00:02:29.867 --> 00:02:32.333
So there's two things you can do; I'm serious here.

00:02:32.333 --> 00:02:34.025
One of which is what I always try to do,

00:02:34.025 --> 00:02:37.491
which is to video the key generation process.

00:02:37.491 --> 00:02:40.119
You might also hear this called a key ceremony and

00:02:40.119 --> 00:02:44.037
then you show the QSA the video, keep it in a safe place.

00:02:44.037 --> 00:02:48.482
The other is that you plan in advance and you invite the QSA,

00:02:48.482 --> 00:02:51.924
or a QSA to the key ceremony.

00:02:51.924 --> 00:02:53.105
The next requirement,

00:02:53.105 --> 00:02:58.201
3.6 .2 needs you to distribute the keys you've just generated securely,

00:02:58.201 --> 00:02:59.607
which means two things.

00:02:59.607 --> 00:03:04.014
Firstly, that they're only shared with the nominated key custodians.

00:03:04.014 --> 00:03:06.243
Do you remember the key custodians?

00:03:06.243 --> 00:03:09.970
We identified those in requirement 3.5 .2.

00:03:09.970 --> 00:03:14.033
And secondly, that the keys are never distributed in clear text.

00:03:14.033 --> 00:03:16.320
And again, the standard asset,

00:03:16.320 --> 00:03:20.444
the QSA looks at the documentation and observes the key distribution method,

00:03:20.444 --> 00:03:24.684
and again, this might have taken place before the QSA came on site.

00:03:24.684 --> 00:03:27.949
So frequently in the assessment you have to show the QSA

00:03:27.949 --> 00:03:31.374
evidence of how the keys were distributed to allow them to

00:03:31.374 --> 00:03:33.121
verify this with the key custodians.

00:03:33.121 --> 00:03:33.507
Alternatively,

00:03:33.507 --> 00:03:38.777
you can ask them to come on site when you first distribute the keys.

00:03:38.777 --> 00:03:42.636
Requirement 3.6 .3 is a really strange one, actually.

00:03:42.636 --> 00:03:45.267
It's identical to requirement 3.5 .3,

00:03:45.267 --> 00:03:48.043
which says something like protect stored keys.

00:03:48.043 --> 00:03:51.140
It's a bug in PCI DSS.

00:03:51.140 --> 00:03:53.461
And the requirement is to store keys securely,

00:03:53.461 --> 00:03:57.415
either in key parts protected by a key encrypting key or

00:03:57.415 --> 00:04:01.500
ideally in a hardware security module.

00:04:01.500 --> 00:04:05.142
And the QSA is going to look at the documentation and at how and where keys are

00:04:05.142 --> 00:04:08.312
stored to make sure they're stored securely and honestly.

00:04:08.312 --> 00:04:11.901
This is why using an HSM is the right thing to do,

00:04:11.901 --> 00:04:15.078
because the HSM often has ways of doing the key distribution.

00:04:15.078 --> 00:04:19.264
It will often save key parts to smart cars that you

00:04:19.264 --> 00:04:22.144
then just give to the key custodians.

00:04:22.144 --> 00:04:26.869
Requirement 3.6 .4 is complex and this is one where you really

00:04:26.869 --> 00:04:28.997
need a cryptographic specialist to help,

00:04:28.997 --> 00:04:32.492
because every key that's used to encrypt data has what's

00:04:32.492 --> 00:04:36.280
known as a crypto-period associated with it.

00:04:36.280 --> 00:04:40.013
The crypto-period is the length of time that the key

00:04:40.013 --> 00:04:42.192
can be relied on to protect the data.

00:04:42.192 --> 00:04:45.193
It varies depending on the encryption algorithm used,

00:04:45.193 --> 00:04:49.638
the size of the key, the state-of-the-art encryption analysis,

00:04:49.638 --> 00:04:55.384
and how much and what type of data has been encrypted with the key.

00:04:55.384 --> 00:04:58.572
The requirement is for keys that have reached the end of their

00:04:58.572 --> 00:05:03.305
crypto-period to be withdrawn from use and new keys to be used.

00:05:03.305 --> 00:05:03.851
As I said,

00:05:03.851 --> 00:05:06.590
this is quite a complex area and one that's not

00:05:06.590 --> 00:05:09.033
massively understood by most QSAs.

00:05:09.033 --> 00:05:12.372
So a QSA is going to look at your documentation and speak with people,

00:05:12.372 --> 00:05:16.131
and see that you've documented the fact that you've considered what the

00:05:16.131 --> 00:05:18.771
crypto-period could be and what your crypto-period is.

00:05:18.771 --> 00:05:19.293
You know,

00:05:19.293 --> 00:05:21.675
it's really rare you'll find a QSA who questions

00:05:21.675 --> 00:05:24.687
the crypto-period you've chosen, but if you want to get this right,

00:05:24.687 --> 00:05:26.672
if you're encrypting lots of data,

00:05:26.672 --> 00:05:28.737
it's actually quite an important thing so again,

00:05:28.737 --> 00:05:30.176
get a specialist to help.

00:05:30.176 --> 00:05:33.229
Requirement 3.6 .5 sounds simple.

00:05:33.229 --> 00:05:36.882
It is that keys that have been weakened need to be retired,

00:05:36.882 --> 00:05:39.982
replaced, and you might need to archive them.

00:05:39.982 --> 00:05:43.041
So there's two things to consider here.

00:05:43.041 --> 00:05:45.355
The first is your criteria for working out when the

00:05:45.355 --> 00:05:46.838
integrity of a key has been weakened,

00:05:46.838 --> 00:05:51.253
and that could be because you suspect it's known or it's been

00:05:51.253 --> 00:05:54.401
compromised or a key part has been compromised.

00:05:54.401 --> 00:05:57.366
And secondly, you're processing or retiring or replacing the key,

00:05:57.366 --> 00:06:00.500
and that's especially true if you've got stored cardholder

00:06:00.500 --> 00:06:02.772
data that's encrypted with a weakened key,

00:06:02.772 --> 00:06:04.802
and you might think, well, what do I do?

00:06:04.802 --> 00:06:07.463
Do I decrypt it and re-encrypt it with a strong key?

00:06:07.463 --> 00:06:08.275
You could do that.

00:06:08.275 --> 00:06:09.359
That's quite risky.

00:06:09.359 --> 00:06:14.597
What most people do is encrypt the encrypted data and then archive the

00:06:14.597 --> 00:06:17.852
weakened key so it's still protected with a strong key.

00:06:17.852 --> 00:06:21.210
If you ever need to go back to it, you decrypt it once with a strong key,

00:06:21.210 --> 00:06:23.983
and then you decrypt it a second time with a weakened

00:06:23.983 --> 00:06:26.084
key and you get the plain text data.

00:06:26.084 --> 00:06:27.558
Hard stuff to do well.

00:06:27.558 --> 00:06:31.012
The QSA will look at your procedures and they're going to

00:06:31.012 --> 00:06:34.023
speak with people who make the call that a key's been

00:06:34.023 --> 00:06:37.123
weakened so who's going to say, actually we should replace that key,

00:06:37.123 --> 00:06:41.668
and then also people who would describe the process that you'd use to retire,

00:06:41.668 --> 00:06:43.018
replace, and archive keys.

00:06:43.018 --> 00:06:47.066
Again, as with most of the items in requirement 3.6,

00:06:47.066 --> 00:06:51.665
this isn't simple and so expert help is really strongly advised.

00:06:51.665 --> 00:06:56.667
Requirement 3.6 .6 is also a complex requirement and says that if ever

00:06:56.667 --> 00:07:00.001
you have operations that involve plain text keys,

00:07:00.001 --> 00:07:04.012
you have to observe the principle of split knowledge and dual control.

00:07:04.012 --> 00:07:07.500
Now split knowledge and dual control can be hard to implement,

00:07:07.500 --> 00:07:10.157
and my advice is to design your key management processes

00:07:10.157 --> 00:07:14.471
so that you don't have clear text keys, but if you do,

00:07:14.471 --> 00:07:17.153
let's look at what the standard requires.

00:07:17.153 --> 00:07:19.234
And here to guide us in the standard is where you need to look,

00:07:19.234 --> 00:07:22.784
because that's where split knowledge and dual control are defined.

00:07:22.784 --> 00:07:26.947
Split knowledge means that one person must never have

00:07:26.947 --> 00:07:29.670
access to an entire cryptographic key.

00:07:29.670 --> 00:07:32.773
So there are proven techniques used that allow us to split a

00:07:32.773 --> 00:07:35.154
plain text key between multiple people.

00:07:35.154 --> 00:07:36.617
Let's look at a simple example.

00:07:36.617 --> 00:07:40.846
Imagine if we had a simple eight-character key 12345678.

00:07:40.846 --> 00:07:45.992
Splitting it in half and giving Alice one half and Bob

00:07:45.992 --> 00:07:50.904
the other half isn't split knowledge, because if Alice or Bob was compromised,

00:07:50.904 --> 00:07:53.199
the attacker would not know half the key.

00:07:53.199 --> 00:07:58.262
So that really reduces the effective key strength to four characters.

00:07:58.262 --> 00:07:58.735
Instead,

00:07:58.735 --> 00:08:02.659
what split knowledge requires is that Alice and Bob each

00:08:02.659 --> 00:08:06.362
have a full eight-character key part, which when they combine together,

00:08:06.362 --> 00:08:09.530
and here in the example I've used an xor,

00:08:09.530 --> 00:08:11.401
that produces the real key,

00:08:11.401 --> 00:08:16.133
and there are other cryptographic techniques that can be used alongside xor.

00:08:16.133 --> 00:08:17.645
So that was split knowledge.

00:08:17.645 --> 00:08:21.604
Dual control means that whenever an entire key is processed,

00:08:21.604 --> 00:08:25.299
there have to be two people responsible so that one person acting

00:08:25.299 --> 00:08:27.853
alone can't affect the security of the key.

00:08:27.853 --> 00:08:31.396
It is to prevent, yes, it's to prevent someone stealing the key.

00:08:31.396 --> 00:08:34.473
So you need procedures to do this and doing this

00:08:34.473 --> 00:08:36.242
properly is actually quite hard.

00:08:36.242 --> 00:08:39.113
To validate that you're using split knowledge and dual control,

00:08:39.113 --> 00:08:41.877
the QSA is going to look at your processed documentation,

00:08:41.877 --> 00:08:45.218
observe the key management functions that are in place,

00:08:45.218 --> 00:08:49.916
and also talk to key administrators and key custodian.

00:08:49.916 --> 00:08:53.713
The next requirement is 3.6 guards against your encryption keys being

00:08:53.713 --> 00:08:58.189
substituted by an attacker for the attacker's chosen keys.

00:08:58.189 --> 00:09:00.524
Look, this is a really clever attack.

00:09:00.524 --> 00:09:02.192
It's been used in the past,

00:09:02.192 --> 00:09:05.703
and it's great because the criminal swapped the

00:09:05.703 --> 00:09:08.553
organization's encryption keys for their own.

00:09:08.553 --> 00:09:10.949
Everyone was happy, the data was still being encrypted,

00:09:10.949 --> 00:09:14.012
but because the attacker had substituted the encryption key,

00:09:14.012 --> 00:09:16.034
the attacker was able to decrypt all the data,

00:09:16.034 --> 00:09:17.576
and the organization didn't know this.

00:09:17.576 --> 00:09:19.352
They weren't able to detect it, and of course,

00:09:19.352 --> 00:09:20.874
they were able to use the data as well.

00:09:20.874 --> 00:09:24.448
Preventing this type of attack requires technical and procedural

00:09:24.448 --> 00:09:28.082
controls such as making sure that key change is detected,

00:09:28.082 --> 00:09:30.441
any key change is only possible in the dual control,

00:09:30.441 --> 00:09:33.396
and again this is somewhere that HSM's hardware

00:09:33.396 --> 00:09:35.223
security modules can really help.

00:09:35.223 --> 00:09:37.966
As with all of these requirements in 3.6,

00:09:37.966 --> 00:09:43.256
the QSA is going to look at the procedures and talk to the responsible people.

00:09:43.256 --> 00:09:46.924
The last sub requirement of 3.6 is perhaps the simplest and wants to

00:09:46.924 --> 00:09:51.385
make sure that all custodians know what they're doing.

00:09:51.385 --> 00:09:55.125
The requirement is that key custodians formally acknowledge

00:09:55.125 --> 00:09:57.287
their key custodian responsibilities,

00:09:57.287 --> 00:10:00.645
which are typically to keep any key material they have safe and

00:10:00.645 --> 00:10:05.077
secure and maybe not randomly give it to criminals.

00:10:05.077 --> 00:10:08.252
The requirement is usually satisfied by having a written document that

00:10:08.252 --> 00:10:11.888
outlines the key custodian's responsibilities and then having each key

00:10:11.888 --> 00:10:14.303
custodian sign a copy of the document.

00:10:14.303 --> 00:10:17.421
The QSA is going to check the procedures and look for the

00:10:17.421 --> 00:10:21.651
evidence such as copies of that signed document,

00:10:21.651 --> 00:10:24.432
to see where the custodians have acknowledged,

00:10:24.432 --> 00:10:26.715
you know, their custodian responsibilities.

00:10:26.715 --> 00:10:29.737
Some QSAs will go one step further; they'll actually go

00:10:29.737 --> 00:10:31.626
and interview the key custodians, and say,

00:10:31.626 --> 00:10:35.031
tell me what your key custodian responsibilities are.

00:10:35.031 --> 00:10:38.880
That's actually not formally part of the testing requirements,

00:10:38.880 --> 00:10:43.880
but QSAs typically do it.
