start	end	text
0	4000	All right, welcome back. Thank you everybody for coming. Our next speaker is Ben Brecht
4000	8460	with man-in-the-middle privacy attacks on mixed-mode butterfly key expansion protocol,
8460	11120	which he's going to be saying three times fast. Go!
11660	15300	Thanks a lot. Thanks for coming to my talk.
17360	21380	I have some wobbly legs right now. I don't know if that's because I'm standing up here
21380	25540	and giving this talk or if that's due to the DEF CON bike ride we did this morning.
27920	33940	But let's go and start my talk. I'm going to talk about butterfly keys. I will explain what it is
33940	38880	and a man-in-the-middle attack on the privacy there. But first of all, I have to give a
38880	47600	disclaimer. I prepared this talk in my private time. I do not represent anything else than myself.
47600	53100	No company, no organization, no nothing. I unfortunately have to do that at the beginning
53100	61540	of the talk. So, butterfly keys. What are they good for? Why would you be interested in butterfly
61540	70040	keys? Butterfly keys is, first of all, a key derivation function on public-private keys,
70040	75260	not on symmetric keys, but asymmetric keys, which is rather unusual, I think.
75260	83240	And it also is a protocol that can and is be used in low computational power devices
83960	89440	that don't have that much bandwidth, so low bandwidth environments, and that maybe even
89440	97080	have low secure storage available. But on the other hand, they might need certificates or maybe
97080	101480	many of them, not just one, but a couple hundred or thousands.
102820	111320	That is what this protocol was invented for, and specifically for V2X, vehicle-to-everything
111320	117600	communication. But I think it can be easily transferred to other use cases as well.
117840	122680	For example, IoT devices. So, V2X is just one example that I want to bring up here
122680	131140	and give a little bit of background on. V2X is the direct communication between devices,
131140	136780	vehicle and infrastructure, or vehicle and vehicle, in sometimes unmanaged settings,
136780	142740	but sometimes also managed settings when we look at cellular V2X. Unmanaged means there's no
142740	147440	infrastructure involved. They're immediately sending messages. There's no hotspot, no
147440	151600	cellular tower. They are communicating really directly with each other,
151600	154840	and managed is the other way around. There is some infrastructure in between.
156200	161640	To give you a better picture, applications that are being implemented right now,
161640	166460	or that are being researched right now, are, for example, forward collision warning. If there's a
166460	171860	car braking, a couple of cars in front of you, you get a message, or your car gets a message,
171860	176900	and the car then can show you a warning that there is a car braking, or even start
176900	180660	incorporating that into active safety features, like engaging the brakes.
181580	185040	This is something that you can't do with traditional sensors, because you most
185040	189520	probably only see the car right in front of you, but not a couple of cars ahead.
190580	197400	Or intelligent traffic signals. They can count the number of cars coming from any direction,
197400	203640	and then react to this appropriately by extending green faces, for example.
204720	211160	Another one is road condition reporting. This is more in my area, where I'm from,
211160	218340	not probably over here, Michigan, the northern part of the USA. Vehicles that are out there
218920	224020	to maintain the road, they could report back what the current conditions are, and traffic
224020	230540	management centers could react to this, in order to traverse traffic to other directions, for
230540	239520	example. And just to give you an idea where this could go, another last application, four-way stop.
239520	247380	When you have a four-way stop intersection, you most probably, or in some cases, you wouldn't
247380	251880	need to stop any of the cars approaching the intersection. For example, if a car is coming up
251880	258280	and driving straight through, and or intends to drive straight through, and from the left-hand
258280	263020	side comes a car that wants to turn right, they wouldn't collide, so both of them could go
263020	269400	immediately. They can't do this today, because they can't communicate. Drivers have to communicate
269400	275080	with each other, and therefore it's safer to stop. But in the future, there could be like a notification
275080	280920	to the driver, just go straight ahead, just turn right. Or when we look more into the future, into
280920	288080	automotive vehicles, they could do this on their own. Okay, what do you need for that? When you
288080	294340	exchange messages between cars, first of all, integrity of the message. Nobody should be able to
295120	301180	change the message content without the receiving end noticing that. And the other part, sorry for
301180	309680	that, is authenticity. You need to make sure that the receiving end is able to distinguish
310320	313980	messages coming from authentic devices that are allowed to send those messages
314580	324220	from devices that are not. Like somebody sitting on the sidewalk, or somebody with a car from
327540	332800	a junkyard. How do we do this? This is traditional technology, there's nothing new to that.
332800	336840	You have a message, in this case a basic safety message that I brought here. There are a couple of
336840	342620	payload data in there, speed, position, heading. And then you have a signature, and you have a
342620	348940	certificate. And with certificates, there is a public key infrastructure for that, as we know.
349480	357500	Nothing new about that so far. The issue is, when you have certificates, you could use that
357500	363360	for tracking the device. You could use this as a fingerprint or an ID of the device, so you only
363360	371660	have to put up listening posts in two places that you want to kind of figure out if a certain car
371660	378720	is going to. And once you see that certificate in the first place, and can attach that to the car,
378720	383460	and you see this certificate showing up in the second place, you know that this vehicle
383460	391980	was in both places. And we want to avoid that for sure. So how do we avoid this? First of all,
391980	400580	the overall communication stack in V2X is always required to change all IDs in a certain manner.
401140	405620	This goes down to the MAC address, to anything that you could use for fingerprinting,
405620	413980	and also the certificate. So what you need to do is, you need to have many certificates,
413980	419520	and you need to have non-traditional certificates that don't include any identifying information
419520	426100	like a domain name, or a vehicle identification number, or anything like that. There's a standard
426100	433200	for this. The reference over there is an IEEE standard, which is defining the exact content of
433200	441700	that. And then you get a whole bunch of them. Like, you have masks that you can hide behind,
441700	447640	and you just exchange them every time you exchange all the other IDs. And you throw this
447640	453400	certificate that you used before away, and never use it again. Therefore, listening posts that are
453400	458140	in different places wouldn't be able to figure out by just seeing the certificates, or listening
458140	465420	to any of the other IDs, that this is actually the same car. So this is new. We need a whole bunch of
465420	472240	them. Currently in the European Union, for example, there are standards that require up to 100
472240	480700	certificates per vehicle, or per device, and week. In the US, the debate is currently at 20 certificates
481280	490020	per weekend vehicle. I think the truth is somewhere in the middle. But it's more than
490020	497900	traditional PKI so far have provided to any other devices that I know of. So if you look at the
497900	504740	number of vehicles in the United States, for example, which is roughly something between, I
504740	511040	don't know, 100 million to 450 million currently in the car, 70 million devices, new devices each
511040	521160	year. This is easily going to be the biggest, largest PKI that existed so far.
521880	532120	So we needed a new approach to issue certificates to those devices in an efficient manner.
532120	539740	But at the same time, we need to ensure that certain privacy requirements are met, which is
539740	545900	that none of the components within the PKI should know which certificate belongs to a certain
545900	552220	device. Because with this knowledge, they could start tracking. So if I'm a PKI operator, and I
552220	561920	know this 100 certificates went to Benedict's car, then I could easily start tracking. Again, I only
561920	566320	need those two listening posts, and I just need to match the 100 certificates in the current week
566320	572680	to the certificates that I saw over there. And the same goes for when I know which certificates
572680	578360	belong together to a certain batch. I don't need to know which device it is. I only need to verify
578360	587500	one of them against the target device, and then I'm able to track. So we need to avoid that
588580	597180	in the overall architecture. This is the PKI as it is currently proposed in the United States.
597180	603340	The European Union looks slightly different, but in principle, it's the same. I don't want to go
603340	610140	into too much detail here. I want to focus on the components that are directly or immediately
610140	617840	involved in issuing the certificates to the devices, which is the registration authority
617840	624280	and the pseudonym CA. And then there's something called location obscure proxy in between to remove
624280	628860	IP addresses, for example, so that nobody knows where the vehicle was when it was requesting
628860	636200	these certificates. But that's just a minor detail. So butterfly key expansion.
636200	642540	This is the solution that especially William White came up with.
643080	647920	I have references in the end if you want to read up on this. How does this work?
649060	657020	First of all, we have a key derivation function for public private keys, asymmetric keys.
659600	665160	Just one promise, this is the only technical slide, I hope, or at least the black and white
665160	672100	slide that I have today. So we have the typical public private key and the relationship between
672100	682580	them. In this case, it's an elliptic curve that is being used. And we have P and A, which equals
683520	696680	small cap A P. And if P is given the public key, but A is not, it's hard to compute the value of
697580	704860	A. That's the assumption that goes for all asymmetric key systems.
706780	713460	We have an agreed base point G of some order L, which is on the elliptic curve.
714000	718360	And what we do now is the first new thing compared to traditional
719020	724760	PKIs. We define a caterpillar key. We call it caterpillar key.
724900	731220	In this case, because it's like the start of the butterfly, which is an integer.
731220	743220	And the point A on that same curve. The certificate requester,
744540	752440	so that's just a standard public private key pair. There's nothing special to it yet.
753260	759100	The certificate requester provides to the registration authority the value of A,
759100	766080	the key, and an expansion function, which is a pseudorandom permutation in the integers
766800	775760	modulo L. For example, this could be a SHA-256 function that could be used for that.
775760	778560	Just as one example, that's also the example where that's actually
778560	783040	the function that we just used in the PKI that I've shown before.
784620	789080	And what the RA now can do, and this is the magic in this,
789100	797060	it can create as many cocoon public keys based on this info without
798380	804380	the requirement that the device ever comes back for that. So the device really only needs to send
804380	811340	the initial public key and this expansion function. And the RA can now execute this
811340	820380	expansion time x times and adds this to the existing or the initial caterpillar public key
821140	831260	to get a derived cocoon key, as we call it. The private key for that is generated in the same way
831260	838080	but on the device side. So it takes the initial, the device takes the initial private key,
838080	847440	executes the same order of expansion function on it and gets the matching private key to that
847980	854000	public key at the RA. This is a really nice feature because with that we have decoupled
854600	863900	the generation of public private keys and don't need any synchronization on that between devices
863900	872380	and the RA. The protocol which is then built on top of that looks like this. We have in the
872380	880080	beginning as I said the caterpillar key pair, the public key and the expansion function goes over to
880080	887620	the registration authority. The registration authority does the expansion x times or n
887620	896100	minus 1 times to generate as many keys as required. For example 100 for the current week.
897840	904500	Then it shuffles them together so it takes multiple of those keys from different devices
905800	913040	in order to avoid that the authorization CA which issues the certificate in the end
913040	919980	can just take a sophisticated guess based on the order of incoming requests which of those
919980	927460	certificates belong together. So that's another feature which is required in order to meet the
928210	933760	two privacy requirements that I introduced in the beginning. So it shuffles them, adds the
933760	941300	required metadata for the certificate like validity period for example and sends them over one by one
941300	950220	to the authorization certificate authority or PCA as it's called in the STMS.
952770	961090	The issue now is that the RA knows all of those public keys. So the RA at this time has the
961090	966810	knowledge of all the certificates that belong together. It even has the knowledge about which
966810	974470	certificate belongs to which device. So what the PCA needs to do in order to make sure that
974470	983290	the RA actually doesn't know the certificate public keys, it adds a true random number
983750	991590	to the private key. This is just another not expansion but just another random value which
991590	999090	gets added to that. And then the issue is how does this information go back to the device without
999090	1007550	the RA knowing. So there is a relationship between the initial key which was sent over by the RA
1008570	1016750	but as the RA doesn't know the random number which was added it only can guess how the
1019130	1026650	final public key looks like. So in order to avoid that on the way back, the RA learns which
1026650	1034070	certificate or which public key goes into the certificate. The device initially creates a
1034070	1041910	second key pair, a second caterpillar PCA which is used for response encryption. Same thing at the
1041910	1052290	RA does the expansion, it sends the encryption key together with the cocoon key for the certificate
1053310	1059530	and the PCA takes all of this together. The final public key generates the certificate,
1059530	1067050	signs that and then it uses the response encryption key E in order to encrypt the
1067050	1074830	certificate itself and this random number that it just added to the public key. Both of that
1074830	1083370	goes into one package which then is encrypted to the end device. Meddler's in the middle.
1084430	1091630	If I would be a meddler in the middle I would try to get in this communication in order to figure out
1092790	1101450	which of those keys belong together. So what I could do as a meddler in the middle is exactly
1101450	1109150	at the RA level, I could just introduce my own encryption keys. If the device sends me a pair
1109150	1116950	of response encryption key and I just inject my own, I can decrypt the response from the PCA
1116950	1124670	and then just after I learned which certificate is in there, I re-encrypt it with the encryption
1124670	1129870	key from the device because I just generated them. The device would never know because
1130390	1139150	the package itself is encrypted with the right key. But the RA learned what's in
1139150	1145290	the certificate of which public keys are used. So what the PCA does as a last and final step,
1145290	1151850	it signs again the overall encrypted package so that if the RA would decrypt that, the signature
1151850	1156810	would break and the device could easily see that there was a man in the middle attack
1157530	1166910	on the privacy for this certificate. It sends it back, the RA deshuffles this, packs all of the or
1166910	1174770	zips all of the 100 certificates or whatever it generated for the device together in a zip file
1174770	1180930	and then provides it for download to the device. This is a completely asynchronous process.
1181290	1185470	The device can come back at any time as soon as the certificates are generated
1186890	1193990	and download them which is another nice feature of this protocol because when we talk about B2X
1193990	1201630	communication, cars driving around, it's always a matter of connectivity. So if we just have to
1201630	1206510	send the initial request and then come back whenever we have connectivity, that's a way
1206510	1215310	better way of doing this in a synchronous protocol with this type of devices. The device
1215310	1223110	generates the respective decryption keys with the same expansion function, decrypts the package
1223710	1230510	and then it generates the respective signature private key in order to be able to use the
1230510	1237090	certificate going forward for B2X communication or whatever else you want to do with this if you
1237090	1240550	look at IoT devices for example or another use case.
1242490	1248410	So the advantage of this approach is we have a single request from the device
1250530	1256910	and this is not 100% true. This is true with the next more
1259690	1268150	more optimized version of butterfly key expansion. So we have just one request in this case just two
1268150	1274870	key pairs that have to be generated on the device and the generation process is actually way more
1274870	1283570	optimized because we just do a char calculation instead of generating new public private keys
1283570	1289110	each time we need a new certificate. So from a computational point of view,
1289110	1294190	this reduces the load that the device has with certificate management a lot.
1297170	1302510	On the backend side, we also have a big advantage and that is we can constantly
1302510	1309290	pre-generate certificates for all the devices. When we look at traditional PKIs, we always have
1309290	1315690	the issue that we most or oftentimes have a synchronous protocol where we get the certificate
1315690	1320170	signing request. We have to sign it and turn around give it back to the device.
1321590	1329470	And when we look at especially personal vehicles, they have peak hours. Whenever you go to work,
1329470	1333610	whenever you come back from work, we have way more cars on the streets and
1334250	1343090	active powered up than doing off hours. That means that the PKI has to have
1343090	1349750	respective resources in place in order to manage those peak hours. But with this approach,
1349750	1357090	we can constantly pre-generate devices 24-7 and we get away with all of the peak hours. There's
1357850	1362530	a little bit for the download process, but this is just a regular file server and
1363670	1372930	standard IT approach for that. Less computational power, I already mentioned that.
1373330	1383670	The bandwidth usage is also less from a device to RA perspective because we only have a
1383670	1389490	single request. And with a traditional certificate signing request, there wouldn't be a public key
1389510	1398270	each time. And this is exactly what we save. We have a single request and therefore just a single
1398270	1403610	public key that needs to be transferred from the device to the RA. Other way around,
1403610	1411170	it's still the same, but this way we utilize less bandwidth.
1413730	1419230	When we look at this protocol, you might have recognized that there are already two
1419230	1426330	different keys on this string of signing keys that end up in the final certificate.
1426650	1433130	We first have the cocoon key, which is generated at the registration authority, S.
1433990	1441970	And then we have the final butterfly key, U, in this case, which is generated by the PCA
1442730	1446450	through adding this random number.
1447710	1453710	So why do we need to have a third key to do response encryption?
1454350	1460690	We actually don't. And this is the approach called unified butterfly key expansion.
1462710	1467250	What we do is, instead of using the response encryption key for
1468130	1476190	encryption of the certificate and the random value, we just use the cocoon key.
1477190	1481950	And that way we save another key that needs to be
1484490	1491730	communicated from the device to the RA. And we save one expansion function at the RA.
1491730	1502150	The nice thing about this is also that if we would now do the midless in the middle attack
1502720	1510150	on this, the device would immediately know. Because if there is no encryption key that the
1510150	1519830	RA could inject in this process, if it would change the cocoon key from the device
1519830	1526770	in order to learn a certificate, in order to be able to decrypt, the keys wouldn't match at the
1526770	1534130	device level anymore. Because the device does exactly the same expansions as the RA does
1534710	1542670	to gain the private key. And if it would do this on a... or would try to use that decryption key
1543150	1547410	on a package which was encrypted by a different key,
1547410	1551130	this wouldn't work. So the device immediately knows.
1552190	1556290	This is another advantage of this approach, because then we can get rid of this explicit
1556290	1566970	signature of the encrypted package. So we have a more effective, more optimized
1566970	1575370	way of doing public... of doing butterfly key expansion. The issue now with this is that...
1577030	1581390	the advantages of this, again, less computational power at the device, because it's just one key
1581390	1588150	that we need to generate. Even less bandwidth usage, because we only have one key that needs
1588150	1598430	to be transferred, not two. But the issue with that is, what if we have a mixed mode setup?
1598530	1604610	Like we have PCAs or authorization certificate authorities that support the traditional
1604610	1612210	butterfly key expansion mechanism, where we use two keys. One for the certificate and one for
1612210	1619230	response encryption. And another set of certificate authorities that provide the
1619230	1626690	Yubikey protocol. Which can easily happen, because the traditional butterfly key expansion
1626690	1634910	mechanism is already deployed in the US, for example. And going forward, there will definitely
1634910	1641310	be interest of this more... into this more optimized way of doing butterfly keys. And
1641310	1647150	with that, we will certainly see CAs doing... providing this more optimized way.
1647410	1655390	So if we have a setup where we have both types of CAs, the meddlers in the middle, again,
1655390	1661510	could start decrypting. So if we have an RA, an evil RA in this case,
1661510	1670310	which promotes... I support the Yubikey protocol, but in actually in turn works
1670310	1676690	with a authorization CA that provides the traditional butterfly key expansion mechanism.
1678110	1683870	The device wouldn't send any response encryption key. It would assume that by
1684510	1691470	generating the right private key for decryption of the package, it would be able to tell if the RA
1691470	1701530	is in fact an evil RA. But by using a CA which supports the traditional butterfly key expansion
1701530	1707650	and therefore expecting a response encryption key, the RA could just generate on its own
1708110	1715030	a key pair for response encryption. And if it does so, it gets a package which is encrypted with.
1715610	1722310	And then it could again decrypt those packages before it uses the right key for the device
1722310	1728530	to encrypt again. And with that, the device wouldn't even know that there was somebody
1728530	1742350	in the middle. And that's the issue that I came up with. And so far this overall mechanism is
1742350	1749190	currently being standardized in IEEE. The only two solutions that we came up with so far for this
1750010	1755930	is either we reintroduce the explicit signature on the encrypted package,
1755930	1761970	which gives us the disadvantage that again we need to have a more powerful HSM at the
1762370	1769250	CA because we not only have to sign each certificate, but we also have to sign it
1769250	1776010	again after we encrypted it. So it's two signatures per certificate each time.
1777010	1782970	The way that we discussed is that the CA would need to be explicit about
1783730	1790930	which mechanism it supports. This could be for example a flag in the CA certificate itself
1791750	1799470	saying I support the unified butterfly key expansion mechanism or the traditional way of
1799470	1807030	doing things. And with that, the device could determine if there was somebody in the middle
1807870	1811510	trying to learn the certificates that belong together.
1812990	1818730	I personally favor the first approach because with that it's explicit to the device.
1818870	1824310	There's no extra check that the device has to execute for that so nobody can forget to do this
1824310	1834830	check. But the standardization process is not yet done and we will see what we will end up with.
1837160	1844560	That's the end of my talk. I hope it was informative. I hope there is interest in
1844560	1851680	using this in other setups than V2X. And if you have any questions, feel free to reach out to me.
1852020	1856080	Those are sources. I will publish these slides later on. I think they will be published here
1856080	1862420	by DEF CON nevertheless. Feel free to reach out to me. That's my Twitter handle or just
1863120	1870320	catch me. If you're ready. All right. If anybody has questions, come on up.
1874520	1879880	The requirement to have multiple certificates and randomize MAC address and things like that. That
1879880	1886940	seems like an unusual amount of attention paid to privacy in the design of a protocol like this.
1886980	1891820	Do you have any background or intuition on how that came to be? Why this cares so much about
1891820	1898900	privacy? Yeah. Regulators are actually looking into regulating this technology or requiring it
1898900	1909060	in devices. Or they did so in the past. The US DOT published a notice of proposed rulemaking
1909060	1915910	for this, which would require each and every car to be equipped with this technology.
1916830	1924330	Under the current government, nobody knows where this goes. It's stalled right now officially.
1925350	1933030	And the European Union was about to issue another regulation which would require devices that do
1933030	1940770	V2X to do it in a certain way. It's an if-equipped regulation. But this got rejected just a couple
1940770	1949550	weeks ago. And that is the reason why this technique or this technology got invented.
1949550	1955710	Because if you regulate it and each and every car has to have this technology, you need to ensure
1955710	1969100	that certain privacy requirements are met. Other questions? All right. One big round of applause
1969100	1969880	for Ben.
