 I'm happy to welcome you to this talk Hacking Vein Recognition with Starbucks and Julian. The whole subject of biometrics has been one of the KS Computer Clubs for quite a while. Do you remember Iris Recognition that was hacked with a photo of our Chancellor? Fingerprints made it to the media as well. Mr. Schäupler's fingerprint was taken from McGraths and now we're going to talk about Veins. I'm curious to see how that's going to work. There have been countless talks and press articles about this. I know one of the things Starbucks is very proud of is that his name was mentioned in the German built tabloid. But of course, Starbucks is not here on his own tonight. He's with Julian, one of his colleagues who wrote about Vein Recognition in his bachelor's thesis. This is probably one of the biggest bachelor's thesis exams of his life. And without further ado, I want to let you enjoy the talk that you're all here for. Enjoy! Thank you Karina and welcome to the probably last talk about hacking biometrics. We simply haven't got any more systems left to do. This one's about Vein Recognition. I've been looking at the two systems I'm going to show you tonight for a few years, but I didn't really make any progress. But then Julian came and he said that he was interested in hacking biometrics and was looking for a topic where it's bachelor's thesis. And it was a very productive collaboration. Vein Recognition is a fairly new technology. It comes mainly from Asia, Japan, and also the companies that develop these systems, Fujitsu and Hitachi are Japanese companies. Nobody's really looked at these systems in detail yet, which is strange because it's a very rewarding target, which you're going to see later. I assume that it's because one of the few biometric features that are hidden inside the body and not easy to see, unlike, for example, fingerprints. But let's start with the basics. Veins develop in the sixth week of pregnancy. The rough structure from the heart to the lungs and the splitting is determined by your genes. But the detailed features is random. And that's why it's useful as a biometric feature because it's individual and it's different for each finger, but also different in twins. The hardware works like this. It's simply a camera, like the camera you might have in your phone or like an SLR. But you take away the infrared filter, so it also covers the near-infrared range. And the two systems work, both work with 850 nanometers and for recognition of veins in the hand. You have LEDs in this sensor. They're reflected by the skin. But the veins absorb it and that's why the skin is bright and the veins are dark. There's a normal camera in the bottom and the veins are visible as black lines. Recognition of veins in the fingers works a bit differently because the veins in the fingers are a bit deeper. This reflective method wouldn't offer high enough contrast. And that's why the LEDs are usually at the top of the device. They're scattered in the skin. Even though there's a bone in between, you can still see the veins which absorb the light and there's a normal camera in the bottom that takes the picture. There are newer methods as well that don't use LEDs, but lasers and micro mirrors. We'll be talking about those towards the end. They're used for detecting blood flow as well to check for signs of life. But the two systems that we have here cover 95% of the global market and they use normal LEDs. How does the software work then? All the systems use the so-called mayoral tracking. It's the picture you see on the top right here. It's what these camera pictures look like. The system looks for a random point and then draws an intersecting line and looks for changes in the intensity. And when it finds a ghost curve like this, it assumes that it's a vein. From there on, it looks from the nearest dark pixel and uses this to recognize veins and it does that a few hundred or thousand times. Once it finds enough points, it assumes that it's found all the veins. It then does post-processing, the so-called skeletonization, where it takes the veins which are quite wide and nose them down to one pixel and the resulting picture looks like you see at the bottom. You have these minuscule points that are the features that are actually detected and you can identify people by their position and by their angle. I mentioned that this is a very rewarding target. It's mainly used in Asia where many computers have the system but also methods of access control in hospitals because they don't require touch but also in ATMs. When we visited Japan, we noticed that all ATMs have these systems but also Brazil, Russia, Turkey and Poland, so also quite close to home, have open bank branches where you can with grow money with vein recognition. But the largest market and the most interesting market are high-security areas. Power plants, banks and also the military. And interesting enough in Germany at the Secret Service, the BND. So if you need some taps, maybe pay them a visit after this talk. We assume that few places use these in Germany but the new BND building actually does as our research showed. But unsurprisingly, they were unwilling to comment about this. How do you hack the biomedical system? There are two parts of the process. In the first part of the step, you record the features and you generate template data and a photo of that. And in the second step, you make the dummy to get features through the SNF. That's very interesting. There are two systems that have encrypted communication between them. But somewhere in the software, of course, the image is unencrypted in the memory and you just find someone who is good at the eater and has a hook and extracts the imagery. And that's our starting point. And if in doubt, you can see, oh, that doesn't really look like skin or tissue. So you just adapt to that and maybe use a different type of paper. But you can also use this paper to make a... So the real attack works like this with a regular camera. And that's what surprised us. You can actually make pictures of veins with a DSLR. The only thing that you have to do is to remove the infrared filter. It's a regular Silicium silicon chip, but it has an infrared filter that you have to remove and you just take pictures with it. It sounds very simple, but it took us a bit of time because we tried various cameras. A grayscale camera with various resolutions, various lenses. How far can you be away from the target? Camera settings, aperture and filter, no filter, different light sources. Flash, no flash, infrared, handheld light. We made about two and a half thousand pictures and the results speak for themselves. These are the images that we got from the DSLR. One for the finger veins with the flash behind the finger. The hand was in between the light source and the camera and on the right side for the hand vein recognition. And there we had the flash light from the front. And that was from a distance from five or six meters and there was no problem. You could probably zoom even more, but at some point the flash stops being useful. Since this worked so well with the digital SLR, we thought, oh, we have to try this in a more sneaky way. And we just used a Raspberry Pi camera module with infrared LEDs and infrared camera and looked at various places where we could use them. And these hand drives are perfect because you just move them up and down. Has anyone dried their hands at the Congress already? That's what it looks like. We didn't manage to set this up here at this venue, but we tried to stage this as realistically as possible. And those are the pictures from the Raspberry Pi camera with the LEDs in the camera. And for the fingers, we have a small infrared illuminator that we placed on the other side. And I think it's very obvious that you see the hand veins. It's basically not possible to do this better. The manufacturers, the vendors have pictures that look worse than this. And in the next step, we thought, oh, we have good pictures. We need some kind of software to extract the raw vein patterns. So we wrote a small Python script. It's basically very simple image processing that we try to display here. It just takes the image as the input and we increase the contrast and segment the picture in small tiles, increase the contrast. And we have a very homogenous picture in the final step. In the next step, we're applying a threshold. Everything that's darker gets assigned dark pixels and everything in the slider is white. That's at the top right. And there's a lot of noise in there and a lot of shadows. And we filter that with a Gaussian blur. And then we blurred that a bit more because it's better if there are no hard corners. And because it was a bit thicker during our image processing, we skeletonized the result. And compare this. This is a DSLR picture from five meters away. And the right part is what the software outputs. And the same thing for the finger veins. This is basically the same. You just have to adjust the parameters a bit because the light is from the other side. And for the next step, we have our method of obtaining the patterns. So now we have to build the dummy. And what we did, we tried it with an inkjet printer, but you don't see anything. That's basically like a blank sheet of paper. And at some point we found that a laser toner is very apparent and that's where we started. We started to look for some material and started to stack the paper because the main problem was that the recordings were way too bright because it was way too bright. And we knew that we have to somehow subdue it. So we used latex gloves and by coincidence we found that B wax basically looks like humans tissue. So we built this mold and filled it with B wax and had the print out of the laser toner on top and another layer of bright red B wax. And if you present this to the scanner, it recognizes it without any problems. So we have a live demo and I hope this works. All right. So you can assign an ID, a four digit ID here. My hand is going to be zero. Okay, that was very clear. Hold on, we have to plug the USB. That is the perfect demo effect. All right. That was my right hand and the same with the wax dummy. Show effect. All right, darken the stage a bit please. If need be, we have a video, but it's a bit shaky. Access denied, please place your hand above the sensor. So we just tried this a couple times and it always worked. Well, I would say we'll continue with the finger wanes. So we have prepared a video so that you actually believe us. As we said, it's a bit shaky. That's the hand at the sensor. And now at the bottom of the screen, you should see the number four times seven with a hand. And now we place the wax dummy. And again, you see the four times seven. We'll retry the demo at the end of the presentation. We're sure we'll get it to work. It might be the lights. All right. Due to the lighting situation, we'll retry under the table. Ah, success. So we guess that it's the stage lighting that casts enough infrared lighting and stops the sensor from working. So the next thing we want to talk about is finger veins. And first I'll demonstrate with my own finger to show that it's enrolled. Starbucks right pointing finger. And the demo in the first time with the wax dummy. What's going on? So what you see here is the same cast we used for the finger dummies. Same principle. We used beeswax for a base plate. Then a printout and wrap that in red wax. Works wonderfully with the sole difference for the finger vein. What we did was mirror the output and wrap it from the other side using the wax as a dampening material between the printout and the scanner. During all of our work, we had this open question of how does it do a life detection? You can read in carrots and wax, especially the hand vein scanners. The vendors advertise that they have a life-less detection, both of them. And apparently that's not the case. Looking into this, there's a lot of papers that explain how something like that could be accomplished. For example, one could use an infrared laser to detect blood motion. There's papers where people demonstrate comparing the size of different parts of the vein. What you see at the right edge of the screen is looking at the structure of the paper, of the actual toner on the paper. Some extra thoughts for what we thought about. If vendors improve their devices, we need to improve our attacks as well, obviously. One idea that we could use is to laser edge or mill this into other materials to have more fine-grained detail or 3D print the dummies. It could be possible to scan 3D models of veins and of course print them. In theory today, it's possible to actually print blood vessels, so that should also work. In the end, I'd like to thank everyone who helped us, people who sponsored the cameras. Thanks to the audience for listening to us, and I'd like to close it with a Q&A. As always, the microphones are spread throughout the room. If you have questions, please walk up to one. The most important remarks are questions should be one sentence ending in a question mark. If you're speaking into a microphone, please walk up to it closely. I think there's someone at mic number six. How probable is it that this would work under real conditions? Do you mean the actual authentication with a fake finger? With a fake finger, yes. These are old systems, but we also tried with newer hardware and software. And it really is a question of how you place your fake hand or fake finger. If you place it in the right place, it's actually quite likely, I think you actually calculated this. There's about an 80% chance that the environmental conditions are right. So these weren't simply the wrong environmental conditions. But we are planning to try this in a more practical way. For example, Poland is not far away and we're already in touch with people. Have you ever done an entropy analysis of the data? How different are veins in hands? We didn't, but there are papers on this. I think we have it in our collection of papers. I can probably send you a link. I have a general question. How do tattoos affect this? There are some problems with this, particularly thick fingers. For example, the problem hair on the fingers can be a problem. And tattoos might be a problem if they absorb in the infrared range. But I don't have any experience with this. If you have a tattoo, you can come up to us and we can see what happens. The question was probably half answered. So my question is what can you do to stop the finger from being recorded? Injuries or dirt are fairly unproblematic as long as it doesn't absorb infrared light. But if you paint your fingers with markers, then you're probably on the safe side. So we expect Congress to happen with blackly painted hands now. The question from the internet. The question is, which politician's hands will end up in the next datenschleuter, a CCC magazine? We did try to make some, but the photographer unfortunately didn't have as much time as they did last time. But ministers of the interior, of course, are always a target. Have you ever talked to the manufacturers and what do they say? We talked to both of them. We were able to speak to the people at Hitachi in Tokyo directly, in fact. And they were very interested and said that they hadn't seen this before either and they're working on a solution. But it still worked as it did. Fujitsu was a bit different. They had people here in Berlin and we met at the club. They brought their own devices, looked at it and nodded. It was an interesting experience of responsible disclosure, how large a difference in reaction can be. Hitachi was very interested in improving, whereas Fujitsu is likely to publish a statement on our talk, stating that it's only reproducible under laboratory conditions and not relevant to security. You don't have that much more work to do. A question for your fantasy, what other biometric points of this huge body could one use in 5, 10, 15 years? There was one interesting system that took heartbeat curves, but it was broken by somebody last year. The shape of the ear can be measured using white noises and its reflections. DNA will be coming, but I don't really see anything useful that can come out of this. What's the difference between a liveness detection? What are the vendors selling? Do they mean just basic detection or what is it? They actually are stating that you can't use severed limbs for this, so that really seems to be the meaning of a liveness detection. But the fact that laser toner ink or laser toner can work as well, nobody really did seem to be aware of that. I have a question. Did any of the systems detect the dummy as a dummy? We can't say anything about this. We met with Hitachi and tested things, but that was confidential. There is one more question from the internet. So, in the dummies is yellow the bottom and red above? The red side is presented to the sensor. Alright, one more question, Mike, number six. How long did you work on this? About half a year, three quarters of a year, but not full time after work and family. So, in total might have been a month of work in total. We refined our approach quite a bit, but once you found out how to do this, it takes a matter of 15 minutes. You take a photo, post-process it a bit and make the wax hand and there you are. All you need is a good idea. Have you looked into which companies use vein detection as a stand-alone of any patient in the method? I work for critical infrastructure and they use vein detection space and the temperature of the hand. So, is this research still relevant or did the state of the art already advance beyond it? In Germany I know of only one company that uses vein detection and there is the only feature they use together with an access card. Otherwise you have to overcome all these features in separation. Face recognition has been cracked, temperature might be a bit more difficult. Wax is not going to melt because your body temperature is rarely 60 degrees. And cash machines in Japan use very simple vein scanners, so they don't use anything fancy. But tell us where you work, tell you personally after it. On one of the slides with the ATIN there was a finger scanner without the grid jack top. How does that work? It can't light through my finger, how does it, what's the method? You're talking about this one. You can also shine infrared light from the side and because it gets scattered it will work as well, so if you have space with tricks you can also shine the light from the side. We didn't have any systems that worked in the same way, but I would assume that there would be minimal changes required in building the fake hand. Did you have any other materials that could be used in this? Carrots work very well. The three-dimensional structures are sometimes sufficient that you naturally find in carrots. No, using drawing them manually is far more difficult than printing them. And we'll see how the vendors improve their systems and then we'll see how we can improve our cracks. Can your method be applied to retinal scanners as well? Very good question. I mentioned that there are nearly no systems left to crack. Retinal scanners are the last thing we're going to have to look at. The problem is getting your hands on one of these devices, so if any of you have one of these devices lying about we wouldn't mind getting to play with it. Mike, number seven. You had this image of a hand dryer with a special sticker on it. Did that have a special significance? Possibly, yes. Probably. When we google these images, the first four images look like this. There has to be a reason for these stickers to exist. Time for one or two last questions. How many talks do you have to continue to hold so that the vendors will recognize that biometrics is identification but not authentication? I would like to leave that question unanswered. Question from the internet. The internet would like to know what the added factor is that one should add to make the system secure. Aliveness detection is a good idea, but it simply makes circumvention more expensive. You could use fingerprints at the same time, fingerprints plus veins in the finger, but that's a combination, so you have to build both of these separately into the same fake hand. I don't see much problems with that. You said you were roughly half a year. How difficult is it to take the photo that you need to create the dummy? With the small Raspberry Pi camera, that's fairly easy. We haven't shown you this. Maybe we'll have time to test this, but you can run a video as you move your hand over the sensor. They're pretty good pictures and you can just sit them together. With the DSLR, the hand has to be exposed. But we did it in our living room, so we didn't have to go to a dark room or anything. You can do it on the street. We tested this earlier under real life conditions. This was two hours before this talk. You can see it. It's not quite as nice as it would be under controlled conditions, but you can do it. You might be able to take several photos of the hand or take a video. Thank you very much.