[00:00.000 --> 00:04.400] So while we're getting ready, I'm having some display issues. [00:04.540 --> 00:06.960] So if you see me look over to my left, it's because I don't see the slides. [00:07.100 --> 00:07.800] I've got a copy here. [00:07.840 --> 00:10.160] So I don't have a tick or anything. [00:10.300 --> 00:11.140] I can't see that. [00:11.760 --> 00:12.740] But we'll get through it. [00:12.840 --> 00:13.260] We'll get through it. [00:21.810 --> 00:22.370] I know. [00:22.670 --> 00:23.210] Yeah, it's... [00:30.740 --> 00:32.240] Okay, so thanks for coming to the talk. [00:32.440 --> 00:33.500] My name is Josh Datko. [00:33.680 --> 00:36.220] I will be talking about crypto for makers. [00:36.560 --> 00:40.400] So projects to do with BeagleBone, Raspberry Pi, AVR, Arduino. [00:42.660 --> 00:44.980] We are going to talk about a few things. [00:45.100 --> 00:46.380] We're going to kind of motivate the problem. [00:46.380 --> 00:51.040] Why I care about this and why I think people should care about kind of doing security with embedded devices. [00:51.920 --> 00:55.540] Going to give a quick device overview for those maybe unfamiliar with some of these. [00:56.120 --> 00:57.540] Got a very quick crypto background. [00:58.340 --> 00:59.820] What kind of why I'm interested in hardware crypto. [01:00.920 --> 01:04.040] I built with SparkFun, made this device called the CryptoCape. [01:04.040 --> 01:06.960] So I'm going to kind of talk about what that process was. [01:07.680 --> 01:09.280] Walk through each of the security ICs. [01:09.320 --> 01:11.840] So I've been kind of playing with some embedded crypto chips that I think are interesting. [01:12.580 --> 01:16.640] And then lastly, I have this project where I run a Tor Relay on a BeagleBone. [01:17.300 --> 01:19.120] And so I'm going to talk about how to do that. [01:21.300 --> 01:27.920] So Bruce Schneier has this article back in January called The Internet of Things is Wildly Insecure and Often Unpatchable. [01:28.660 --> 01:30.320] And mainly he's talking about routers. [01:30.640 --> 01:35.880] And the embedded systems community typically has been pretty bad with security. [01:36.340 --> 01:40.720] And he's, among other people, are concerned about upgrading the Internet of Things. [01:41.140 --> 01:44.100] And he offers three points that are kind of call to actions. [01:44.440 --> 01:49.540] The first is that we should have open-source drivers, right? [01:49.540 --> 01:50.500] So no binary blobs. [01:50.900 --> 01:53.620] And so the maker community is actually pretty good about this, right? [01:53.720 --> 01:54.540] Almost too good, right? [01:54.620 --> 02:00.220] So I joke you can tell a hardware engineer if they use forms as their source control, right? [02:00.340 --> 02:02.960] So if they are posting things to forms and they're like, oh, I made a change. [02:03.080 --> 02:04.920] And then they post their Arduino sketch and they post it again. [02:05.080 --> 02:05.840] Oh, here's Rev2. [02:06.080 --> 02:08.340] It's like, oh, guys, you know, learn Git, you know? [02:09.120 --> 02:12.420] So that's all you can tell hardware engineers and software engineers on forums. [02:12.980 --> 02:16.020] But so makers are generally pretty good about releasing open-source drivers. [02:16.180 --> 02:18.040] And I think we're pretty good about this. [02:20.500 --> 02:23.960] The next thing is having an automatic software update mechanism. [02:24.420 --> 02:29.060] And so, again, talking about routers, the problem here is that you have a binary blob router. [02:29.420 --> 02:31.380] It needs to update because the heart bleed. [02:31.780 --> 02:34.980] And there's no way to update it because it's one, it's binary. [02:35.140 --> 02:36.480] So you can't even fix it if you wanted to. [02:36.680 --> 02:38.580] And two, there's just no way to update this router. [02:38.580 --> 02:42.220] So you're stuck with this router that is contributing to this, you know, botnet. [02:42.740 --> 02:44.400] And then, you know, everybody's kind of stuck. [02:44.780 --> 02:50.240] And so the third thing is we need to design secure systems. [02:50.400 --> 02:52.300] So this is kind of like, okay, thanks, Bruce. [02:52.960 --> 02:53.680] Thanks for the tip. [02:54.100 --> 02:54.500] Got it. [02:55.900 --> 03:02.700] But what I wanted to do in kind of in this area is I wanted to make, I wanted to make a tool that would help with this. [03:02.740 --> 03:09.040] And so I think that makers are driving the Internet things, you know, not companies. [03:09.200 --> 03:11.240] So the projects that we're doing, we're connecting things to the Internet. [03:11.520 --> 03:13.280] I think that's really driving the conversation. [03:13.540 --> 03:17.500] And so I wanted to make this tool that would help people secure that. [03:17.640 --> 03:25.940] And then so this talk is basically about the story of me getting into that and trying to build this tool that hopefully helps people secure their projects a little better. [03:27.600 --> 03:28.040] All right. [03:28.260 --> 03:29.920] So this is an Arduino Uno. [03:30.400 --> 03:32.120] It's a 8-bit AVR. [03:32.240 --> 03:34.960] Arduino, obviously, you know, Arduino also makes 32-bit versions. [03:35.260 --> 03:36.500] This is the 8-bit version. [03:37.140 --> 03:38.740] Uses that mega as 328P. [03:38.980 --> 03:45.300] It has 2K SRAM, 1K EEPROM, 16 megahertz at the 5-volt version. [03:45.300 --> 03:49.800] If you lower the voltage to 3.3 volts, it'll run at 8 megahertz. [03:50.500 --> 03:51.660] A lot of different I.O., right? [03:51.720 --> 03:52.940] So you can do a lot of fun stuff with this. [03:53.360 --> 03:56.360] The nice thing about Arduino Uno is it has no operating system, right? [03:56.420 --> 03:58.320] So you can get very real-time control. [03:58.800 --> 04:00.940] So you can do very kind of fixed-timing things. [04:01.200 --> 04:03.920] The bad thing about Arduino Uno is it has no operating system. [04:04.100 --> 04:12.180] So if you're trying to do any kind of, you know, sophisticated projects that need some sort of software library, you know, you're kind of stuck because it just doesn't run in OS. [04:13.140 --> 04:18.100] And so for this talk, if I say Arduino, I'm generally referring to the AVR versions. [04:18.260 --> 04:22.140] I know there's other ones there, but if I say Arduino, I mean an AVR version. [04:24.520 --> 04:25.720] So this is the Raspberry Pi. [04:26.080 --> 04:26.980] This is actually the B+. [04:26.980 --> 04:27.920] It just was announced. [04:28.020 --> 04:34.380] And I always think it's funny when hardware guys use letters to indicate it because it always gets a worse grade, right? [04:34.480 --> 04:36.020] It came out with A, now it's the B, not B+. [04:36.580 --> 04:37.580] So this is the B+. [04:38.660 --> 04:40.300] A 700 megahertz processor. [04:40.540 --> 04:41.280] It can be overclocked. [04:41.780 --> 04:43.860] 512 megabyte RAM has the composite video. [04:43.860 --> 04:46.540] And so that was one of the changes with the B+, is it has that nice 4-pin. [04:47.380 --> 04:48.320] Everything's in that one connector. [04:49.060 --> 04:51.720] Lots of different GPIO, SPI, I2C, UART. [04:51.940 --> 04:53.400] It has a hardware random number generator. [04:53.580 --> 04:55.840] So I think that's interesting from the crypto point of view. [04:56.160 --> 04:58.860] It runs Raspbian, which isn't quite Debian ArmHF. [04:59.560 --> 05:06.540] So there's some issues trying to get some software there, but they do their best trying to make this Raspbian distribution that'll work on the Raspberry Pi. [05:07.280 --> 05:10.480] And so this is actually my platform of choice, the BeagleBone Black. [05:11.020 --> 05:16.160] I like it because it's got the 1 gigahertz ARM processor, the 512 megabytes RAM, so that's the same. [05:16.440 --> 05:19.180] It has two independent programmable real-time units. [05:19.320 --> 05:24.360] So this hasn't really gotten a lot of attention, mainly because the C compiler wasn't released, I think, about two months ago. [05:24.480 --> 05:27.920] But this gives you nanosecond guaranteed execution, right? [05:27.960 --> 05:28.780] They're both independent. [05:28.960 --> 05:30.800] They have a shared memory interface to the main processor. [05:30.800 --> 05:37.280] And so you can kind of combine microcontroller stuff with Pruse and do some neat stuff with that. [05:37.400 --> 05:40.660] And like I said, the C compiler is out now, so that should help. [05:40.860 --> 05:44.040] And I've seen on the BeagleBone.org groups a lot more interest in this now. [05:44.800 --> 05:48.160] It has crypto accelerators for AES, SHA, and MD5, right? [05:48.260 --> 05:55.480] So these also haven't gotten a lot of attention, mainly because the OMAP driver is in 313 and the Beagle ships with a 3A kernel. [05:55.800 --> 05:59.880] But if you upgrade to 313, which is actually easy to do with the scripts, you will have those drivers. [06:00.940 --> 06:01.960] I'll talk about a little bit later. [06:02.140 --> 06:05.840] They're still a little bit hard to use, but the hardware is there to do acceleration of these algorithms. [06:07.220 --> 06:08.640] Plenty of I.O., as you can see. [06:08.780 --> 06:13.480] It also has a generally-purpose memory controller, analog digital converters, has a CAN bus, right? [06:13.540 --> 06:15.620] So if you want to hook it up to your car, that could be kind of neat. [06:16.100 --> 06:17.560] It's also fully open-source hardware. [06:17.740 --> 06:19.080] So you can go build this yourself. [06:19.240 --> 06:20.420] All the design files are published. [06:20.640 --> 06:22.380] You can also build a product around it, right? [06:22.520 --> 06:28.940] So the one from CircuitCo is not really recommended because most of the distributors have kind of limited to one purchase per person. [06:30.520 --> 06:36.980] But Embist makes a clone, and there are some other clones that are out there that, you know, if you want to buy like a hundred of them, you can do so. [06:40.230 --> 06:46.610] Okay, so now just kind of a quick background of, you know, why if you're making something and why you would need crypto. [06:46.730 --> 06:52.970] And this is really, if you're trying to, if you're kind of new to this and trying to look up information, these are kind of like the terms you should Google because you'll find better results. [06:53.670 --> 07:01.610] Right, so if you run into a problem, if you have two devices, and you want to verify the authentic, the identity of these two devices, the word you're looking for is authentication. [07:03.730 --> 07:05.890] That's a feature of cryptography, which will do that. [07:06.070 --> 07:09.490] The other problem is if you have, you want to keep some data secret, right? [07:09.610 --> 07:12.890] So this is a confidentiality feature of cryptography. [07:13.490 --> 07:16.890] The next one is, right, to verify your data didn't change, right? [07:16.950 --> 07:24.710] So this is like if you see something on the Internet, and you download it, and it has this kind of 20-byte value after it, and that's something you told us you'd verify, but probably don't. [07:25.230 --> 07:28.490] That is an integrity feature of cryptography. [07:28.790 --> 07:32.750] And then lastly is, you know, how do you prove a device performs some action? [07:32.970 --> 07:35.150] And so this is a non-repudiation feature. [07:35.550 --> 07:42.450] And so if you haven't heard that term before, basically to repudiate something is to deny something, non-repudiate to make sure that you can't deny it. [07:44.290 --> 07:47.050] Okay, so why am I interested in hardware crypto? [07:47.230 --> 07:49.490] Well, I think hardware crypto provides three features. [07:49.870 --> 07:52.790] So the first feature is kind of a little bit obvious. [07:53.110 --> 08:01.690] If you have an AVR, right, and you need a random number trainer, or you need a certain algorithm, the hardware crypto acts basically as a library, right? [08:01.770 --> 08:04.870] So you put the hardware chip on there, right, then you gain that feature, right? [08:04.930 --> 08:12.430] So if you are limited because you are only working with an AVR, then, you know, you may just certainly need a hardware-embedded chip to provide the feature you're going on. [08:12.930 --> 08:19.430] Otherwise, you're going to have to use your memory, and you may or not have that because of whatever the application that you're trying to do. [08:21.130 --> 08:25.650] The second thing, which I think is a feature of hardware crypto, is to do algorithm acceleration, right? [08:25.710 --> 08:34.790] So you can offload some of the crypto to a special coprocessor, and that will accelerate that algorithm, leaving your CPU to handle whatever the task was that the CPU was supposed to handle. [08:35.590 --> 08:38.850] And the third feature, which I think hardware crypto provides, is key protection. [08:39.450 --> 08:43.450] So these are mainly for asymmetric algorithms, so public-private key pairs, right? [08:43.750 --> 08:49.130] But hardware crypto that generates the private key in the hardware and doesn't release it is of special interest to me. [08:49.470 --> 08:51.630] And we'll be talking mostly about this third feature. [08:54.830 --> 08:57.450] Okay, so to touch briefly on crypto acceleration. [08:58.090 --> 09:02.110] So crypto acceleration is very useful when you have a higher-priority CPU-bound task, right? [09:02.110 --> 09:06.210] So if you're doing network traffic, a lot of times you'll see this in the web server world with hardware security modules. [09:06.850 --> 09:13.690] And so they'll have something like a PCIe hardware crypto accelerator attached, and they'll offload all their SSL to these hardware security modules. [09:13.830 --> 09:18.590] These things cost like tens of thousands of dollars, and they're FIPS 140-2 certified, right? [09:18.670 --> 09:21.430] And so that's a little bit more expensive than a BeagleBone. [09:23.030 --> 09:25.150] But the BeagleBone has those crypto accelerators. [09:26.250 --> 09:33.010] So if you're using it as like a VPN server or something like this, it'd be really nice to offload that AES traffic to lower the CPU usage. [09:34.070 --> 09:37.550] Also a lot of people use BeagleBone Blacks for robotics and robotic vision, right? [09:37.650 --> 09:39.390] So it's doing some sort of machine learning algorithm. [09:39.630 --> 09:40.790] That's taking a lot of CPU. [09:41.090 --> 09:42.510] It's also communicating over network. [09:42.710 --> 09:47.070] You really want that robotic device to have also that real-time capability. [09:47.530 --> 09:49.510] Crypto acceleration would be nice. [09:50.050 --> 09:51.830] So I tried to do this, right? [09:51.930 --> 09:52.830] So I've got some blog posts. [09:52.930 --> 09:56.070] You can go look on how to basically what I tried to do with this. [09:56.590 --> 10:00.510] It's a little bit complicated because you have to kind of statically compile everything and upgrade the kernel. [10:00.950 --> 10:06.470] But if you're kind of looking to jump off of what I've done, you can go to that link and see how far I got. [10:08.050 --> 10:13.750] Okay, so now I'm going to talk about in context of this CryptoCape, which you may not know yet. [10:13.870 --> 10:15.830] But basically, I wanted to have this device. [10:16.450 --> 10:22.790] And I wanted, back at the end of last year, I wanted this device that would provide key protection for some of these asymmetric algorithms. [10:22.790 --> 10:25.370] I wanted a battery-backed RTC. [10:25.550 --> 10:28.850] So that's important for security systems to have kind of accurate time. [10:29.070 --> 10:31.990] I wanted this idea of having this trusted controller, right? [10:32.130 --> 10:37.690] So I wanted an ability to upload some sort of software to another microprocessor or microcontroller. [10:37.870 --> 10:41.990] And then know that a software vulnerability couldn't change the software running on that piece of hardware. [10:42.510 --> 10:44.370] And I wanted it to be hackable and fun. [10:44.370 --> 10:46.090] So this is kind of important, right? [10:46.210 --> 10:51.910] So I wanted to make a device that I think other people would pick up and be like, whoa, I can make this project or I can do this. [10:52.070 --> 10:59.510] And so trying to introduce some fun into this kind of otherwise very serious business here. [10:59.650 --> 11:02.550] So November 2013, I kind of made this diagram. [11:03.290 --> 11:04.990] And I was like, well, I found these chips. [11:05.230 --> 11:06.230] They all look pretty cool. [11:06.450 --> 11:08.450] You know, they're all on an I2C bus, you know? [11:08.530 --> 11:09.730] So I think I can do something like this. [11:10.210 --> 11:13.910] And as you can see there, or maybe you can't read, but they're basically all Atmel chips. [11:14.330 --> 11:18.250] And so I went shopping around for, you know, chips that would do this. [11:18.650 --> 11:22.130] And basically, you know, I looked at a whole bunch of different vendors, tried to do the research. [11:23.350 --> 11:26.770] And, you know, really, Atmel was kind of like the clear chip provider here. [11:26.890 --> 11:29.530] So first of all, I knew of Atmel from the Arduino community. [11:29.670 --> 11:31.510] So I was like, okay, so I know these guys. [11:31.910 --> 11:33.790] Their chips are available on DigiKey and Mouser. [11:33.910 --> 11:34.930] So that's a big win, right? [11:35.510 --> 11:40.430] Typically, some of these vendors will have NDA chips, and you can't buy them through the normal distributors. [11:40.550 --> 11:43.610] So that's kind of like, you know, you first have to do this NDA dance. [11:43.610 --> 11:46.890] And some vendors are not really willing to give it to individuals. [11:47.150 --> 11:49.270] So, okay, so I've got this company, right? [11:49.370 --> 11:50.650] So I can probably get the NDA thing. [11:50.770 --> 11:54.470] But then it's like, well, then I can't really distribute it because they don't, you know, everything's NDA'd. [11:54.710 --> 11:59.630] So it's kind of like, oh, well, I mean, your chip looks nice, but it's not really going to work. [11:59.830 --> 12:02.790] So that was another thing. [12:03.690 --> 12:08.410] So this is kind of a big distinguisher for me because a lot of the documentation is freely available. [12:08.410 --> 12:14.150] So they do have some NDA chips, but for a lot of their chips in the crypto mine, the whole spec is published, right? [12:14.310 --> 12:17.210] So if you don't have an NDA spec, it's really hard to write a driver for it. [12:17.650 --> 12:21.770] But Atmel does release the full specs for them. [12:21.890 --> 12:25.670] And so even their NDA chips, they produce a code library. [12:25.990 --> 12:32.850] So the document is under NDA, but they have a library that you can go download and then basically see the features you want to use in that library. [12:32.850 --> 12:36.090] So I don't know of any other vendor that just, you know, has code out there. [12:36.650 --> 12:38.070] So that's kind of a big win. [12:40.930 --> 12:42.110] And I'm on the wrong screen, sorry. [12:44.290 --> 12:47.670] Okay, so, and then, you know, they have some dev kits, right? [12:47.910 --> 12:49.590] That you can get, again, from DigiKey, Mouser. [12:50.190 --> 12:51.730] They have demo software that do all this stuff. [12:51.790 --> 12:54.830] So basically, I found Atmel to be very maker-friendly, right? [12:54.870 --> 13:04.610] So if people are working with Arduino, they may have already known that, but even for their security ICs, which I don't think got a lot of attention, I've found them to be great to work with. [13:05.570 --> 13:07.610] And so if you look at their dev kits, right? [13:07.730 --> 13:11.230] So these are some of the dev kits, the one on your left, right? [13:11.270 --> 13:12.410] Has this nice socket interface. [13:12.610 --> 13:14.830] And if you're doing anything with, like, SOA gates, oh, man. [13:14.970 --> 13:17.010] Like, a socket is really nice because you just pop it in there. [13:17.110 --> 13:20.470] And these crypto chips have these features where they have one-locking mechanisms, right? [13:20.470 --> 13:21.670] So you burn the one-way fuses. [13:22.270 --> 13:24.210] So basically, the idea is you set up the chip. [13:24.350 --> 13:26.590] You tell it, hey, this is how I want to use the keys. [13:26.650 --> 13:28.830] This is, like, how I'm going to set up my management team. [13:29.070 --> 13:30.290] You burn the fuse, right? [13:30.350 --> 13:31.630] And then you can't go back. [13:32.550 --> 13:38.010] So if you have this already sawed to a board, and then you're trying to write this driver, and then it's like, ah, well, crap. [13:38.170 --> 13:38.990] What do I do, right? [13:39.090 --> 13:40.870] So if it's in the socket, it's, like, really nice. [13:40.950 --> 13:42.370] You just pop it in and, you know... [13:42.370 --> 13:43.730] So that's kind of a cool thing. [13:43.830 --> 13:47.990] But even if you're doing anything without SOA gate, like, you should look into getting a socket if you do any kind of stuff like this. [13:48.190 --> 13:53.150] And then the one on your right is one of their TPM breakouts, right? [13:53.170 --> 13:53.970] So if you're doing things... [13:53.970 --> 14:00.650] We'll talk about the TPM later, but it has this nice breakaway header so you can kind of set it up, you know, break the board, and then kind of plug it into whatever you're doing. [14:00.650 --> 14:03.390] So they have some nice stuff. [14:04.150 --> 14:06.850] And so I was like, okay, I want to build this thing. [14:07.010 --> 14:08.490] It's like, wow, this is kind of, like, a little bit complicated. [14:08.650 --> 14:09.170] There's a lot of chips there. [14:09.650 --> 14:12.290] So maybe I should start a little smaller, and I discovered Tindy. [14:12.430 --> 14:14.210] And so who here has heard of Tindy? [14:15.110 --> 14:17.110] Okay, you guys have not heard it. [14:17.250 --> 14:19.130] We'll drop, like, a hundred bucks when you go check it out, right? [14:19.430 --> 14:20.890] It's like the Etsy for electronics. [14:21.130 --> 14:31.790] I mean, people are putting, you know, from things they make one of to things they make ten of up on Tindy, and it's just, like, anything you can think of electronics that guys are making with their selves are using, like, OSH Park to produce the boards, [14:32.250 --> 14:35.910] hand soldering things, putting it on Tindy, and people are, you know, shipping all over the world. [14:36.250 --> 14:41.050] So, like, I had wanted something shipped to the Ukraine in Kiev, like, right after the whole thing. [14:41.170 --> 14:42.430] And I was like, oh, hopefully it gets there. [14:42.830 --> 14:45.830] I had to go to the post office and explain, like, why I was shipping something to Ukraine. [14:46.110 --> 14:47.810] I was like, this guy wants this crypto thing. [14:47.930 --> 14:49.150] I don't know, you know, hopefully. [14:49.530 --> 14:50.930] Maybe he's trying to protect himself. [14:50.930 --> 14:53.010] So, yeah. [14:53.270 --> 14:55.970] So, someone bought it in Kiev, and as far as I know, he got there. [14:56.170 --> 14:58.530] I mean, he didn't complain about not getting it, so... [14:58.990 --> 14:59.410] But, yeah. [14:59.610 --> 15:00.930] So, I built basically... [15:01.790 --> 15:03.210] So, I was like, okay, I should probably start small. [15:04.670 --> 15:06.330] It's very easy to set everything up on Tindy. [15:06.550 --> 15:08.050] So, I took the AT SHA-204. [15:08.990 --> 15:10.170] It was one of the chips, right? [15:10.270 --> 15:12.030] I took, like, three weeks, three to four weeks. [15:12.510 --> 15:17.290] Started with our spec, wrote a whole GPL driver for it, you know, to make it Linux compatible instead of AVR compatible. [15:17.590 --> 15:18.450] Called it the hashlet. [15:18.630 --> 15:19.690] So, it does hashing. [15:19.990 --> 15:20.230] It's small. [15:20.770 --> 15:21.630] You know, I kind of suck at names. [15:22.250 --> 15:23.190] You know, so... [15:23.190 --> 15:24.890] And then I put it up on Tindy. [15:25.930 --> 15:28.050] And then, you know, I made these, like, breakout boards, right? [15:28.090 --> 15:28.770] So, it's I squared C. [15:28.910 --> 15:30.890] So, it works on the Raspberry Pi or BeagleBone. [15:31.190 --> 15:33.050] And, you know, people were like, oh, this is cool. [15:33.290 --> 15:33.910] This is kind of thing. [15:33.970 --> 15:34.310] So, okay. [15:34.570 --> 15:37.810] So, maybe there's, you know, some interest in doing something like this. [15:38.170 --> 15:38.450] Right? [15:38.510 --> 15:41.390] And so, then I found these guys, which you may have heard of. [15:42.270 --> 15:44.670] So, I did a hacker in residence program at SparkFun. [15:44.670 --> 15:48.710] And I just want to tell you about this program because it is very, very cool. [15:49.190 --> 15:51.550] So, you apply to this hack in residence. [15:51.690 --> 15:52.670] Right now, it's like a two-week thing. [15:53.470 --> 15:54.930] And you tell them about your project. [15:55.090 --> 15:56.530] And there's a little application thing. [15:56.950 --> 15:59.350] And you basically have to do a tutorial for them, right? [15:59.370 --> 16:00.210] Some sort of blog post. [16:00.370 --> 16:01.270] You do a lunch and learn. [16:01.950 --> 16:04.430] And then you kind of have to, like, share your project. [16:04.590 --> 16:07.890] But in return for all that, you get the following. [16:09.030 --> 16:11.170] So, you get to stay in downtown Boulder, Colorado. [16:11.490 --> 16:12.550] So, Colorado is nice. [16:12.950 --> 16:15.530] And there are certain things you can only do in Colorado. [16:15.950 --> 16:17.550] Like hiking and... [16:18.430 --> 16:18.750] Yeah. [16:18.970 --> 16:19.310] I can't... [16:19.310 --> 16:21.310] There's some other things that recently came to... [16:21.310 --> 16:23.690] But, you know, maybe that's, you know, attraction for you. [16:23.930 --> 16:24.250] But... [16:24.250 --> 16:25.770] So, you get to stay in downtown Boulder, Colorado. [16:27.050 --> 16:30.210] You get to, you know, work among SparkFun engineering departments. [16:30.330 --> 16:31.050] So, they give you, like, a seat. [16:31.170 --> 16:32.150] They're like, here's your soldering iron. [16:32.250 --> 16:33.550] Here's your hud air station. [16:33.850 --> 16:35.010] You know, here you go. [16:35.210 --> 16:36.210] And you're like, oh, okay. [16:36.230 --> 16:36.610] That's cool. [16:36.710 --> 16:36.950] Thank you. [16:37.950 --> 16:40.970] Obviously, you get access to the SparkFun engineers if you have questions. [16:41.570 --> 16:41.590] Right? [16:41.750 --> 16:46.010] And so, generally, there's, you know, at least like one or two people who are kind of interested in whatever niche area you're doing. [16:46.350 --> 16:48.290] And then, you just talk about some cool stuff. [16:48.490 --> 16:49.930] And then, you know, dogs come by. [16:50.090 --> 16:51.370] And you're like, oh, is that a dog? [16:51.490 --> 16:51.770] And they're like, yeah. [16:51.910 --> 16:52.190] Oh, yeah. [16:52.410 --> 16:52.590] Right? [16:52.870 --> 16:57.270] So, it's very cool, like, just to be in that kind of environment. [16:57.570 --> 17:00.350] I've, you know, worked for, like, big companies and everything before. [17:00.350 --> 17:02.210] So, this was kind of a different place. [17:02.610 --> 17:04.590] It's like, are you guys getting paid or just... [17:05.930 --> 17:07.250] And then, this is the best part. [17:07.430 --> 17:07.490] Right? [17:07.710 --> 17:09.790] You get a hardware budget and really fast shipping. [17:10.210 --> 17:10.310] Right? [17:11.410 --> 17:11.970] So, you... [17:11.970 --> 17:13.390] It's like, I'm kind of there. [17:13.510 --> 17:13.630] Right? [17:13.730 --> 17:14.470] And I'm working on this thing. [17:14.610 --> 17:17.830] And I get some, like, SOIC, you know, breakout boards and some TSOP breakout boards. [17:17.930 --> 17:18.970] And I'm like, oh, I burned one of these chips. [17:19.450 --> 17:21.350] And then I go to the point of contact. [17:21.850 --> 17:22.910] I was all trying to embarrass her. [17:23.190 --> 17:25.090] But I was like, hey, you know, can I get some more? [17:25.290 --> 17:26.090] And I'm like, oh, okay. [17:26.310 --> 17:26.390] Yeah. [17:26.530 --> 17:28.830] But why don't you, like, you know, put a one big wish list together. [17:28.830 --> 17:30.450] And then that way I only have to make one trip. [17:30.730 --> 17:31.390] And I was like, okay. [17:31.990 --> 17:32.070] Right? [17:32.130 --> 17:33.070] So, I started, like, looking through. [17:33.430 --> 17:33.530] Right? [17:33.610 --> 17:34.090] And I'm like, huh. [17:34.310 --> 17:36.310] I really could use some, like, digital calipers. [17:36.430 --> 17:39.550] Because, you know, this IC has got to be in the spec of the data sheet. [17:39.970 --> 17:40.510] And, yeah. [17:40.610 --> 17:41.710] So, I guess I could use some of those. [17:41.850 --> 17:43.850] And I probably should make sure it works on a Raspberry Pi. [17:44.050 --> 17:46.050] And, like, so, it's pretty cool. [17:46.130 --> 17:47.450] Then it just kind of just magically shows up. [17:48.450 --> 17:49.670] So, that's kind of fine. [17:49.770 --> 17:51.210] The chips were in the data sheet. [17:51.350 --> 17:51.430] Right? [17:51.530 --> 17:52.370] They were within the spec. [17:52.470 --> 17:53.110] So, I did measure them. [17:53.930 --> 17:55.730] But digital calipers are nice for all sorts of things. [17:56.950 --> 17:57.530] So, yeah. [17:57.530 --> 17:59.170] So, while I was there, I basically built this. [17:59.350 --> 18:01.030] And so, this is the prototype CryptoCape. [18:01.150 --> 18:01.210] Right? [18:01.290 --> 18:02.190] Got it all into a breadboard. [18:03.510 --> 18:04.330] Cooked everything together. [18:04.430 --> 18:05.210] Kind of make sure it was working. [18:05.410 --> 18:06.570] And then we were able... [18:06.570 --> 18:08.430] So, working with some SparkFun guys. [18:08.670 --> 18:11.930] We were able to kind of turn that into this. [18:12.170 --> 18:12.530] Right? [18:12.590 --> 18:13.590] So, this is the CryptoCape. [18:14.330 --> 18:18.770] And so, what this has on there is two different authentication chips. [18:18.930 --> 18:19.010] Right? [18:19.050 --> 18:22.430] It's got the ECC-108, which is an elliptical curve authentication chip. [18:22.510 --> 18:23.870] Where the private key stays in the chip. [18:24.110 --> 18:27.350] It has a SHA-256 based authentication device. [18:27.350 --> 18:31.550] It has an encrypted EEPROM that does AES-128 in an authenticated mode. [18:31.790 --> 18:33.590] It's got a battery backed up real-time clock. [18:33.770 --> 18:34.930] A trusted platform module. [18:35.530 --> 18:36.130] And it has... [18:36.130 --> 18:36.970] It has an... [18:37.590 --> 18:40.090] Atmega320P with the Arduino Pro Mini bootloader. [18:40.690 --> 18:42.430] And so, that's useful for all sorts of things. [18:42.610 --> 18:45.290] And so, basically, there's a couple ways to think of this board. [18:45.430 --> 18:45.510] Right? [18:45.570 --> 18:47.270] You can think of it as a cape for a beagle bone. [18:47.430 --> 18:51.010] You can also think of it as an Arduino Pro Mini without a power supply. [18:51.150 --> 18:51.250] Right? [18:51.250 --> 18:55.410] So, this thing is an Arduino Pro Mini that has these ICs connected to it. [18:55.550 --> 18:56.150] If you put... [18:56.150 --> 18:59.210] If you supply 3.3 volts to it, you know, this... [18:59.210 --> 18:59.990] This is... [18:59.990 --> 19:01.510] You know, that's also what it is. [19:04.630 --> 19:07.450] So, basically, what I'm going to do now is walk through these chips. [19:07.610 --> 19:07.670] Right? [19:07.810 --> 19:08.430] So, these... [19:08.430 --> 19:10.730] First of all, this board is completely open-source hardware. [19:10.950 --> 19:11.290] Right? [19:11.290 --> 19:12.670] So, you can go look at the schematics. [19:13.090 --> 19:14.890] Each of these chips are available on DigiKey and Mouser. [19:15.770 --> 19:17.290] So, you can, you know, go get those. [19:17.430 --> 19:21.810] You can use any of these chips for either the Arduino, BeagleBone, Raspberry Pi. [19:21.970 --> 19:22.430] So, it's all... [19:22.430 --> 19:23.570] We'll work with all these platforms. [19:23.630 --> 19:24.350] They're just I2C. [19:24.610 --> 19:27.090] So, that everything here I'm talking about should be applicable. [19:27.430 --> 19:29.430] Even if you don't buy a CryptoCape, which would be nice. [19:29.670 --> 19:32.990] But you certainly can go get the chips individually. [19:33.870 --> 19:38.450] So, the first thing I want to talk about is the EEPROM, which is not necessarily a crypto thing. [19:38.450 --> 19:43.350] But there's some very cool things that the BeagleBone does with the EEPROM, which I'd like to emphasize. [19:44.350 --> 19:47.990] So, an EEPROM is basically the thing that makes a BeagleBone cape a cape. [19:48.370 --> 19:52.990] And what happens is on boot, the BeagleBone will go out. [19:53.070 --> 19:56.630] It'll try to look for these four I2C addresses where there's an EEPROM. [19:56.870 --> 19:59.470] It'll go look at the EEPROM, look for a fixed value. [19:59.630 --> 20:03.550] And then it'll try to load a device tree blob that corresponds with your cape. [20:03.550 --> 20:13.710] And so, basically what that means is on boot, the Beagle will go probe the hardware and then load all the kernel drivers and mux all the pins automatically. [20:14.090 --> 20:16.710] And so, this is actually really cool, right? [20:16.790 --> 20:17.850] So, you don't have to do this. [20:17.850 --> 20:19.750] You don't have to do this in your program, right? [20:19.850 --> 20:22.590] This will all happen automatically for you on boot. [20:23.670 --> 20:29.550] And so, that's kind of like the closest thing I know to like plug and play hardware on a embedded device. [20:29.770 --> 20:30.770] So, it's kind of a neat feature. [20:30.910 --> 20:36.450] And so, if you're making something and it's somewhat complicated and you have to do a lot of pin muxing to get them, you know, the pins in the right order. [20:37.030 --> 20:38.550] Just consider making a cape, right? [20:38.670 --> 20:42.310] And like I said, all the cape really needs to be is have an EEPROM on it that fits in this address. [20:42.650 --> 20:45.950] And then you can put that device tree blob into the lib firmware. [20:46.190 --> 20:48.210] And then it'll boot up and everything will be configured for you. [20:48.310 --> 20:50.350] So, it's very easy to work with. [20:50.350 --> 20:52.890] So, my GPG fingerprint is also in every EEPROM. [20:53.310 --> 20:59.430] So, that way, you know, if you want to get a hold of me, hopefully, you know, you now have my GPG fingerprint. [20:59.670 --> 21:02.210] So, if you cat, you know, the EEPROM, you'll see my fingerprint. [21:06.230 --> 21:08.450] So, the next thing is the real-time clock. [21:08.610 --> 21:11.910] So, again, not necessarily crypto IC, but it is important for security, right? [21:11.990 --> 21:18.310] So, embedded systems typically have, you know, a real-time clock may be a luxury for some embedded systems. [21:18.310 --> 21:24.610] But if you start doing SSL, right, there's times in the SSL certs or there's a not before and not after field, right? [21:24.690 --> 21:26.030] So, you're supposed to check that cert, right? [21:26.190 --> 21:28.210] And so, most embedded systems think it's 1970. [21:28.670 --> 21:31.150] And so, they're just kind of skipping that time check, right? [21:31.250 --> 21:34.450] Well, you know, that cert is not supposed to be used yet. [21:34.610 --> 21:36.630] So, you really want to have a real-time clock. [21:36.750 --> 21:39.090] And so, the BeagleBone does have a real-time clock, right? [21:39.190 --> 21:43.050] But the problem is in order to power that real-time clock, you also have to power the board. [21:43.050 --> 21:45.050] So, the Beagle has this nice feature. [21:45.850 --> 21:46.850] It's got test points on the bottom. [21:47.230 --> 21:53.350] You can put, like, a single cell lipo on it and power the whole board without having to go through the five-volt power jack. [21:53.790 --> 21:55.910] But... and so, that will power the real-time clock. [21:56.730 --> 21:59.510] But, you know, I wanted something that would just power the clock itself. [21:59.810 --> 22:04.270] And also, if you think about the CryptoCape, I wanted it to kind of be like a two-factor thing, right? [22:04.290 --> 22:09.370] So, if you remove the cape that has this hardware in it, right, that time is going to go with the cape. [22:09.490 --> 22:10.670] So, I wanted that feature as well. [22:10.670 --> 22:16.750] And so, another thing is NTP, you know, may or may not... you may not want to use NTP, right? [22:16.870 --> 22:18.510] So, there have been some security problems with NTP. [22:19.410 --> 22:28.430] You know, if you're kind of interested in that, you can check out Jacob Applebaum's TLS date, which will basically slurp the time from the TLS handshake. [22:28.830 --> 22:31.450] So, that's kind of an interesting way, I think, to get time. [22:32.850 --> 22:33.250] Okay. [22:33.330 --> 22:35.830] So, the next chip is the AT-SHA 204. [22:35.990 --> 22:37.170] This is an authentication IC. [22:37.170 --> 22:41.690] And so, it does authentication in a very, you know, basic way. [22:41.890 --> 22:43.290] It's a challenge response kind of system. [22:43.470 --> 22:46.210] It uses this thing called a MAC, which is a message authentication code. [22:46.470 --> 22:49.730] So, MAC is typically a tag that accompanies some data. [22:50.010 --> 22:52.350] One of the ways to implement a MAC is with a hash function. [22:53.090 --> 22:56.410] So, the hash function that this chip uses is SHA-256. [22:56.410 --> 22:58.370] And it also does HMAC-256. [22:59.070 --> 23:02.630] The one caveat is that it actually doesn't do straight SHA-256. [23:02.710 --> 23:03.850] It actually combines internal data. [23:04.290 --> 23:06.810] So, unfortunately, like, it's not like a straight HMAC. [23:06.930 --> 23:08.890] It's kind of like app mills HMAC. [23:09.390 --> 23:10.930] But it does apply the algorithm. [23:10.930 --> 23:14.190] But it won't quite, like, be compatible with the straight up HMAC. [23:14.250 --> 23:19.730] Because it would be nice to do, like, a time-based, you know, the HTOP Google authentication protocol with this. [23:19.730 --> 23:22.690] But, unfortunately, that's... it's not compatible. [23:22.970 --> 23:26.190] So, the real thing that this chip helps with is the... [23:26.190 --> 23:27.630] Like, you have a medical... [23:27.630 --> 23:29.890] So, I think it was designed for the case where you have a medical device. [23:30.090 --> 23:31.450] And I'm the OEM of that device. [23:31.510 --> 23:34.490] And I want to make sure that my cables are my OEM cables. [23:34.850 --> 23:40.070] And so, what will happen is if I'm the manufacturer, right, I can provision these chips so they all have the same key. [23:40.250 --> 23:43.190] So, MAC is a shared key system, right? [23:43.250 --> 23:44.130] So, I provision all these chips. [23:44.690 --> 23:47.490] And then when they plug in the cable, we do this kind of challenge response. [23:47.490 --> 23:51.190] And I should know the MAC in the cable because I'm the OEM and I'm the device. [23:51.470 --> 23:52.930] And I say, hey, is this the right cable? [23:53.230 --> 23:59.010] If it's not because it's a counterfeit, right, then I don't allow data to go through the cable or I don't power it or something like this. [23:59.210 --> 24:02.890] So, this, I think, is the, like, industrial application of the AT-SHA 204. [24:03.050 --> 24:10.470] The kind of, like, maker project application is kind of, like, module-to-module kind of authentication or, like, if you have, like, a garage door opener, right? [24:10.550 --> 24:17.150] You could do something where you have something like two devices and, you know, we'll talk a little more about examples, but that's kind of that application. [24:17.530 --> 24:20.270] It does have a unique serial number and a random number generator as well. [24:20.510 --> 24:20.970] So, if you... [24:20.970 --> 24:23.990] It's a very cheap way to get a random number generator on an Arduino, right? [24:24.630 --> 24:26.230] Atmel has an AVR library. [24:26.430 --> 24:28.850] You just plug it in and you can get random numbers. [24:28.990 --> 24:30.310] You have to kind of configure it. [24:30.650 --> 24:32.250] It also draws, like, no power, right? [24:32.370 --> 24:37.270] So, it's, like, one milliamp active supply, like, when it's using for that, like, you know, short period of time. [24:37.270 --> 24:39.950] And then, it draws 30 nanoamps when it's sleeping. [24:40.510 --> 24:45.170] So, to even measure that, you need something like David Jones, you know, microcurrent gold, right? [24:45.270 --> 24:48.170] To use your multimeter to hook up to get that nanoamp resolution, right? [24:48.310 --> 24:50.230] Because otherwise, burn voltage, right? [24:51.070 --> 24:52.390] Any EV bog fans? [24:52.810 --> 24:52.970] Yeah. [24:53.830 --> 24:54.030] All right. [24:54.150 --> 24:54.710] Microcurrent gold. [24:54.850 --> 24:55.330] You should check it out. [24:56.150 --> 24:56.550] Okay. [24:56.630 --> 24:58.890] So, use of the AT-SHA 204. [24:59.090 --> 25:01.210] So, the electric imp uses the AT-SHA 204. [25:01.570 --> 25:05.790] And I don't think they're using any of the crypto features, but what they're doing is... [25:05.790 --> 25:07.090] So, the electric imp is this device. [25:07.250 --> 25:07.630] You hook it up. [25:07.750 --> 25:12.090] You can kind of get your device on the web and do all that cloud stuff, right? [25:12.270 --> 25:13.610] So, with the... [25:13.610 --> 25:16.330] Basically, you would get that module and you need this breakout board. [25:16.450 --> 25:19.730] And that breakout board has a unique serial number because it's using the AT-SHA 204. [25:20.170 --> 25:29.630] And so, what happens is when you plug your imp into a different breakout board, it will go back to the cloud and it will know a different serial number and it will run different code. [25:30.530 --> 25:32.630] So, I think that's kind of like a cool feature, right? [25:32.630 --> 25:39.870] So, if you plug in this thing into different devices, it knows it's on a different device because of the AT-SHA 204's serial number and it will do different things. [25:40.510 --> 25:44.910] So, that's the one project I know using the AT-SHA 204. [25:46.590 --> 25:48.030] So, the ECC-108. [25:48.210 --> 25:50.150] So, this one's an interesting chip, right? [25:50.290 --> 25:51.510] It does ECC... [25:51.510 --> 25:53.950] So, it does the NIST curves for ECDSA. [25:54.150 --> 25:55.490] It's basically the feature of this guy. [25:55.630 --> 25:58.650] So, the ECDSA is an elliptic curve digital signature algorithm. [25:58.650 --> 26:01.990] It's an asymmetric algorithm. [26:02.390 --> 26:06.730] And the nice thing about this chip is it will generate the ECC private key in the hardware. [26:07.210 --> 26:10.090] And that private key, once generated, does not leave the chip, right? [26:10.170 --> 26:12.530] So, you also have the option of importing a private key, right? [26:12.590 --> 26:14.210] So, if you want to like clone a bunch of devices. [26:14.670 --> 26:17.690] But once you import that key, the private key can never be read. [26:18.030 --> 26:19.850] So, that's a really, really nice feature. [26:20.770 --> 26:22.030] So, it also has this... [26:22.030 --> 26:24.090] It also has the serial number made on the number generator. [26:24.610 --> 26:27.190] So, like where you would use one of these is if you have... [26:27.190 --> 26:31.070] You probably have heard of like firmware signing and software signing, right? [26:31.090 --> 26:37.390] So, you can set up these chips so that your server can sign the firmware, push that update, and then these devices can store that public key, right? [26:37.450 --> 26:39.150] And verify that, yep, it came from the server. [26:39.370 --> 26:47.930] And so, I'd like to mention that, you know, if you're making a system, you can have a secure update mechanism and also make it hackable. [26:48.650 --> 26:51.410] And so, what I mean by that is, right? [26:51.510 --> 26:52.470] So, you can build the system. [26:52.690 --> 26:53.710] You can sign your firmware. [26:53.890 --> 26:55.670] You can push it to devices, right? [26:55.730 --> 26:59.890] But then, if the user wants, because they bought this device and they own it, right? [26:59.970 --> 27:00.210] They... [27:00.210 --> 27:02.510] I believe that they should be able to run their own code, right? [27:02.610 --> 27:06.430] So, you can have that mechanism if they want to have the secure update, right? [27:06.490 --> 27:10.310] And you should do that because that way they know it's secure and they know they're getting the right firmware. [27:10.790 --> 27:13.530] But users should be able to run code on devices that they own. [27:13.810 --> 27:16.330] And so, if they want to turn that off, they should be able to do that. [27:16.330 --> 27:22.070] So, I don't think these, you know, having these chips is necessarily in conflict with kind of keeping, like, an open system. [27:22.350 --> 27:34.330] But, yeah, for this chip, this chip is an NDA'd spec, but Atmel does release an AVR library that will show you basically how to use the signing features, which is what the kind of purpose of this chip is. [27:34.470 --> 27:40.790] And then I've written a Linux-compatible command line application for this guy as well. [27:41.390 --> 27:45.010] So, the next one on there is the ATAS132. [27:45.470 --> 27:46.890] So, this is an encrypted EEPROM. [27:47.090 --> 27:49.290] It's an AES-128, so that's kind of like... [27:49.290 --> 27:53.270] But then you have a CCM mode, which is an authenticated mode, so that's kind of like... [27:53.270 --> 27:53.630] Right? [27:53.810 --> 27:58.750] So, it owns basically in store data on the chip. [27:59.190 --> 28:00.970] And then it uses a Mac, right? [28:01.050 --> 28:01.910] So, you could have... [28:01.910 --> 28:04.350] The idea is you can use this chip in two ways, right? [28:04.370 --> 28:06.310] You can either store the data encrypted, right? [28:06.330 --> 28:08.570] And then you present a Mac and then that will let you read the data back. [28:09.670 --> 28:12.170] Or you can use it as kind of an encryptor, right? [28:12.170 --> 28:15.290] So, you can set up chips to basically give it a 32-byte packet. [28:15.550 --> 28:17.850] It will encrypt that packet and return it to the host, right? [28:17.910 --> 28:21.730] So, then you can send it to another device with a paired AES-132. [28:21.890 --> 28:23.450] And then that can potentially decrypt it. [28:23.990 --> 28:25.730] So, Atmel does have AVR code. [28:25.850 --> 28:28.950] I haven't yet been able to write the Linux driver for this. [28:30.710 --> 28:31.510] And it... [28:31.510 --> 28:32.010] Yeah. [28:32.110 --> 28:32.490] So, that's... [28:32.490 --> 28:36.090] So, if you were looking for this one right now, you can look at the Atmel's code. [28:37.530 --> 28:39.210] So, the 320-P, right? [28:39.530 --> 28:40.130] So, it's got... [28:40.130 --> 28:40.230] Yeah. [28:40.370 --> 28:43.070] So, like I said, it's got the Arduino 3.3-volt bootloader. [28:43.150 --> 28:46.490] And this ended up being one of the more fun devices on that, right? [28:46.610 --> 28:47.410] So, it's got the Arduino, right? [28:47.610 --> 28:48.590] So, yay, Arduino. [28:49.130 --> 28:54.190] But the thing is, you can upload sketches from the Beagle to the Atmega, right? [28:54.270 --> 28:58.770] So, I tied the UART lines from the Beagle bone to the Serial UART at the Atmega. [28:58.930 --> 28:59.790] So, you can program... [28:59.790 --> 29:03.010] Basically, you can program your Arduino from a Beagle bone. [29:03.010 --> 29:09.590] And, but see, I wanted this so if you could do that in software, the problem was if there was a software vulnerability, I didn't want anyone to be able to do this. [29:10.010 --> 29:14.190] So I put jumpers on there and you can only do this if you have jumpers attached. [29:14.610 --> 29:28.430] So if you pull, so the board comes without the jumpers so it means you can't do it by default, but if you solder , you know, .1 inch headers on there, put jumpers on, you can flash your Arduino sketches into that mega, pull the jumpers off, and then software can't change this. [29:28.430 --> 29:28.630] Right? [29:28.910 --> 29:30.710] You can also use the ISP programming header. [29:31.150 --> 29:32.650] So you see the little six guys next to there. [29:33.050 --> 29:34.410] You can use something like a pocket programmer. [29:35.070 --> 29:39.030] The board technically is not five-volt friendly because of this oscillator which I'll talk about a little later. [29:39.510 --> 29:46.390] So if you do, you know, make sure to switch to the no power mode but you can also program the mega right from ISP and Arduino IDE and everything is fine. [29:46.490 --> 29:53.430] So the really nice thing about that, which may not be obvious, is there's just so much code out there for Arduino devices, right? [29:53.650 --> 29:58.350] So I've taken like the fingerprint sensor and made like a two-factor thing in like minutes. [29:58.350 --> 30:01.430] Because I took someone's code library on someone's form, right? [30:01.570 --> 30:02.550] Under some beerware license. [30:02.750 --> 30:03.650] And it's like, ugh, fine. [30:04.250 --> 30:07.170] And right, loaded it, flashed that into that mega, right? [30:07.230 --> 30:07.930] And everything works. [30:08.250 --> 30:12.550] And then I'm able to interface to that from the Beagle because the I squared C lines are the same. [30:12.650 --> 30:18.190] So you put a little I squared C handler on there and now you can communicate from the Beagle bone to the mega very easily. [30:18.390 --> 30:23.270] So my original idea was to put the software, the crypto library NACL on there. [30:23.590 --> 30:30.410] So for those who haven't heard about NACL or SALT, it's kind of like, there's a lot of interest in the academic community about this library. [30:30.870 --> 30:35.830] It has some of the primitives are available for AVR, but like the whole crypto box API isn't there. [30:36.510 --> 30:39.890] Also, because the chip is running at eight megahertz, it'd be a little slow. [30:40.830 --> 30:43.650] There's also some interesting glitch attacks you can do on an app mega. [30:44.170 --> 30:47.830] So if you, if you, so, so it's for a whole bunch of reasons. [30:48.010 --> 30:52.070] It's maybe not the best to run a crypto library, but that was the original idea. [30:53.290 --> 31:00.730] And so, yeah, so I wrote this article, Linux journal, if you guys read that in May 2014, to kind of show the whole Arduino concept, right? [31:00.850 --> 31:02.750] So I explained a lot about this device tree. [31:02.890 --> 31:06.890] So if you're kind of interested in kind of how the Linux background of that, you should check out that article. [31:07.950 --> 31:09.830] And this is the schematic, right? [31:09.910 --> 31:13.310] So basically, this is like the Arduino on a breadboard schematic, right? [31:13.390 --> 31:14.450] So that's just got the ISP. [31:14.650 --> 31:18.290] It's got the lead on the normal spot that Arduino Uno has got it. [31:18.290 --> 31:22.830] The only thing that's really new about this is, so I'm tying it to the BeagleBone's UART4, right? [31:23.030 --> 31:25.610] And I'm tying that reset line to a GPIO. [31:25.830 --> 31:29.510] So that's also a nice feature because then I can software reset the app mega from the BeagleBone. [31:30.010 --> 31:31.670] So if I just want to reset it, right? [31:31.730 --> 31:33.810] I can have a script or something or make a cron. [31:33.850 --> 31:35.210] You can use all this Linux features, right? [31:35.270 --> 31:38.110] To control this app mega, which is kind of... [31:38.110 --> 31:42.350] I don't know, I've had a lot more fun with it than I originally anticipated. [31:43.610 --> 31:46.150] So the TPM is an interesting chip. [31:46.150 --> 31:49.290] So the TPM has been around for a while. [31:49.830 --> 31:56.350] There was... it got a lot of... there's like this big kind of outreach to the TPM when it first came out because of the DRM capabilities. [31:58.030 --> 32:04.010] And it's probably in each of your laptops and it's, you know, it's not all by default, so you may not even know it as a low pin count version. [32:04.730 --> 32:12.450] But so the things against the TPM is that it can kind of know the state of your system, right? [32:12.450 --> 32:20.830] So privacy advocates are appropriately concerned about the TPM knowing exactly what's on your, you know, how your system is configured. [32:21.150 --> 32:25.810] But if you think about it, right, if you're building an embedded system, that's like exactly what you want, right? [32:25.930 --> 32:27.450] So you build this embedded appliance. [32:27.630 --> 32:29.270] You want it to do this one thing, right? [32:29.330 --> 32:34.730] You're going to put it... if you put a TPM on it, you really want to know that thing's doing exactly what you think it's doing, right? [32:35.690 --> 32:39.510] So I think TPMs make a lot of sense in an embedded environment. [32:39.930 --> 32:42.790] Probably much more so than they do in a consumer laptop environment. [32:44.010 --> 32:46.390] So cryptographically, the TPM is actually kind of limited, right? [32:46.430 --> 32:47.870] It only does RSA 2048. [32:48.130 --> 32:49.230] It has SHA-1. [32:49.770 --> 32:54.570] But it has some interesting... it has these little features there that really make a lot of different functionality, right? [32:54.630 --> 32:56.710] So it's got this concept called platform control registers. [32:57.030 --> 33:02.330] So platform control register is a 20-byte register that you can only write to with this extend operation. [33:02.330 --> 33:05.670] And so the extend operation is defined there. [33:05.970 --> 33:12.610] Basically, you have to take the SHA-1 of the current value of the platform control register plus some input, right? [33:12.730 --> 33:18.170] So what that means is you can only kind of progress the PCR in one direction, right? [33:18.230 --> 33:20.010] So you can only keep adding input to that. [33:20.150 --> 33:26.290] And so based on that one feature, you can do things like secure boot and remote attestation. [33:26.450 --> 33:29.650] And so this is kind of... which we'll talk about a little bit later. [33:30.790 --> 33:33.830] But that's kind of an interesting feature that's kind of specific to a TPM. [33:34.330 --> 33:36.810] So the TPM also has this key hierarchy concept. [33:37.370 --> 33:43.110] It can, you know, has different keys in there that will wrap other keys, starting with an endorsement key and a storage root key or a shark. [33:43.830 --> 33:47.290] So yeah, so I have this... the TPM I have on there, you know, it's fine. [33:47.510 --> 33:49.010] Like, I've been able to use it for different things. [33:49.290 --> 33:52.410] There are some other ones that's like, oh, man, I want to pick that, right? [33:52.550 --> 33:55.910] So they have... so AdMail has a version of the TPM without this external oscillator. [33:55.910 --> 33:59.570] So I was like... because that oscillator is preventing the board from being five-volt friendly. [33:59.690 --> 34:00.410] I was like, oh, man. [34:00.930 --> 34:03.590] Then they actually have versions that are FIPS 142 certified. [34:03.890 --> 34:06.250] So if you're kind of into the whole certification thing, right? [34:06.350 --> 34:07.630] This certification costs a lot of money. [34:08.290 --> 34:11.250] And all the... the whole module is FIPS 142 certified. [34:11.410 --> 34:12.290] So that's kind of a neat thing. [34:12.630 --> 34:16.090] And then the other thing is for people who have, you know, maybe have used this, right? [34:16.530 --> 34:19.430] So this... the TPM version I picked ships in compliance mode. [34:20.050 --> 34:24.610] And so what the compliance mode means is that it has an endorsement key on the TPM, right? [34:24.610 --> 34:25.090] So you get it. [34:25.230 --> 34:25.890] It has an endorsement key. [34:26.030 --> 34:26.470] Things will work. [34:26.930 --> 34:29.070] The problem is everybody has the same key. [34:29.790 --> 34:31.550] So that's like a test vector, right? [34:31.970 --> 34:36.070] And so... so I didn't actually learn about this until afterwards, because I was like, hey, everything's working. [34:36.850 --> 34:40.170] And then I was like, oh, why is this key the same on this board? [34:40.870 --> 34:43.130] And then so I was like, oh, I picked the compliance mode version. [34:43.270 --> 34:44.610] So there is a way you can clear that, right? [34:45.050 --> 34:47.590] So I haven't yet put that up on, like, my website. [34:47.770 --> 34:49.230] But you basically have to clear the TPM. [34:49.690 --> 34:55.450] You can generate a new endorsement key, which is probably good anyway, because, again, there was privacy concerns about the endorsement key. [34:55.610 --> 34:56.910] So you'll generate your own endorsement key. [34:57.050 --> 34:58.150] You can't be tracked to a TPM. [34:59.850 --> 35:01.830] But yeah, so that was kind of like, oh, man. [35:02.510 --> 35:02.650] All right. [35:02.830 --> 35:07.350] So the other thing that would be nice is... so there's this new... [35:07.350 --> 35:11.250] I don't know how new, but there's this industrial version in the BeagleBone called BlueSteel. [35:11.870 --> 35:16.770] And so what they did is they removed the HDMI framer, and they removed the EMMC, right? [35:16.830 --> 35:18.710] And then it can be supported for industrial applications. [35:18.910 --> 35:22.490] So this is, again, one of those things where the BeagleBone, you know, you can use it in the product. [35:22.650 --> 35:29.330] And if you're doing something, you know, either crazy, in some cold environment or something really hot, you can actually get an industrial BeagleBone, which I think is pretty cool. [35:29.490 --> 35:33.530] And so there's a TPM version that will do industrial... [35:33.530 --> 35:35.270] support industrial regions... ranges. [35:36.970 --> 35:38.030] So, yeah. [35:38.190 --> 35:40.210] So the issue with the TPM is there's a... [35:40.210 --> 35:41.790] so it's covered by a spec, right? [35:41.870 --> 35:43.150] And specs are covered by committees. [35:43.370 --> 35:45.710] And so then you end up having very large specs. [35:46.030 --> 35:52.990] And so with the TPM, there's a lot of software, if you're using with Linux, that you have to get through before you actually talk to the actual hardware, right? [35:53.050 --> 35:54.210] You have to go through a device driver. [35:54.450 --> 35:58.570] And then there's this whole trusted computing software stack that you have to go through, and it has all these different layers. [35:59.170 --> 36:00.830] And then you finally get to your application. [36:02.190 --> 36:06.170] So in Linux, there's this package called trousers, which essentially will implement this. [36:06.610 --> 36:09.250] So you really kind of have to worry about it, but it's like this kind of... [36:09.250 --> 36:12.330] kind of a lot of bloat you have to kind of bring in just to use the TPM. [36:13.030 --> 36:17.090] If you're trying to do this on the AVR, so it is possible, right? [36:17.130 --> 36:19.510] You can talk to the chip just at the device driver level. [36:20.070 --> 36:24.150] So AppMail has code in their dev kits that will use the AVR code. [36:24.290 --> 36:25.930] So you can use TPMs on AVRs. [36:26.630 --> 36:30.630] Typically, you know, you've probably only seen them in laptops or these kind of things. [36:30.830 --> 36:35.330] But I haven't yet tried that, but I have seen the code for the AVR. [36:36.470 --> 36:37.950] So what can you do with a TPM? [36:38.590 --> 36:39.510] Well, so the thing... [36:40.050 --> 36:41.830] So there's some TPM-specific features. [36:42.030 --> 36:46.050] The first one is called secure boot, and that's a more like a stronger version of trusted boot. [36:46.250 --> 36:52.350] And essentially, what this is, is when the computer boots, it'll use that PCR extend function, right? [36:52.470 --> 36:54.270] So your computer will boot. [36:54.530 --> 36:57.890] That bootloader, before it is executed, will go out and take a measurement of it. [36:57.970 --> 37:00.010] So the measurement is essentially that extend operation. [37:00.210 --> 37:02.290] It hashes that input, puts that into a PCR. [37:02.730 --> 37:05.510] And then your second stage bootloader will... [37:05.510 --> 37:08.070] Your first stage bootloader will verify your second stage bootloader. [37:08.210 --> 37:10.190] Your second stage bootloader will verify your kernel. [37:10.710 --> 37:12.830] And then your kernel will verify your initFS, right? [37:12.950 --> 37:15.450] And keep going and load everything into the PCRs. [37:15.690 --> 37:18.830] And so when you finally get into the user space, all your PCRs are populated. [37:19.170 --> 37:21.270] Now, if none of that changed, right? [37:21.330 --> 37:23.810] You would expect to see the same PCRs every time you booted. [37:24.250 --> 37:27.590] And so that's kind of with Secure Boot. [37:28.350 --> 37:34.890] One thing you could do is to kind of like lock down those PCR values and say, okay, I only want to do things if things are at this certain PCR state. [37:34.890 --> 37:36.270] So that's known as ceiling data. [37:36.470 --> 37:39.670] So you can actually encrypt data to PCR values, right? [37:39.970 --> 37:46.710] So that means if anything in your boot chain has changed, you will not be able to decrypt something on your device, right? [37:46.750 --> 37:57.110] So that may either be good or bad, depending what you're doing, but if you were concerned about some sort of kernel vulnerability or someone changing that, right, that data would be essentially inaccessible because the PCR value has changed. [37:57.470 --> 38:05.050] Now, so an embedded system is a little bit tricky because on a laptop, you have the luxury of having a BIOS and that, you know, you have Grub, right? [38:05.150 --> 38:11.550] And so there's a lot of support for this because, you know, TPMs are made by vendors such as, you know, like Microsoft likes TPMs, right? [38:11.610 --> 38:13.070] And so they want things to work for them. [38:13.450 --> 38:16.210] So the embedded system, we're kind of a little bit out of luck, right? [38:16.210 --> 38:19.250] The BeagleBone uses uBoot and then, right, there's no BIOS. [38:19.930 --> 38:25.630] And so this guy, Teddy Reed, wrote this lib sboot basically to hook in the TPM into uBoot. [38:25.750 --> 38:36.730] So you have to kind of install that and then use the Linux integrity subsystem, which is called IMA, to get all the different measurements of basically once you pass the bootloader stage. [38:39.710 --> 38:42.350] So then the TPM supports this feature called attestation. [38:42.790 --> 38:49.190] Attestation is the ability to take that PCR value and then kind of prove that to a remote entity, right? [38:49.250 --> 38:51.690] So this is, again, where privacy people kind of freak out, right? [38:51.830 --> 39:04.270] Again, appropriately, because if you have a laptop and it boots and the PCR values are one thing, remote attestation means I can, you know, if I'm a content provider, I go ask your laptop, hey, what are the PCR values? [39:04.390 --> 39:06.630] And you tell me and I go, hmm, that doesn't match. [39:06.730 --> 39:08.450] So I'm not going to show you this movie, right? [39:08.670 --> 39:10.810] And so that's kind of concerning, right? [39:11.030 --> 39:16.210] But again, in an embedded system, you kind of actually, you know, want that feature if you're designing an embedded system, right? [39:16.270 --> 39:18.970] Because you want your device to kind of boot in a certain mode. [39:19.210 --> 39:25.830] And so TPM support this attestation feature, which I think, you know, makes actually sense in an embedded role. [39:26.370 --> 39:31.870] And so the nice thing about TPMs is there's actually a little more software support than some of the other chips. [39:32.190 --> 39:43.610] So through a software interface called the PKCS11, which essentially is a library that will kind of allow, it's a smart card library, and a TPM can look like a smart card, you can store RSA keys in the TPM. [39:44.130 --> 39:49.550] So for like SSH, right, I have my SSH keys stored in the TPM on my BeagleBone, right? [39:49.650 --> 39:51.490] So the SSH key never touches the BeagleBone. [39:51.870 --> 39:55.410] And so the developer of this, of this library, I think, is at HOPE. [39:55.670 --> 39:56.470] He may be in the audience. [39:56.630 --> 39:56.830] I don't know. [39:56.990 --> 40:03.950] But he is very, essentially allows you to configure SSH to generate and store your SSH key, right, in the TPM. [40:04.110 --> 40:04.970] It never touches the software. [40:05.650 --> 40:08.650] And so the same could be done with SSL. [40:08.970 --> 40:12.570] And then also could possibly be done with GPG, although I don't know if anyone's done that yet. [40:12.810 --> 40:15.590] And so this to me is a very attractive feature, right? [40:15.710 --> 40:21.250] So you, the whole, the Harpleat situation, right, right, it would have been less bad with a hardware security module. [40:21.550 --> 40:26.250] Because you would have still leaked, you know, the initial session key and whatever secrets were there. [40:26.610 --> 40:29.230] But that private key would never have gone into the software. [40:29.650 --> 40:32.590] And so it never had been an opportunity to been read by a software vulnerability. [40:35.670 --> 40:36.390] So, yeah. [40:36.750 --> 40:38.110] So TPM is called things measuring. [40:38.270 --> 40:39.950] This is my obligatory mean picture, right? [40:40.030 --> 40:40.670] So measure all the things. [40:41.970 --> 40:42.370] Right? [40:42.450 --> 40:46.170] And so if you have a Raspberry Pi, I don't want you to feel left out. [40:46.330 --> 40:46.330] Right? [40:46.430 --> 40:47.410] So you can use all those chips. [40:47.870 --> 40:48.230] Right? [40:48.270 --> 40:49.350] It's just the I2C interface. [40:50.110 --> 40:53.550] And I'll be putting something up on Tindy that is a little Frankenstein adapter. [40:54.090 --> 40:54.230] Right? [40:54.470 --> 40:56.010] So, yeah. [40:56.190 --> 40:57.710] So the form factor is not that great. [40:57.830 --> 40:59.910] But hey, if you really want to use the CryptoCape on a Raspberry Pi. [41:00.410 --> 41:01.610] So I got this little board. [41:01.770 --> 41:09.310] So the, again, on the Raspberry Pi, if you want to use the CryptoCape, basically just got to tie the UARTs, tie GPIO to reset the app mega. [41:09.630 --> 41:11.110] And then you have the I2C. [41:11.230 --> 41:14.270] The problem is the TPM driver isn't available until 313. [41:14.610 --> 41:17.150] So we backported it for BeagleBone. [41:17.410 --> 41:21.410] But I don't, I don't think Raspberry Pi runs a 313 yet. [41:21.590 --> 41:25.270] So the TPM might be a little bit lacking there. [41:25.830 --> 41:29.390] So when would you want to use EGIC for whatever project? [41:29.770 --> 41:35.170] So the AT-SHOT 204 is really good for basic authentication and small scale systems. [41:35.330 --> 41:35.410] Right? [41:35.490 --> 41:40.450] Because it's a shared key system, it's really hard to kind of manage if you were doing like a large deployment. [41:40.610 --> 41:47.270] But if you just have a couple devices and you want to make sure that those devices are only talking to, you know, your own devices. [41:48.310 --> 41:49.470] Or if you have a module, right? [41:49.550 --> 41:54.010] So if you have to make a module and you plug it into your Raspberry Pi, you want to make sure it's that your module. [41:54.230 --> 41:57.350] The AT-SHOT 204, you just put them on each end, you configure them. [41:57.790 --> 42:01.270] And that would be, I think, a good use of the AT-SHOT 204. [42:01.930 --> 42:05.070] The ECC 108 does provide stronger authentication, right? [42:05.230 --> 42:09.130] Because it has asymmetric photography, which is, it has that non-repudiation feature. [42:09.430 --> 42:13.070] So you would want to use these if you needed some sort of PKI support. [42:14.430 --> 42:22.430] And if, like, if you were doing like the server firmware model, you know, the ECC 108 would be good because you can have the server generate a key, right? [42:22.610 --> 42:28.750] Distribute that public key to all your devices and then the devices can authenticate that public key and then, you know, accept the firmware. [42:29.950 --> 42:31.330] So the 132, right? [42:31.410 --> 42:32.390] This is the encrypted EEPROM. [42:32.710 --> 42:34.270] The nice thing, right? [42:34.430 --> 42:37.550] It has the confidentiality and the authentication mode, right? [42:37.610 --> 42:41.750] So you could have, like, your Arduino, you could use load everything in this AES 132. [42:42.090 --> 42:45.570] And then because it needs this authentication mode, you can still require some sort of input. [42:46.130 --> 42:49.690] So if you have some sort of password thing that's the Mac, right, you kind of expose that. [42:49.870 --> 42:55.290] And then you can make sure that if the device is sitting around somewhere that people can't access that information on the chip. [42:55.550 --> 42:58.290] It could also probably store keys, right? [42:58.290 --> 43:01.150] It's only a 32 kilobyte EEPROM, so there's not a whole lot of room. [43:02.610 --> 43:09.850] And then TPM would be the chip to use if you needed, you know, like, more sophisticated software support or anything dealing with RSA. [43:10.670 --> 43:16.470] And so just as, you know, the caveat, right, none of these chips will automatically secure your project, right? [43:16.530 --> 43:23.810] So you still have to, just like you pick out some sort of component, passive component, you can't just, like, plop that on and expect it to work, right? [43:23.850 --> 43:26.150] You actually have to kind of, like, design with it, right? [43:26.310 --> 43:27.150] So the same thing with these. [43:28.570 --> 43:30.410] So there's that. [43:31.790 --> 43:36.870] Okay, so I want to kind of talk about a project that I think is a good use for some of these devices. [43:37.150 --> 43:38.770] So running TOR on a BeagleBone Black. [43:39.010 --> 43:42.030] And so I ran TOR on a BeagleBone Black for about nine months. [43:42.210 --> 43:43.250] So I had a TOR relay. [43:44.030 --> 43:54.650] And I just want to talk basically what TOR is, kind of the experiences of running that on a home network, and some things I think are nice with the BeagleBone that you can do with a TOR relay. [43:55.570 --> 43:58.870] So for those that don't know, TOR is an anonymity overlay network. [43:59.010 --> 44:04.430] So it's a network that runs on other networks, provides anonymity in the fact that it protects your IP address. [44:05.090 --> 44:09.850] And so if you should probably follow this Twitter account, right? [44:09.990 --> 44:11.350] So this is a hilarious Twitter account. [44:11.470 --> 44:19.950] What it is, is it will tweet anytime in the U.S., somebody in the U.S. Congress or Senate makes an anonymous Wikipedia edit, right? [44:20.110 --> 44:23.290] So it knows because your IP address is geolocatable, right? [44:23.330 --> 44:26.050] It knows the subnet that is reserved for .govs. [44:26.110 --> 44:27.350] And it knows, hey, this is the U.S. Congress. [44:27.610 --> 44:32.250] And anytime one of those staffers or anyone gets on there and changes Wikipedia, it tweets. [44:32.650 --> 44:33.950] And it's kind of hilarious. [44:34.090 --> 44:39.510] And it kind of really makes you, I don't know, it doesn't make you trust Wikipedia as much. [44:39.630 --> 44:41.270] But so that's why you should always go to the talk page, right? [44:41.330 --> 44:42.030] And see the background. [44:42.770 --> 44:47.570] But I think the one like the other day was one of the Russian Today journalists, right? [44:47.630 --> 44:56.530] It said, someone in the Congress made a change that like this Russian today is a journalist, and he changed it or he or she changed it to this person is a Russian propagandist. [44:57.310 --> 45:04.390] So, so if you're, you know, a government staffer, you probably should use Tor, because you won't show up on this Twitter thing. [45:05.070 --> 45:08.070] I don't know if any of you are here in the audience, but you don't have to tell me. [45:10.290 --> 45:12.510] So yeah, it also has strong censorship resistance. [45:12.710 --> 45:14.490] So there's this concept of Tor bridges, right? [45:14.530 --> 45:17.590] They were basically designed to block the access to Tor. [45:17.770 --> 45:22.510] So, sensors decided or realized that, hey, we can block Tor very easily if we block people's access to Tor. [45:23.030 --> 45:24.710] And Tor responded with the concept of bridges. [45:28.530 --> 45:31.530] And Tor is often used when governments try to shut down the Internet. [45:31.750 --> 45:34.350] So some governments are better than others at doing this. [45:34.570 --> 45:37.330] The last example, I think, was Turkey, right? [45:37.430 --> 45:39.210] And Turkey tried to block access to Twitter, I think. [45:39.350 --> 45:42.210] And then people were using Orbot on their phones to access Tor. [45:42.850 --> 45:46.210] And Tor, what's nice about the Tor project, it has these very nice metrics, right? [45:46.270 --> 45:55.130] So you can go see and look up, you know, people connecting to Tor from Turkey in this time period, and you'll see this nice spike that corresponds to when this whole thing was happening. [45:56.550 --> 46:04.590] And so, yeah, this is a little... what's ironic about this, I find it's, you know, the allegations that the government is now snooping on anyone that's, you know, running Tor. [46:04.750 --> 46:10.750] So if you have this nice patriotic poster saying, run a Tor relay, and well, maybe it's not the best message. [46:12.190 --> 46:16.810] But so for those that don't know, just a very quick primer of how Tor works and where your BeagleBone fits in. [46:18.110 --> 46:21.190] So the way Tor works is you have a bunch of nodes, right? [46:21.290 --> 46:25.210] And so you have a... some of the nodes are special nodes and that do different things. [46:25.430 --> 46:26.210] And then you have your client. [46:26.470 --> 46:27.970] So your client, in this case, is Alice. [46:28.130 --> 46:30.890] Alice is always trying to talk to Bob, who's on the other end of the network. [46:31.610 --> 46:32.930] So Alice wants to use Tor. [46:33.450 --> 46:39.710] So the problem that Alice initially finds is that how does she discover the first entry in the Tor network? [46:40.030 --> 46:43.690] Well, there's these servers called directory servers, called, in this case, Dave. [46:43.930 --> 46:47.290] And Alice goes to the directory server and says, hey, give me the list of all the Tor relays. [46:47.750 --> 46:50.710] And Dave responds, here's the Tor relays. [46:51.470 --> 46:55.390] And then Alice can build a circuit through the network. [46:55.970 --> 46:57.350] And so, right? [46:57.490 --> 47:00.030] And so the green arrows represent encrypted communication. [47:00.350 --> 47:01.450] The red arrow is unencrypted. [47:01.810 --> 47:02.830] Tor does not encrypt the Internet. [47:03.210 --> 47:08.490] So if you request something unencrypted in Tor, right, it'll output from the exit relays unencrypted, right? [47:08.550 --> 47:09.890] It doesn't automatically encrypt that. [47:09.990 --> 47:17.070] So that's why you should always use like HTTPS when you're using Tor or use Tails so that you'll get, you know, kind of all this set up. [47:17.170 --> 47:22.110] But if you ask for something unencrypted, the key point is that it comes out unencrypted at the end of Tor. [47:22.430 --> 47:27.490] And so if you run a BeagleBone Black Relay, this, you'll, your relay will participate in this network. [47:27.950 --> 47:30.030] This is unlike that OnionPie project. [47:30.210 --> 47:34.850] So the OnionPie project is a kind of like a transparent proxy. [47:35.510 --> 47:42.850] And the only issue that I have kind of with that OnionPie project is that in order to really use Tor effectively, you really should be using the Tor browser or Tails. [47:43.110 --> 47:50.790] And so if you're using like IE with OnionPie, the Internet Explorer can potentially leak of the DNS information, right? [47:51.030 --> 47:53.110] So Tor spent a lot of effort trying to make this browser. [47:53.810 --> 48:02.150] And, you know, if you first go to a DNS request and say this is the IP that I want to go to, right, and everyone sees that IP, and then you go through Tor, that doesn't really help you. [48:02.870 --> 48:04.810] So you should use the Tor browser or Tails. [48:06.510 --> 48:10.730] And then, of course, you can change your identity, you know, through the Tor network. [48:12.070 --> 48:14.750] So why do this on BeagleBone? [48:15.290 --> 48:19.770] And so I think there's a couple advantages to running this on a BeagleBone, especially on a home network. [48:20.150 --> 48:22.270] So one, you have the advantage that it's dedicated hardware. [48:22.530 --> 48:27.710] So you may... I particularly didn't want to run Tor on my, you know, main computer, right? [48:27.810 --> 48:29.850] I kind of wanted that separate into a whole different system. [48:30.330 --> 48:33.490] So that's a nice feature of running this on a BeagleBone, right? [48:33.530 --> 48:35.050] So it's also very low power, right? [48:35.130 --> 48:38.610] The BeagleBone doesn't, you know, draw that much power, right? [48:38.710 --> 48:39.710] Tor is green, right? [48:39.870 --> 48:41.230] Green is good for everybody. [48:42.090 --> 48:42.450] Right? [48:42.490 --> 48:44.170] It has a small physical footprint, right? [48:44.250 --> 48:50.930] So this is not going to be a server that's going to take up a lot of space on your counter, and maybe someone will complain, like, why you have this computer over here, right? [48:50.930 --> 48:53.350] So it's a very nice little small thing you kind of put in the corner. [48:55.390 --> 48:57.630] It's... right? [48:57.730 --> 49:00.190] You basically think of it as a low maintenance appliance, right? [49:00.250 --> 49:03.750] So I only had to... my relay only reset twice in nine months. [49:03.890 --> 49:06.990] So the one time that I went offline was Heartbleed, right? [49:07.090 --> 49:09.310] So everyone was supposed to upgrade their relay, so I did that. [49:09.490 --> 49:13.270] And then I was going to a conference, and I had a bunch of BeagleBones plugged in, and I unplugged the wrong one. [49:13.570 --> 49:19.290] So that was the second time that my BeagleBone essentially went, but otherwise it ran for basically nine months without any problem. [49:20.890 --> 49:23.650] You can tune it, right, for lower bandwidth consumption, right? [49:23.750 --> 49:30.470] So Tor, there's this kind of conflict between how much bandwidth you give to Tor, and how, you know, what you can use for a home network. [49:30.610 --> 49:31.910] So you can kind of tweak that bandwidth. [49:32.590 --> 49:33.770] And so this was a graph. [49:33.770 --> 49:40.310] It's not... I had limited the bandwidth on my Tor relay, so it's not... this is not necessarily very fast bandwidth, and I think that's like 400k. [49:41.270 --> 49:42.690] This is after 30 months of running. [49:43.170 --> 49:50.470] But what I think is really a nice kind of like the driving thing is you can make custom hardware for the Tor relay, right? [49:50.690 --> 49:55.470] And so typically, you have a Tor relay, and you don't manipulate it, you have to log in over SSH, right? [49:55.570 --> 50:03.310] So what I did in this one is I was having problems with the bandwidth, and I would keep adjusting the bandwidth rate, right? [50:03.510 --> 50:14.570] And so if you put a rotary potentiometer on the ADC pins of the BeagleBone, you can use the Python stem library, and now I can adjust the bandwidth of my relay with a knob, right? [50:14.870 --> 50:19.590] So... So I think it's kind of a neat way to kind of combine hardware with the server, right? [50:19.650 --> 50:23.050] So I think when people... So I'm interested in kind of keeping going with this project. [50:25.150 --> 50:27.150] I'm you can kind of physically interact with something. [50:27.590 --> 50:32.390] I think that kind of the response to that is a lot more than just running the relay and, oh, it's running on some server somewhere. [50:32.730 --> 50:34.670] And then I added a little front panel interface. [50:34.830 --> 50:40.150] It would tell me that, you know, how much bandwidth it was using relative to my max bandwidth in my home network. [50:40.370 --> 50:42.150] And then, you know, you always have to have a blinking LED. [50:42.750 --> 50:43.690] So I added one of those. [50:46.570 --> 50:52.430] So, you know, what to expect when you're running a Tor relay on a home network with a BeagleBone. [50:53.170 --> 50:55.850] So there's a couple of things that kind of ran in there, right? [50:55.990 --> 50:58.350] So you... There's this balance you kind of have to play, right? [50:58.970 --> 51:02.290] So... So Tor would really like it if you just gave a lot of bandwidth to them. [51:02.650 --> 51:06.410] And... Because then you're participating, you're growing the Tor network, it has a lot of bandwidth. [51:07.030 --> 51:09.470] But the problem is, like, you also want to use your bandwidth, right? [51:09.530 --> 51:11.470] So there's kind of a tweaking that you have to do. [51:11.590 --> 51:14.710] And so that's eventually why I ended up making that knob, so I can kind of adjust things. [51:16.450 --> 51:19.030] So all Tor relays are public IPs. [51:19.390 --> 51:25.690] And what some providers do, I've noticed, is they'll just go grab all the Tor relays and just blacklist them, right? [51:25.810 --> 51:34.770] So typically they're... They'll do this for exits, because exits, when you pop out of the Tor network, if there's abuse in Tor, right, that'll be the ones that'll kind of... They'll come out from an exit. [51:35.910 --> 51:38.250] But... So there was like a period of time where I couldn't get to Hulu. [51:38.470 --> 51:40.590] And Hulu was like, you're running this anonymizer network. [51:40.750 --> 51:41.730] And I responded to them. [51:41.830 --> 51:44.610] And I was like, no, like, okay, I'm running this Tor middle relay. [51:44.610 --> 51:46.190] This is why people should just run Tor. [51:46.350 --> 51:47.030] This is why it's important. [51:47.450 --> 51:48.810] And by the way, I'm in the United States. [51:48.950 --> 51:50.290] And they go, oh, okay, you're in the U.S. [51:50.450 --> 51:51.470] All right, we'll let you have Tor again. [51:51.550 --> 51:52.370] Or we'll let you have Hulu again. [51:52.610 --> 51:56.730] So some other weird ones, like I couldn't get to Navy.mil. [51:57.210 --> 52:00.470] And Tor, you know, was originally funded by the U.S. Navy, so that was kind of ironic. [52:00.730 --> 52:05.010] And then I was looking up PKCS11 standards, and that RSA site was blocked from Tor. [52:05.130 --> 52:08.130] And I was like, you guys are not, you know, I don't know. [52:08.270 --> 52:13.390] So if you do run one at home, you know, you may experience some of this stuff. [52:13.490 --> 52:19.950] If you value kind of helping people access the Internet, you'll have to kind of make a judgment call, you know, whether you want to do that. [52:20.710 --> 52:22.790] The other thing is you have to carefully manage the memory, right? [52:22.930 --> 52:25.630] So the BeagleBone is kind of memory restricted. [52:26.730 --> 52:30.810] And that's where I found, because Tor will open up a lot of connections and won't necessarily use them all at once. [52:31.470 --> 52:35.090] So that's where I think you'll hit the limiting, you know, the limiting component. [52:35.290 --> 52:36.930] I'm trying to run one now, so we'll see. [52:37.670 --> 52:41.290] Also, you're going to want to do some basic hardening, you know, kind of get everything ready. [52:42.990 --> 52:45.710] So, yeah, so I'm writing this book. [52:45.930 --> 52:49.170] So I'm trying to show some other cool things to do with the CryptoCape and the BeagleBone. [52:49.530 --> 52:53.610] So I've got... we talked about Tor in this book here that's come out in September. [52:53.810 --> 52:56.770] I'm showing how to do a Tor bridge with an OBS3 proxy. [52:57.610 --> 53:01.830] You'll see how to do, like, two-factor authentication with a fingerprint sensor, loading that to the CryptoCape. [53:01.990 --> 53:03.870] I use the TPM to wrap GPG keys. [53:04.070 --> 53:10.250] And then the last thing is I run an IRC network and I have Biddleby and CNC and then show how to use all that with OTR. [53:10.710 --> 53:12.010] So that's all running on the BeagleBone. [53:12.430 --> 53:15.290] And lastly, I'm giving a talk. [53:15.430 --> 53:17.210] You'll see me again at DEF CON if you're going to DEF CON. [53:17.470 --> 53:21.270] I'm giving a talk on the NSA Playset with Michael Osmond and some other people. [53:21.610 --> 53:32.370] And if you want a cool project to do with a BeagleBone or CryptoCape, I recommend you go to that talk because I'll be showing how to make a hardware implant that attaches to I2C and then can exfiltrate data out GSM. [53:34.470 --> 53:37.970] And there's resources and I think we have some time for questions. [53:46.650 --> 53:47.210] Thank you. [53:50.360 --> 53:51.100] Okay, yes. [54:08.440 --> 54:13.680] Yeah, so I set the... so the question is how do I control the system reset line for that mega, right? [54:13.780 --> 54:15.100] So I just use the GPIO. [54:16.120 --> 54:20.560] I think I got a resistor in there that's tied to like the high voltage there. [54:20.740 --> 54:24.680] So I can pull up and then I default that GPIO to high, right? [54:24.780 --> 54:34.580] And then so if I want to reset it in software, I just tell, hey, tell the Beagle to pull that GPIO low and that'll short out that line and allow the mega to reset. [54:37.600 --> 54:38.740] Yes, yeah, yes, yes. [54:38.920 --> 54:41.140] And yeah, so I should say it's also using AVRDude. [54:41.200 --> 54:45.300] So AVRDude is the thing pushing just like you would do for the Arduino ID. [54:46.360 --> 54:48.000] That's... yes, yes, yes, yes. [54:49.560 --> 54:50.420] Any other questions? [54:51.300 --> 54:51.740] Yeah. [54:58.650 --> 55:00.510] So the question was about the source of entropy. [55:00.790 --> 55:02.530] So that's a very good question. [55:02.970 --> 55:04.670] The one I don't have the answer to. [55:05.610 --> 55:14.490] So, right, so the hardware manufacturers, even Atmel, who's very good about pushing out a lot of specs, how they do random number generators is very proprietary. [55:15.450 --> 55:17.170] So the answer is I don't know. [55:17.330 --> 55:21.450] I think the speculation is probably like they're using some sort of thermal noise to generate that. [55:22.110 --> 55:24.890] But, you know, unfortunately, they don't really these details. [55:25.310 --> 55:26.890] So, yeah. [55:37.920 --> 55:38.320] Okay. [55:38.320 --> 55:39.940] Yeah, so everything's open-source hardware. [55:40.140 --> 55:41.640] So, oh, yeah. [55:43.300 --> 55:44.100] Oh, yeah. [55:44.260 --> 55:45.720] I mean, I think that's cool. [55:45.880 --> 55:48.420] That's... I made it so people would learn about this and try to integrate it. [55:48.520 --> 55:49.060] So I don't... [55:50.260 --> 55:51.260] I... that's fine. [55:51.520 --> 55:53.740] I don't necessarily... there's nothing against that. [55:53.840 --> 55:56.040] And I think it's cool if people are using more hardware crypto. [55:57.300 --> 55:57.820] I don't know. [55:57.860 --> 55:58.440] Does that answer your question? [55:59.040 --> 55:59.400] Okay. [56:02.000 --> 56:02.360] Yeah. [56:02.660 --> 56:05.040] So I occasionally get a lot of Bitcoin interest, right? [56:05.900 --> 56:16.400] So the problem, it's not really... so the hashing chip on there, like I can't really work with Bitcoin because it adds this other like custom data to that. [56:16.560 --> 56:19.580] And then the other problem is the elliptical curve chip is NIST, right? [56:19.700 --> 56:20.720] So it's not the Bitcoin curve. [56:21.080 --> 56:22.700] So I'd be kind of cool. [56:22.820 --> 56:27.280] I think one of the things I was intending to make like a Bitcoin wallet maybe, but unfortunately, it's not the same. [56:27.440 --> 56:28.560] It's not the right EC curve. [56:30.820 --> 56:31.140] Okay. [56:31.280 --> 56:31.900] So any other questions? [56:32.100 --> 56:32.960] I guess shout them out because I... [56:34.940 --> 56:35.620] Maybe that's it. [56:35.800 --> 56:36.040] Okay. [56:36.180 --> 56:36.960] Any last rounds? [56:37.300 --> 56:37.660] All right. [56:37.780 --> 56:38.940] Thank you very much for coming for the talk.