1 00:00:00,000 --> 00:00:03,400 Hey, good morning, everybody. Who's ready to talk about some FPGAs? 2 00:00:04,220 --> 00:00:06,560 Woo, yeah! Let's get started, by the way. 3 00:00:06,640 --> 00:00:09,440 All right. Hey, I'm John Dunlap. 4 00:00:09,580 --> 00:00:13,700 I work for a company called GDS Security, Gotham Dilger Science. 5 00:00:14,520 --> 00:00:17,400 I do a lot of security research, reverse engineering, 6 00:00:18,200 --> 00:00:22,260 like to collect bad, broken software, hardware, cheap things, 7 00:00:22,520 --> 00:00:27,260 break them, make them release that magical blue smoke. 8 00:00:27,260 --> 00:00:30,400 And I'm here to talk to you guys about FPGAs, 9 00:00:30,980 --> 00:00:33,720 more on the level of most people in the consumer sphere 10 00:00:33,720 --> 00:00:37,940 haven't really encountered FPGAs, but it's happening more and more. 11 00:00:38,640 --> 00:00:45,240 If you're really deeply ingrained in maybe military or highly secretive technologies, 12 00:00:45,620 --> 00:00:47,080 you might be more familiar with them, 13 00:00:47,160 --> 00:00:51,400 but FPGAs are kind of creeping more into the consumer space bit by bit. 14 00:00:51,520 --> 00:00:53,760 And if you're, say, an embedded pen tester, 15 00:00:53,840 --> 00:00:57,100 you might not know what kind of bad things to look for in FPGA design, 16 00:00:57,980 --> 00:01:01,460 what kind of things to look for when you're buying and picking FPGAs, 17 00:01:01,580 --> 00:01:03,500 what kind of security protections are in them, 18 00:01:03,560 --> 00:01:05,860 what kind of anti-tamper protections are in them, 19 00:01:05,920 --> 00:01:07,900 and just what the heck is an FPGA. 20 00:01:10,420 --> 00:01:13,460 Keep in mind that probably every slide in this talk 21 00:01:13,460 --> 00:01:15,800 could take up its own 90-minute talk. 22 00:01:16,220 --> 00:01:20,020 So keep that in mind if I move a little fast, 23 00:01:20,140 --> 00:01:23,520 and if you're an FPGA sort of subject matter expert, 24 00:01:23,560 --> 00:01:26,000 and you're like, hey, there's some complexity got missed there, 25 00:01:26,100 --> 00:01:27,020 that's why. 26 00:01:27,020 --> 00:01:27,800 We've got to move fast. 27 00:01:29,160 --> 00:01:32,840 So yeah, this is for people who are a little new to FPGAs. 28 00:01:33,480 --> 00:01:35,100 So what are FPGAs? 29 00:01:35,520 --> 00:01:37,700 They are field programmable, 30 00:01:38,400 --> 00:01:43,340 as in you can reprogram basically the hardware itself, 31 00:01:43,480 --> 00:01:46,740 make your own CPU or state machine or whatever, 32 00:01:47,440 --> 00:01:51,340 and gate array as in a rate of gates, but not really. 33 00:01:51,760 --> 00:01:56,280 In most cases, what we're talking about is a set of lookup tables 34 00:01:56,280 --> 00:01:56,840 that are... 35 00:01:58,820 --> 00:02:02,740 So you have something like SRAM or a flash memory 36 00:02:02,740 --> 00:02:05,920 that holds the bit stream for a bunch of lookup tables, 37 00:02:06,080 --> 00:02:08,520 and these approximate the behavior of gates. 38 00:02:08,840 --> 00:02:13,360 So if you imagine you have like a finite set of inputs... 39 00:02:13,360 --> 00:02:15,560 Oops, I'm getting feedback here a little bit. 40 00:02:15,780 --> 00:02:15,940 Yep. 41 00:02:16,040 --> 00:02:19,080 You have a finite set of inputs and outputs for the gate design, 42 00:02:19,340 --> 00:02:21,580 and this can approximate hardware, basically. 43 00:02:25,780 --> 00:02:27,000 There are lots of... 44 00:02:27,000 --> 00:02:28,920 Hybrid variations on this. 45 00:02:29,140 --> 00:02:32,220 So you can get FPGAs in a bunch of different flavors, 46 00:02:32,500 --> 00:02:34,120 and that's relevant to this discussion 47 00:02:34,120 --> 00:02:35,300 because they behave differently 48 00:02:35,300 --> 00:02:36,720 and have different security ramifications. 49 00:02:37,800 --> 00:02:40,560 And unfortunately, I don't want to make the talk seem like 50 00:02:40,560 --> 00:02:43,420 I'm ever advocating for a particular brand 51 00:02:43,420 --> 00:02:45,860 or that I'm talking about like what to buy too much, 52 00:02:45,980 --> 00:02:51,160 but what security you get often depends on what you buy, 53 00:02:51,360 --> 00:02:55,000 how much you pay, what kind of advice you're asking for. 54 00:02:56,120 --> 00:02:56,900 There's different... 55 00:02:56,900 --> 00:02:57,880 There's different power consumption levels, 56 00:02:58,080 --> 00:03:00,200 different sizes, different storage methods, 57 00:03:02,100 --> 00:03:05,460 and even CPLD hybrids with FPGAs. 58 00:03:07,820 --> 00:03:11,040 You got SRAM, anti-fuse, PROM, EPROM, flash. 59 00:03:11,460 --> 00:03:14,960 And I think for most of you, you know what SRAM would be. 60 00:03:15,900 --> 00:03:17,520 You would know what an EPROM is 61 00:03:17,520 --> 00:03:18,980 if you're familiar with embedded devices. 62 00:03:20,020 --> 00:03:22,280 Flash is probably familiar to all of you. 63 00:03:22,380 --> 00:03:24,200 You might not have run into anti-fuse. 64 00:03:24,560 --> 00:03:26,880 And anti-fuse is one of the first... 65 00:03:26,880 --> 00:03:27,800 One of the first topics you might come into 66 00:03:27,800 --> 00:03:30,080 when you're looking at tamper-proofing an FPGA. 67 00:03:30,700 --> 00:03:36,100 We'll talk a little bit later about how one of the main threat models for FPGAs 68 00:03:36,100 --> 00:03:38,560 is making sure people don't dump the design off the FPGA. 69 00:03:38,760 --> 00:03:42,740 So if the FPGA has this design in some kind of storage like SRAM or flash, 70 00:03:43,060 --> 00:03:45,820 it's possible for people to take your entire hardware design 71 00:03:45,820 --> 00:03:48,520 and pull it off and flash it onto another FPGA, 72 00:03:48,620 --> 00:03:49,180 use it for themselves. 73 00:03:49,420 --> 00:03:50,200 That's something you don't want. 74 00:03:50,780 --> 00:03:56,280 Anti-fuse FPGA, they basically use fuses that are broken 75 00:03:56,280 --> 00:03:56,860 to make sure that the FPGA is working. 76 00:03:56,880 --> 00:04:00,680 To encode the design, which in most cases means that 77 00:04:00,680 --> 00:04:02,900 there's absolutely no way to just pull it off, 78 00:04:03,480 --> 00:04:06,300 short of looking at it with like a scanning electron microscope. 79 00:04:08,420 --> 00:04:13,280 Even though some anti-fuse FPGAs actually do have a read-back function 80 00:04:13,280 --> 00:04:17,520 that reads back the design, which is funny. 81 00:04:17,660 --> 00:04:19,140 Like, they naturally wouldn't have it. 82 00:04:19,180 --> 00:04:20,940 People went out of their way to implement it, 83 00:04:21,040 --> 00:04:22,220 which is kind of goofy. 84 00:04:23,420 --> 00:04:25,680 If you're wondering what FPGAs are used for, 85 00:04:25,760 --> 00:04:26,620 like practically everything, 86 00:04:26,880 --> 00:04:29,340 you see them a lot in the self-driving cars, 87 00:04:30,100 --> 00:04:33,660 military technology, routers, big use, 88 00:04:34,320 --> 00:04:38,640 especially implementing stuff like tertiary logic servers now. 89 00:04:38,860 --> 00:04:45,040 Intel has a whole sort of product line of servers coming out with FPGAs. 90 00:04:45,140 --> 00:04:46,040 If you guys aren't familiar, 91 00:04:46,420 --> 00:04:49,780 Altera, one of the bigger FPGA vendors, just got bought by Intel. 92 00:04:50,020 --> 00:04:52,680 So what you used to see is Altera is Intel now, 93 00:04:52,780 --> 00:04:54,420 and it's mostly for that server integration. 94 00:04:56,100 --> 00:04:58,320 Of course, the crypto mining people love them. 95 00:04:59,980 --> 00:05:01,360 In case you didn't know, 96 00:05:01,940 --> 00:05:06,140 the big value add for an FPGA is you can basically make your own ASIC, right? 97 00:05:06,240 --> 00:05:08,140 If you want to implement crypto in hardware 98 00:05:08,140 --> 00:05:10,380 and have it be more performant than software crypto, 99 00:05:10,540 --> 00:05:11,720 you can do that with an FPGA, 100 00:05:11,880 --> 00:05:14,760 or anything really that is more performant in hardware than software. 101 00:05:15,340 --> 00:05:16,140 That's possible. 102 00:05:17,120 --> 00:05:19,400 So what kind of threats are we going to look for in FPGAs? 103 00:05:20,500 --> 00:05:22,260 Attacks against the hardware itself, 104 00:05:22,660 --> 00:05:24,160 attacks against the HDL implementation, 105 00:05:25,800 --> 00:05:28,000 sort of environmental problems, 106 00:05:28,660 --> 00:05:30,680 and attacks against the synthesis pipeline. 107 00:05:30,940 --> 00:05:32,800 We'll talk about that in just a second. 108 00:05:34,640 --> 00:05:38,280 And something to keep in mind when we're talking about FPGA threats, 109 00:05:38,600 --> 00:05:39,660 FPGA problems, 110 00:05:39,840 --> 00:05:43,200 is that we're working at this kind of intermediate level 111 00:05:43,200 --> 00:05:45,120 where we are actually talking about logic, 112 00:05:45,760 --> 00:05:47,540 but it's in the context of hardware. 113 00:05:47,960 --> 00:05:53,280 And that middle level isn't a very easy attack 114 00:05:53,280 --> 00:05:54,340 if you're not a human being, 115 00:05:54,420 --> 00:05:56,320 thinking about the HDL implementation. 116 00:05:56,900 --> 00:05:57,840 You'll see that in a sec. 117 00:05:58,700 --> 00:06:00,060 So what is HDL? 118 00:06:00,800 --> 00:06:02,740 It's hardware definition language. 119 00:06:02,960 --> 00:06:05,100 We're talking about stuff like Verilog, VHDL, 120 00:06:05,740 --> 00:06:08,740 and sort of a way to program up hardware. 121 00:06:09,100 --> 00:06:12,200 So we can take stuff like wires, buses, clocks, 122 00:06:12,440 --> 00:06:13,780 and define them dynamically. 123 00:06:14,340 --> 00:06:17,620 Here's an example of part of the Verilog CPU. 124 00:06:18,080 --> 00:06:20,080 This is actually an ALU, 125 00:06:20,660 --> 00:06:22,180 arithmetic logic unit here. 126 00:06:22,500 --> 00:06:23,580 And you can see, 127 00:06:24,940 --> 00:06:30,080 you have all the adding, XOR, what not defined by the software, 128 00:06:30,280 --> 00:06:31,540 but it gets put out into hardware. 129 00:06:31,680 --> 00:06:35,460 It gets put into actual gates and registers and what not. 130 00:06:37,460 --> 00:06:39,060 It's a different way of thinking about things. 131 00:06:39,920 --> 00:06:42,160 One thing I always thought was cool about HDL 132 00:06:42,160 --> 00:06:46,640 is that you can do things like actually reason about literal clock cycles. 133 00:06:46,740 --> 00:06:50,360 So you can say every rising edge, we do this. 134 00:06:50,380 --> 00:06:52,120 Or every two rising edges, we do this. 135 00:06:52,160 --> 00:06:53,200 Which is pretty freaking cool. 136 00:06:53,320 --> 00:06:53,560 And then you can do things like actually reason 137 00:06:53,580 --> 00:06:57,600 but it also sort of inserts a whole set of problems of like when do we do that, 138 00:06:57,640 --> 00:06:58,440 when do we not do that? 139 00:06:58,640 --> 00:07:01,900 Are we keeping our timing copacetic? 140 00:07:03,100 --> 00:07:04,540 If you're not familiar with synthesis, 141 00:07:05,620 --> 00:07:07,000 it's basically the 142 00:07:07,800 --> 00:07:09,560 compilation, if you want to think about it, 143 00:07:09,580 --> 00:07:11,200 where we take our HDL design and turn it 144 00:07:11,200 --> 00:07:13,280 into something we can throw 145 00:07:13,280 --> 00:07:14,740 onto the FPGA itself. 146 00:07:18,200 --> 00:07:18,600 Our... 147 00:07:18,600 --> 00:07:19,040 Uh... 148 00:07:22,220 --> 00:07:23,600 Here are the basic steps of it. 149 00:07:23,700 --> 00:07:24,960 I'm not going to go too deep into it. 150 00:07:24,980 --> 00:07:27,640 I could talk about synthesis for like a whole one hour talk. 151 00:07:28,840 --> 00:07:30,120 But we have like a register, 152 00:07:30,440 --> 00:07:32,580 transfer level, some optimizations, 153 00:07:32,640 --> 00:07:34,380 and then mapping onto the actual chip 154 00:07:34,380 --> 00:07:35,320 that we're going to use. 155 00:07:35,620 --> 00:07:38,260 And a couple steps that mean that we're going to 156 00:07:39,720 --> 00:07:40,500 plan out 157 00:07:40,500 --> 00:07:42,600 where on the die stuff is going to go. 158 00:07:42,680 --> 00:07:43,880 And that has security ramifications. 159 00:07:44,060 --> 00:07:45,940 Where we put our crypto logic 160 00:07:46,520 --> 00:07:48,040 on the chip relative to other stuff 161 00:07:48,600 --> 00:07:50,380 that might affect the viability of things like 162 00:07:50,380 --> 00:07:51,800 differential power analysis attacks. 163 00:07:52,200 --> 00:07:53,620 And that is one liberating 164 00:07:53,620 --> 00:07:56,080 dangerous thing about FPGA design 165 00:07:56,080 --> 00:07:56,920 is that we can say 166 00:07:57,980 --> 00:07:59,740 spread storage across the chip 167 00:07:59,740 --> 00:08:00,680 and make it hard to read. 168 00:08:00,880 --> 00:08:03,060 Or we could spread ram across the chip, 169 00:08:03,220 --> 00:08:05,480 spread crypto stuff in different places. 170 00:08:06,580 --> 00:08:07,780 But if you don't do that 171 00:08:07,780 --> 00:08:09,740 or just let the chip planner do it for you 172 00:08:09,740 --> 00:08:11,540 that might cause some issues. 173 00:08:12,220 --> 00:08:13,740 And the final step here 174 00:08:13,740 --> 00:08:14,680 we're going to talk a little bit more 175 00:08:14,680 --> 00:08:16,220 is bit stream generation. 176 00:08:18,600 --> 00:08:19,060 So we're going to talk about the final 177 00:08:20,540 --> 00:08:21,860 you know, you think of firmware, 178 00:08:21,980 --> 00:08:24,520 the image of the stuff that gets put into the FPGA 179 00:08:24,520 --> 00:08:25,360 that's our bit stream. 180 00:08:25,620 --> 00:08:27,160 And so if you want to start talking about 181 00:08:27,160 --> 00:08:28,520 reverse engineering FPGAs 182 00:08:28,520 --> 00:08:29,640 you want to start talking about 183 00:08:30,460 --> 00:08:31,900 bit stream reverse engineering. 184 00:08:33,280 --> 00:08:34,280 But before we get there 185 00:08:36,860 --> 00:08:38,620 it's important that this synthesis pipeline 186 00:08:38,620 --> 00:08:39,280 be secured 187 00:08:39,280 --> 00:08:41,280 and there's a lot of thought going into 188 00:08:41,280 --> 00:08:44,120 how you can make sure that all this stuff 189 00:08:44,120 --> 00:08:45,720 happens without an insider threat 190 00:08:45,720 --> 00:08:46,580 between each step. 191 00:08:50,380 --> 00:08:51,020 Let's see. 192 00:08:51,180 --> 00:08:52,480 Another topic that will come up 193 00:08:52,480 --> 00:08:54,560 when you start reading about FPGA security 194 00:08:54,560 --> 00:08:56,600 is physically unclonable functions. 195 00:08:57,480 --> 00:08:59,360 Which is an interesting crypto idea 196 00:08:59,360 --> 00:09:00,440 if you haven't run into it. 197 00:09:00,560 --> 00:09:02,100 It's basically the idea is that 198 00:09:02,100 --> 00:09:04,020 we're going to get 199 00:09:04,500 --> 00:09:05,400 maybe our crypto keys 200 00:09:05,400 --> 00:09:07,680 or some kind of authentication logic 201 00:09:07,680 --> 00:09:09,700 based off of factors specific 202 00:09:09,700 --> 00:09:11,580 to this exact bit of silicon. 203 00:09:12,220 --> 00:09:13,740 So things will be different 204 00:09:13,740 --> 00:09:15,000 on each version of the device. 205 00:09:16,520 --> 00:09:17,040 So 206 00:09:19,140 --> 00:09:20,340 we might do that by 207 00:09:20,340 --> 00:09:21,500 measuring propagation delays 208 00:09:22,020 --> 00:09:24,400 we might do that by measuring voltages 209 00:09:24,400 --> 00:09:25,340 capacitance 210 00:09:27,180 --> 00:09:28,140 parity noise 211 00:09:31,080 --> 00:09:32,700 There are attacks against these 212 00:09:32,700 --> 00:09:34,440 but basic idea is that 213 00:09:35,100 --> 00:09:36,220 this stuff will vary 214 00:09:36,220 --> 00:09:37,420 chip to chip 215 00:09:37,420 --> 00:09:39,500 and we could do something like derive a crypto key 216 00:09:39,500 --> 00:09:40,480 based on these differences. 217 00:09:41,260 --> 00:09:43,020 One of the advantages being that we don't have to 218 00:09:43,020 --> 00:09:44,580 put it on the device somehow. 219 00:09:45,660 --> 00:09:47,600 There are machine learning attacks against these. 220 00:09:48,600 --> 00:09:49,440 And there's also 221 00:09:52,440 --> 00:09:53,080 bypasses against 222 00:09:53,080 --> 00:09:54,260 those machine learning attacks. 223 00:09:57,140 --> 00:09:58,400 So how do we prevent 224 00:09:58,400 --> 00:10:00,080 people from disclosing our IP 225 00:10:00,080 --> 00:10:01,920 from the FPGA chip? 226 00:10:03,060 --> 00:10:03,880 One of the 227 00:10:04,560 --> 00:10:05,720 problems as I said before 228 00:10:05,720 --> 00:10:07,200 is that when we use FPGAs 229 00:10:07,200 --> 00:10:08,860 we kind of have to keep our IP in a format 230 00:10:08,860 --> 00:10:11,180 that's usable on the device. 231 00:10:11,420 --> 00:10:13,040 Be it SRAM or flash or whatever. 232 00:10:14,260 --> 00:10:15,660 So how do we protect it? 233 00:10:16,160 --> 00:10:17,720 How do we get it off the chip? 234 00:10:18,600 --> 00:10:20,560 We might look to grab 235 00:10:20,560 --> 00:10:22,400 it during configuration 236 00:10:22,400 --> 00:10:23,000 of the device. 237 00:10:23,240 --> 00:10:25,760 When the device is being flashed 238 00:10:25,760 --> 00:10:27,080 as it were. 239 00:10:28,460 --> 00:10:30,560 A lot of FPGA devices are set up 240 00:10:30,560 --> 00:10:31,300 in such a way that 241 00:10:32,800 --> 00:10:33,840 the IP 242 00:10:33,840 --> 00:10:36,100 is transferred from storage at boot time. 243 00:10:36,320 --> 00:10:38,420 Every time the FPGA is booted up 244 00:10:38,420 --> 00:10:39,960 it gets transferred across 245 00:10:39,960 --> 00:10:41,940 and we might try to attack that if it's possible. 246 00:10:42,360 --> 00:10:44,440 Or we might try to rip it directly 247 00:10:44,440 --> 00:10:45,940 off the storage medium itself. 248 00:10:46,420 --> 00:10:46,940 Um 249 00:10:48,900 --> 00:10:50,920 So a lot of people call this 250 00:10:51,340 --> 00:10:52,100 class of attacks 251 00:10:52,100 --> 00:10:52,860 bitstream cloning. 252 00:10:54,800 --> 00:10:56,220 The most easy thing to do 253 00:10:56,220 --> 00:10:57,180 for an attacker 254 00:10:57,180 --> 00:10:58,600 or the most script kiddy thing 255 00:10:58,600 --> 00:11:00,940 is to abuse readback functionality FPGA. 256 00:11:01,460 --> 00:11:03,140 And a lot of times if it's not like 257 00:11:03,140 --> 00:11:04,440 a highly secured FPGA 258 00:11:04,440 --> 00:11:05,900 this might just be wide open 259 00:11:05,900 --> 00:11:07,340 and you might be able to connect it to 260 00:11:07,340 --> 00:11:10,120 Cordis Prime or whatever IDE you're using 261 00:11:10,120 --> 00:11:11,800 to build your FPGA software and say 262 00:11:11,800 --> 00:11:13,220 read me back the bitstream 263 00:11:13,220 --> 00:11:15,560 and it'll do it for you without any kind of authentication. 264 00:11:18,600 --> 00:11:19,120 laden device. 265 00:11:20,960 --> 00:11:23,060 Usually there's a bit you can set to prevent that 266 00:11:23,060 --> 00:11:24,760 but on some of the lower security devices 267 00:11:24,760 --> 00:11:25,660 that's not a thing. 268 00:11:26,040 --> 00:11:27,980 And obviously people are going to tamper that. 269 00:11:29,700 --> 00:11:31,620 The next level would be trying to middle 270 00:11:31,620 --> 00:11:33,000 the bitstream somehow, right? 271 00:11:33,340 --> 00:11:35,240 But encrypted bitstreams are a thing. 272 00:11:36,300 --> 00:11:37,880 And the other thing to watch out for 273 00:11:37,880 --> 00:11:39,380 is like sort of integrated devices. 274 00:11:39,460 --> 00:11:41,580 One way that hardware designers 275 00:11:41,580 --> 00:11:43,620 try to prevent bitstream cloning attacks 276 00:11:43,620 --> 00:11:46,140 is to put the storage 277 00:11:46,140 --> 00:11:47,640 and the logic 278 00:11:47,640 --> 00:11:48,600 on the same die 279 00:11:48,600 --> 00:11:50,660 so you have to decap the chip 280 00:11:50,660 --> 00:11:53,360 and do something much harder 281 00:11:54,200 --> 00:11:56,060 physically in terms of reverse engineering 282 00:11:56,060 --> 00:11:57,100 to get the bitstream. 283 00:11:58,900 --> 00:12:00,280 This is from 284 00:12:00,280 --> 00:12:01,680 I think it's from Altera 285 00:12:01,680 --> 00:12:03,560 the like instructions 286 00:12:04,140 --> 00:12:05,560 for performing a readback 287 00:12:05,560 --> 00:12:06,340 on one of their chips. 288 00:12:07,740 --> 00:12:09,000 So on some of the 289 00:12:09,000 --> 00:12:10,680 oh no that's Xilinx. 290 00:12:11,820 --> 00:12:13,540 So it's super easy 291 00:12:13,540 --> 00:12:14,320 if it's not disabled. 292 00:12:16,140 --> 00:12:17,200 There are ways to activate the readback 293 00:12:17,200 --> 00:12:18,920 by tampering the chip itself. 294 00:12:19,940 --> 00:12:21,160 But once you have the bitstream 295 00:12:21,160 --> 00:12:22,780 that's not all roses 296 00:12:22,780 --> 00:12:26,100 you might have to reverse engineer the bitstream 297 00:12:26,100 --> 00:12:27,800 and this is a big problem 298 00:12:27,800 --> 00:12:29,220 because every single chip 299 00:12:29,220 --> 00:12:30,600 and every single manufacturer 300 00:12:30,600 --> 00:12:32,040 has their own bitstream format 301 00:12:32,040 --> 00:12:33,260 that is not documented 302 00:12:33,260 --> 00:12:34,120 that is proprietary 303 00:12:34,120 --> 00:12:35,920 and there's whole groups of people 304 00:12:35,920 --> 00:12:38,680 who like specialize in trying to reverse engineer 305 00:12:38,680 --> 00:12:39,660 these bitstream formats. 306 00:12:39,860 --> 00:12:42,300 It's not easy. We're talking about like a month of reverse engineering. 307 00:12:46,140 --> 00:12:46,460 It's kind of obscurity 308 00:12:46,460 --> 00:12:48,320 but it tends to work kind of okay. 309 00:12:50,080 --> 00:12:51,460 Another thing people try to do 310 00:12:51,460 --> 00:12:52,680 is bitstream encryption 311 00:12:54,060 --> 00:12:55,620 but then you have to deal with 312 00:12:55,620 --> 00:12:57,220 how do you get the keys onto the device 313 00:12:57,220 --> 00:12:58,000 and the pain of that 314 00:12:59,420 --> 00:13:01,420 and protecting the device from differential 315 00:13:02,560 --> 00:13:03,340 cryptanalysis attacks 316 00:13:04,280 --> 00:13:04,760 and 317 00:13:05,760 --> 00:13:06,860 bad crypto too. 318 00:13:07,100 --> 00:13:09,000 There have been many cases of FPGAs 319 00:13:09,000 --> 00:13:11,520 that inherently use AES CBC mode 320 00:13:11,920 --> 00:13:12,820 which if you're not familiar 321 00:13:12,820 --> 00:13:14,740 has a block swapping type attack 322 00:13:16,140 --> 00:13:17,780 that you can use to decrypt information 323 00:13:18,340 --> 00:13:18,820 selectively. 324 00:13:19,280 --> 00:13:21,940 It's definitely not a perfect way to encrypt things 325 00:13:23,740 --> 00:13:25,120 and like I said before 326 00:13:25,120 --> 00:13:25,840 you have to worry about 327 00:13:25,840 --> 00:13:27,300 how to get the key onto the device 328 00:13:29,560 --> 00:13:30,520 most FPGA 329 00:13:30,520 --> 00:13:32,080 sort of working environments 330 00:13:32,080 --> 00:13:34,340 have something to help you with this 331 00:13:34,340 --> 00:13:35,560 but it can be kind of a 332 00:13:36,140 --> 00:13:37,980 pain manufacturing process wise 333 00:13:37,980 --> 00:13:40,440 of finding a way to flash the keys on 334 00:13:40,440 --> 00:13:41,960 and keep everything copacetic 335 00:13:43,080 --> 00:13:44,040 for instance 336 00:13:44,040 --> 00:13:45,880 keys usually put on their VGA tag 337 00:13:46,140 --> 00:13:47,380 if you leave the J tag activated 338 00:13:47,380 --> 00:13:48,840 that could cause its own set of problems 339 00:13:50,160 --> 00:13:51,780 another thing people try to do 340 00:13:51,780 --> 00:13:53,020 security wise with FPGAs 341 00:13:53,020 --> 00:13:55,120 is implement true random numbers 342 00:13:57,460 --> 00:13:59,180 you might get these from 343 00:14:00,140 --> 00:14:01,120 propagation delays 344 00:14:01,120 --> 00:14:02,100 oscillator jitter 345 00:14:02,100 --> 00:14:03,300 oscillator frequency 346 00:14:03,300 --> 00:14:04,480 phase locked loops 347 00:14:05,260 --> 00:14:07,080 or a dedicated hardware peripheral 348 00:14:07,080 --> 00:14:07,820 that does this 349 00:14:07,820 --> 00:14:09,560 big thing at FPGAs 350 00:14:09,560 --> 00:14:10,420 is sort of 351 00:14:12,080 --> 00:14:14,620 one of the higher end things you pay for 352 00:14:17,280 --> 00:14:19,640 you might get a special 353 00:14:21,500 --> 00:14:22,540 DAC based 354 00:14:22,540 --> 00:14:23,840 multiplication unit 355 00:14:23,840 --> 00:14:24,280 for instance 356 00:14:24,280 --> 00:14:25,780 something you would pay extra for 357 00:14:25,780 --> 00:14:27,200 so you can get things like that for crypto 358 00:14:28,960 --> 00:14:30,000 also metastability 359 00:14:30,000 --> 00:14:31,380 which if you're not familiar 360 00:14:31,380 --> 00:14:33,380 is like if you have a one 361 00:14:33,380 --> 00:14:34,360 and a zero 362 00:14:34,360 --> 00:14:35,860 and a threshold for that 363 00:14:35,860 --> 00:14:37,200 metastability is when we have values 364 00:14:37,200 --> 00:14:39,040 that live in that middle area 365 00:14:39,040 --> 00:14:42,760 which in terms of a viable FPGA design 366 00:14:42,760 --> 00:14:43,840 is considered to be unacceptable 367 00:14:46,240 --> 00:14:47,520 because you have this 368 00:14:48,440 --> 00:14:49,960 we're not sure if it will evaluate 369 00:14:49,960 --> 00:14:50,680 to one or zero 370 00:14:50,680 --> 00:14:52,940 it's basically truly random 371 00:14:54,180 --> 00:14:54,780 so 372 00:14:54,780 --> 00:14:58,120 if we're trying to get all this bitstream off the FPGA 373 00:14:58,120 --> 00:14:59,560 we're going to run into problems with 374 00:14:59,560 --> 00:15:01,120 anti-tamper devices pretty quickly 375 00:15:02,240 --> 00:15:03,500 stuff like fuses 376 00:15:03,500 --> 00:15:04,500 anti-tamper fuses 377 00:15:04,500 --> 00:15:06,100 tamper resistant flash memory cells 378 00:15:07,680 --> 00:15:09,740 and logic placement designs 379 00:15:09,740 --> 00:15:11,780 are meant to frustrate the reverse engineer 380 00:15:13,060 --> 00:15:13,660 so 381 00:15:14,580 --> 00:15:15,920 here's a microsemismart 382 00:15:16,140 --> 00:15:16,900 fusion device 383 00:15:16,900 --> 00:15:18,580 and this is one where we have 384 00:15:18,580 --> 00:15:20,040 an integrated design 385 00:15:20,040 --> 00:15:21,980 where it would be very hard to middle the storage 386 00:15:24,240 --> 00:15:25,900 and here's going over some of 387 00:15:26,880 --> 00:15:27,600 microsemismart protections 388 00:15:27,600 --> 00:15:28,440 that they have on here 389 00:15:28,440 --> 00:15:30,020 I thought it would be good to talk about 390 00:15:30,020 --> 00:15:31,700 anti-tamper and show some of the 391 00:15:33,300 --> 00:15:34,360 data sheets because 392 00:15:34,820 --> 00:15:37,280 it gives you an idea of how common it is on FPGAs 393 00:15:37,280 --> 00:15:38,880 it's actually kind of a very responsible 394 00:15:38,880 --> 00:15:39,920 thing of the industry 395 00:15:39,920 --> 00:15:42,000 probably has something to do with the fact that FPGAs 396 00:15:42,000 --> 00:15:43,160 are widely used by the military 397 00:15:46,140 --> 00:15:47,740 multiple fuses actually have an array fuse 398 00:15:47,740 --> 00:15:49,960 a security fuse, a program fuse and a probe fuse 399 00:15:49,960 --> 00:15:51,740 all meant to break the device if it finds 400 00:15:51,740 --> 00:15:53,800 that reverse engineers have been mucking about 401 00:15:53,800 --> 00:15:56,380 and if you're going to try and pull that design off the FPGA 402 00:15:56,380 --> 00:15:57,800 you have to deal with 403 00:15:57,800 --> 00:15:58,840 all of that 404 00:16:00,560 --> 00:16:02,280 they actually have similar things 405 00:16:02,280 --> 00:16:03,120 for their flash memory 406 00:16:03,120 --> 00:16:05,260 so if you're trying to pull stuff directly off the flash 407 00:16:05,260 --> 00:16:06,740 you'll have to deal with that as well 408 00:16:08,420 --> 00:16:09,840 I like this page though 409 00:16:09,840 --> 00:16:10,960 are the keys secure 410 00:16:10,960 --> 00:16:14,100 I just put that up because I found it to be funny in their data sheet 411 00:16:14,580 --> 00:16:15,620 are the keys secure? 412 00:16:16,180 --> 00:16:16,540 yes 413 00:16:18,000 --> 00:16:19,020 ZynLynx is kind of the 414 00:16:19,920 --> 00:16:22,080 kings of this, they have this huge scary list 415 00:16:22,080 --> 00:16:24,240 of hardening features you can get in your FPGA 416 00:16:24,240 --> 00:16:25,440 thing to keep in mind is 417 00:16:25,440 --> 00:16:27,480 all these features aren't on all FPGAs 418 00:16:27,480 --> 00:16:29,820 and if you're trying to make a consumer device with an FPGA 419 00:16:29,820 --> 00:16:31,060 and you want to protect your bitstream 420 00:16:31,060 --> 00:16:33,480 then you might want to read your data sheet 421 00:16:33,480 --> 00:16:35,120 and see what exactly is there 422 00:16:35,900 --> 00:16:37,080 they have stuff like 423 00:16:38,840 --> 00:16:39,920 logic you can put on there 424 00:16:39,920 --> 00:16:42,260 that will disable the device if it feels like the JTAG 425 00:16:42,260 --> 00:16:43,040 is being tampered 426 00:16:43,040 --> 00:16:45,660 so you put your JTAGulator on there and try to brute force it 427 00:16:46,140 --> 00:16:46,760 on your device 428 00:16:47,460 --> 00:16:49,740 it's a good thing to know before going in with these things 429 00:16:53,860 --> 00:16:54,820 anti-readback 430 00:16:56,240 --> 00:16:57,840 we'll talk about ICAP in a second 431 00:16:57,840 --> 00:16:59,000 thing to keep in mind is 432 00:17:00,160 --> 00:17:00,980 while these 433 00:17:01,900 --> 00:17:03,320 features are really common 434 00:17:03,320 --> 00:17:05,500 as you go into the cheaper 435 00:17:05,500 --> 00:17:06,920 more consumer oriented devices 436 00:17:06,920 --> 00:17:08,700 especially the older models of devices 437 00:17:09,860 --> 00:17:10,920 they sort of disappear 438 00:17:10,920 --> 00:17:13,120 it's like a recent improvement in some ways 439 00:17:13,120 --> 00:17:14,840 especially for the cheaper devices 440 00:17:16,140 --> 00:17:18,300 at home in my personal collection of FPGAs 441 00:17:18,300 --> 00:17:19,180 I have a 442 00:17:20,420 --> 00:17:22,220 Cyclone 2 device that I bought off eBay 443 00:17:22,220 --> 00:17:24,340 and a Cyclone 3 device 444 00:17:24,340 --> 00:17:25,160 that I bought off eBay 445 00:17:25,160 --> 00:17:27,440 Cyclone 2 has none of these features 446 00:17:27,440 --> 00:17:28,860 Cyclone 3 has about half of them 447 00:17:28,860 --> 00:17:30,860 so read your data sheets 448 00:17:32,060 --> 00:17:34,060 another thing to watch out for is 449 00:17:35,080 --> 00:17:36,620 disabling and protection of the ICAP 450 00:17:36,620 --> 00:17:38,100 is the internal configuration port 451 00:17:38,100 --> 00:17:39,820 so a cool thing about FPGAs 452 00:17:40,480 --> 00:17:41,720 in case of possibility 453 00:17:41,720 --> 00:17:43,420 they can configure themselves 454 00:17:43,980 --> 00:17:45,900 so you can have a self reconfiguring design 455 00:17:46,140 --> 00:17:47,460 that changes itself and mutates 456 00:17:48,480 --> 00:17:49,780 there's been various schemes 457 00:17:49,780 --> 00:17:51,620 for making a highly secure design 458 00:17:51,940 --> 00:17:53,920 based on a self mutating FPGA 459 00:17:53,920 --> 00:17:56,140 where the locations of things 460 00:17:56,140 --> 00:17:58,220 swapped around, the timing delays of things 461 00:17:58,220 --> 00:17:58,940 swapped around 462 00:17:59,700 --> 00:18:01,320 but then you have to worry about 463 00:18:01,320 --> 00:18:03,960 is there a way that an attacker can hijack my ICAP 464 00:18:03,960 --> 00:18:05,440 I think 465 00:18:06,140 --> 00:18:07,920 listing here there's some ICAP protections 466 00:18:07,920 --> 00:18:10,060 in the anti-tamper list as well 467 00:18:11,500 --> 00:18:12,520 here's another threat 468 00:18:12,520 --> 00:18:15,360 damaging systems connected to the FPGA 469 00:18:15,360 --> 00:18:16,120 there's been some research 470 00:18:16,140 --> 00:18:16,920 into this as well 471 00:18:16,920 --> 00:18:20,040 so say that your FPGA is secure from 472 00:18:20,040 --> 00:18:20,620 midstream attacks 473 00:18:20,620 --> 00:18:23,680 what if the attacker just wants to misuse the logic 474 00:18:23,680 --> 00:18:25,740 on your FPGA to destroy things 475 00:18:25,740 --> 00:18:28,180 so it's not uncommon for FPGAs 476 00:18:28,180 --> 00:18:29,160 to be connected to 477 00:18:29,160 --> 00:18:31,860 be the glue logic for various 478 00:18:31,860 --> 00:18:32,680 high power systems 479 00:18:34,140 --> 00:18:34,660 and 480 00:18:35,760 --> 00:18:37,260 people have come up with attacks 481 00:18:38,240 --> 00:18:40,500 where you cause it to overvoltage 482 00:18:40,500 --> 00:18:41,380 or something like that 483 00:18:42,060 --> 00:18:44,140 cause a small fire 484 00:18:44,140 --> 00:18:45,620 melting things, whatever 485 00:18:47,040 --> 00:18:47,600 so 486 00:18:48,080 --> 00:18:49,900 this particular paper 487 00:18:49,900 --> 00:18:51,520 they call it the FPGA virus 488 00:18:52,000 --> 00:18:53,440 which I think is kind of funny 489 00:18:54,340 --> 00:18:55,880 they propose an attack 490 00:18:55,880 --> 00:18:57,180 they call melt 491 00:18:58,720 --> 00:18:59,840 which is 492 00:18:59,840 --> 00:19:00,860 right on the nose 493 00:19:01,580 --> 00:19:03,660 and the main idea with the melt vulnerability 494 00:19:03,660 --> 00:19:06,080 is that they're altering the bitstream 495 00:19:06,080 --> 00:19:08,000 which on a properly set up 496 00:19:08,000 --> 00:19:09,960 synthesis pipeline and FPGA 497 00:19:09,960 --> 00:19:10,660 shouldn't be possible 498 00:19:10,660 --> 00:19:12,840 but altering it in such a way that 499 00:19:12,840 --> 00:19:16,120 unacceptable voltage comes out the other end of the FPGA 500 00:19:16,140 --> 00:19:17,960 and causes some serious trouble 501 00:19:17,960 --> 00:19:20,140 and while that might be 502 00:19:20,140 --> 00:19:22,320 unlikely in a properly configured set up 503 00:19:22,320 --> 00:19:23,940 there are situations 504 00:19:23,940 --> 00:19:25,020 where you have 505 00:19:26,180 --> 00:19:28,060 un thoroughly defined state machines 506 00:19:28,060 --> 00:19:28,900 stuff like that 507 00:19:28,900 --> 00:19:31,140 where you might get out an unintended result 508 00:19:31,140 --> 00:19:32,200 from the FPGA somehow 509 00:19:32,200 --> 00:19:34,020 so it's something to look into 510 00:19:34,940 --> 00:19:37,140 what is your FPGA connected to 511 00:19:37,140 --> 00:19:39,420 and are all possible values of output 512 00:19:39,850 --> 00:19:40,160 considered 513 00:19:41,240 --> 00:19:44,000 what if you want to just attack the FPGA itself 514 00:19:45,060 --> 00:19:45,940 what if we 515 00:19:46,140 --> 00:19:47,460 we don't care about dumping the flash 516 00:19:47,460 --> 00:19:48,260 maybe we're going to 517 00:19:48,960 --> 00:19:50,400 reverse engineer it physically 518 00:19:51,340 --> 00:19:52,660 which is something that 519 00:19:53,920 --> 00:19:54,820 FPGA manufacturers 520 00:19:55,320 --> 00:19:56,440 definitely worry about 521 00:19:56,440 --> 00:19:58,560 and there's definitely a whole body of research on how to do 522 00:19:58,560 --> 00:20:01,220 there's techniques like focused ion beam measurements 523 00:20:01,220 --> 00:20:02,960 scanning electron microscopes 524 00:20:02,960 --> 00:20:04,760 x-ray analysis is a big thing 525 00:20:04,760 --> 00:20:07,480 thermal analysis of the running FPGA 526 00:20:08,420 --> 00:20:09,500 and you know 527 00:20:09,500 --> 00:20:10,680 depending on how much you want to pay 528 00:20:10,680 --> 00:20:13,500 you can get FPGAs that are hardened against these things 529 00:20:13,500 --> 00:20:14,640 to some degree or another 530 00:20:16,240 --> 00:20:17,720 and we might 531 00:20:17,720 --> 00:20:18,940 also try to 532 00:20:19,720 --> 00:20:22,020 tamper the FPGA by placing it in a temperature 533 00:20:22,020 --> 00:20:22,940 it's not expecting 534 00:20:23,960 --> 00:20:25,280 tampering with the clock 535 00:20:25,900 --> 00:20:26,820 tampering the voltage 536 00:20:26,820 --> 00:20:28,860 using ionizing radiation 537 00:20:28,860 --> 00:20:30,600 I'm serious this is a big thing 538 00:20:32,040 --> 00:20:33,260 and you want to 539 00:20:33,260 --> 00:20:35,980 this FIPS document here goes over some of the 540 00:20:35,980 --> 00:20:37,840 hardening you might want to check out for that 541 00:20:39,820 --> 00:20:42,120 we'll get into those attacks a little more specifically 542 00:20:42,120 --> 00:20:42,480 in a sec 543 00:20:42,480 --> 00:20:46,120 but you would solve this with a more robust circuitry 544 00:20:46,140 --> 00:20:47,500 essentially redundancy 545 00:20:48,120 --> 00:20:49,180 voltage regulation 546 00:20:50,100 --> 00:20:51,660 secure cryptographic implementation 547 00:20:52,540 --> 00:20:53,100 and 548 00:20:53,900 --> 00:20:55,660 like a DAC based shut off 549 00:20:55,660 --> 00:20:56,720 when the temperature is wrong 550 00:20:56,720 --> 00:20:58,440 in fact I think Zilink's back on the other page 551 00:20:58,440 --> 00:21:01,520 has some kind of anti-temperature tampering thing 552 00:21:02,140 --> 00:21:03,740 and then there's like 553 00:21:03,740 --> 00:21:04,720 physical isolation 554 00:21:05,560 --> 00:21:08,260 which Zinc calls isolation design flow 555 00:21:08,260 --> 00:21:09,840 and it's the idea that 556 00:21:09,840 --> 00:21:11,200 if you have some kind of 557 00:21:11,900 --> 00:21:14,140 secure function that you think is really 558 00:21:14,140 --> 00:21:15,820 important and you don't want tampered 559 00:21:16,140 --> 00:21:17,220 you can put it somewhere else on the chip 560 00:21:17,220 --> 00:21:18,580 and have it live in its own land 561 00:21:19,320 --> 00:21:21,560 which is an interesting good idea 562 00:21:21,560 --> 00:21:24,100 but it's not automated in most FPGA programming environments 563 00:21:25,940 --> 00:21:26,740 and then 564 00:21:26,740 --> 00:21:28,440 an idea that comes up a lot 565 00:21:28,440 --> 00:21:29,600 is the single event upset 566 00:21:29,600 --> 00:21:30,740 when we're talking about radiation 567 00:21:30,740 --> 00:21:31,660 this is a big deal 568 00:21:33,120 --> 00:21:35,140 so usually it's in the context of people 569 00:21:35,140 --> 00:21:36,620 in a high radiation environment 570 00:21:37,280 --> 00:21:39,220 but it's something an attacker could try to use 571 00:21:39,220 --> 00:21:41,120 to get a chip to glitch essentially 572 00:21:43,320 --> 00:21:44,480 but FPGAs are especially 573 00:21:45,040 --> 00:21:46,040 vulnerable to this 574 00:21:46,140 --> 00:21:48,060 situation where some 575 00:21:48,060 --> 00:21:49,440 ionizing radiation causes 576 00:21:49,440 --> 00:21:51,640 a bit to flip or some memory to change 577 00:21:54,080 --> 00:21:56,080 NASA has a document on this 578 00:21:59,000 --> 00:21:59,960 there's a whole bunch of 579 00:21:59,960 --> 00:22:01,160 suggestions of how to 580 00:22:02,100 --> 00:22:03,660 secure the FPGA against it 581 00:22:03,660 --> 00:22:05,820 when we talk about soft IP in a second 582 00:22:05,820 --> 00:22:07,460 there's a bunch of companies that offer 583 00:22:07,460 --> 00:22:09,540 soft IP that's supposed to secure against it 584 00:22:10,140 --> 00:22:12,080 but if you're in a 585 00:22:12,080 --> 00:22:13,980 high intensity threat environment 586 00:22:13,980 --> 00:22:15,700 you might want to think about 587 00:22:16,140 --> 00:22:18,120 radiation proofing your FPGA 588 00:22:19,660 --> 00:22:22,240 well here's a guy at BAE doing radiation testing 589 00:22:22,240 --> 00:22:23,700 which I think is freaking cool 590 00:22:26,840 --> 00:22:28,260 so FPGAs also have 591 00:22:28,260 --> 00:22:29,860 something like a library 592 00:22:29,860 --> 00:22:32,160 and these are usually called 593 00:22:32,160 --> 00:22:32,760 IP blocks 594 00:22:33,780 --> 00:22:35,580 and they're HDL designs 595 00:22:35,580 --> 00:22:36,860 provided by third parties 596 00:22:36,860 --> 00:22:39,540 and they're usually provided by your device manufacturer 597 00:22:39,540 --> 00:22:41,920 your IDE whatever you're using like Cordis Prime or whatever 598 00:22:41,920 --> 00:22:43,800 will usually come with a bunch of these 599 00:22:43,800 --> 00:22:45,820 that you can license from Intel 600 00:22:46,140 --> 00:22:47,780 or Xilinx 601 00:22:47,780 --> 00:22:49,320 or whoever it may be 602 00:22:49,960 --> 00:22:51,660 and it can be really 603 00:22:51,660 --> 00:22:54,260 ornate stuff like entire CPUs 604 00:22:54,260 --> 00:22:55,860 that you can customize to your needs 605 00:22:55,860 --> 00:22:58,200 you know here's 606 00:22:58,200 --> 00:22:59,740 just a drive at home 607 00:22:59,740 --> 00:23:01,980 here's the Altera IP blocks menu 608 00:23:01,980 --> 00:23:03,080 and you can put in all these 609 00:23:03,540 --> 00:23:05,060 functions that are just drag and drop 610 00:23:05,060 --> 00:23:07,800 stuff as complex as CPUs, RAM 611 00:23:07,800 --> 00:23:08,460 state machine 612 00:23:10,800 --> 00:23:12,040 and you know it's an 613 00:23:12,040 --> 00:23:13,740 overlooked thing that if you have a design 614 00:23:14,440 --> 00:23:16,120 with FPGAs you might want to get your IP 615 00:23:16,140 --> 00:23:17,740 box checked for vulnerabilities 616 00:23:17,740 --> 00:23:18,440 as well 617 00:23:19,320 --> 00:23:21,240 what about cryptographic attacks? 618 00:23:21,520 --> 00:23:24,040 the same kinds of DFA attacks 619 00:23:24,040 --> 00:23:26,020 that people worry about for other kinds of 620 00:23:26,020 --> 00:23:28,220 systems are a big deal for FPGAs as well 621 00:23:28,220 --> 00:23:29,820 so you know 622 00:23:29,820 --> 00:23:31,620 timing based attacks, side channel attacks 623 00:23:31,620 --> 00:23:32,480 power analysis 624 00:23:34,020 --> 00:23:35,000 glitch attacks 625 00:23:36,420 --> 00:23:38,080 not much to say here that's different 626 00:23:38,080 --> 00:23:39,660 than other stuff 627 00:23:39,660 --> 00:23:40,560 other than 628 00:23:43,100 --> 00:23:44,080 you might 629 00:23:44,080 --> 00:23:45,940 take advantage of the 630 00:23:46,140 --> 00:23:47,740 routing and physical placement 631 00:23:47,740 --> 00:23:50,020 properties of the FPGA to try and counteract 632 00:23:50,020 --> 00:23:50,200 that 633 00:23:51,560 --> 00:23:54,100 we talked about glitch ejection before 634 00:23:54,100 --> 00:23:55,160 and 635 00:23:55,160 --> 00:23:56,840 getting towards the end here 636 00:23:57,680 --> 00:24:00,280 talked a little about security tools for FPGAs 637 00:24:00,280 --> 00:24:01,960 and what some more HDL 638 00:24:01,960 --> 00:24:03,660 oriented analysis might entail 639 00:24:05,020 --> 00:24:06,040 you know 640 00:24:06,040 --> 00:24:07,960 one thing to keep in mind about FPGAs that's really cool 641 00:24:07,960 --> 00:24:10,140 is stack analysis works really well 642 00:24:10,140 --> 00:24:11,140 on FPGAs actually 643 00:24:11,140 --> 00:24:13,500 some of the stuff if you're familiar with 644 00:24:14,140 --> 00:24:15,880 like SAT solvers 645 00:24:16,140 --> 00:24:17,720 or formal methods 646 00:24:17,720 --> 00:24:19,840 or proof based security measures 647 00:24:19,840 --> 00:24:21,780 this is very mature on FPGAs 648 00:24:21,780 --> 00:24:23,880 but for different purposes than maybe security 649 00:24:23,880 --> 00:24:24,780 people are used to 650 00:24:24,780 --> 00:24:27,040 it's oriented more towards 651 00:24:28,840 --> 00:24:29,960 defining correctly 652 00:24:29,960 --> 00:24:31,980 the electrical properties 653 00:24:31,980 --> 00:24:34,080 of the FPGA making sure that we don't have things 654 00:24:34,080 --> 00:24:35,660 like that meta stability we talked about 655 00:24:35,660 --> 00:24:37,960 making sure that the clock can run 656 00:24:37,960 --> 00:24:39,560 at a stable rate without causing 657 00:24:40,240 --> 00:24:41,940 propagation delay based errors 658 00:24:43,560 --> 00:24:44,280 it's not 659 00:24:44,280 --> 00:24:45,900 so much for security but it could 660 00:24:46,140 --> 00:24:47,220 help you with security 661 00:24:47,220 --> 00:24:49,920 usually a stack timing analysis 662 00:24:49,920 --> 00:24:52,040 tools can do things like detect unconstrained 663 00:24:52,040 --> 00:24:54,060 paths that might be a security problem 664 00:24:54,060 --> 00:24:54,740 it might not be 665 00:24:56,960 --> 00:24:58,140 but they'll come 666 00:24:58,140 --> 00:24:59,800 with your design suite 667 00:24:59,800 --> 00:25:02,120 but there are problems at 668 00:25:02,120 --> 00:25:04,020 the intermediate level with finding bugs 669 00:25:04,020 --> 00:25:05,840 in this it's not going to find logical bugs 670 00:25:05,840 --> 00:25:08,060 and it's not going to know unless you help it 671 00:25:08,060 --> 00:25:08,240 along 672 00:25:10,260 --> 00:25:11,980 about security errors with 673 00:25:11,980 --> 00:25:12,960 data flow 674 00:25:12,960 --> 00:25:15,280 the stack timing analysis 675 00:25:16,140 --> 00:25:17,320 can't tell for instance 676 00:25:18,580 --> 00:25:19,960 where your data is going 677 00:25:19,960 --> 00:25:21,760 and which of it is supposed to be secure 678 00:25:23,760 --> 00:25:24,900 can't answer questions like 679 00:25:24,900 --> 00:25:25,920 can the user write to arbitrary 680 00:25:25,920 --> 00:25:26,340 memory 681 00:25:27,880 --> 00:25:29,720 none of this stuff is even in the purview 682 00:25:29,720 --> 00:25:30,740 of that type of analysis 683 00:25:30,740 --> 00:25:33,320 this is really good stack analysis 684 00:25:33,320 --> 00:25:35,260 but it doesn't fulfill the needs of 685 00:25:35,260 --> 00:25:37,400 what a security engineer would be looking for 686 00:25:37,400 --> 00:25:38,560 necessarily all the time 687 00:25:39,520 --> 00:25:41,320 I think one of the coolest 688 00:25:41,320 --> 00:25:44,100 in getting along to the same idea 689 00:25:44,100 --> 00:25:45,980 everyone is having about how to do security 690 00:25:46,140 --> 00:25:47,460 stack analysis on FPGA 691 00:25:47,460 --> 00:25:48,520 is this tool from Cornell 692 00:25:48,520 --> 00:25:50,400 called SecVerilog 693 00:25:50,400 --> 00:25:51,780 and the basic idea is 694 00:25:51,780 --> 00:25:54,420 one of the biggest problems on FPGA 695 00:25:54,420 --> 00:25:56,980 design security is where that security information 696 00:25:56,980 --> 00:25:57,660 is flowing 697 00:25:59,860 --> 00:26:01,440 SecVerilog is basically an extension 698 00:26:01,440 --> 00:26:02,380 to the Verilog language 699 00:26:02,380 --> 00:26:04,920 where we are able to imitate 700 00:26:04,920 --> 00:26:07,120 which bits of our data are secure 701 00:26:07,120 --> 00:26:09,500 and it will trace that by 702 00:26:10,140 --> 00:26:11,260 injecting Verilog 703 00:26:11,260 --> 00:26:14,080 at various levels and areas 704 00:26:14,080 --> 00:26:14,940 and 705 00:26:16,140 --> 00:26:17,380 give us an idea of what is going on 706 00:26:17,380 --> 00:26:19,480 and you see a lot of 707 00:26:20,140 --> 00:26:21,740 transpiler ideas in this zone 708 00:26:22,620 --> 00:26:23,940 to give you an idea of 709 00:26:23,940 --> 00:26:25,740 the kind of ideas a human would find 710 00:26:25,740 --> 00:26:27,360 that the stack analysis tool won't 711 00:26:27,360 --> 00:26:30,120 we are looking for bad state transitions 712 00:26:30,120 --> 00:26:32,360 data flow to unintended areas 713 00:26:33,820 --> 00:26:35,400 timing sensitive problems 714 00:26:36,700 --> 00:26:38,420 places where people should or should not 715 00:26:38,420 --> 00:26:39,120 be checking the clock 716 00:26:39,120 --> 00:26:40,720 or doing so incorrectly 717 00:26:41,240 --> 00:26:42,160 race conditions 718 00:26:42,160 --> 00:26:45,280 places where you are assuming you are in a synchronous mode 719 00:26:46,140 --> 00:26:47,400 of operation 720 00:26:47,400 --> 00:26:48,440 but it is actually asynchronous 721 00:26:48,440 --> 00:26:49,240 or the opposite 722 00:26:52,140 --> 00:26:53,380 a-listing issues 723 00:26:54,640 --> 00:26:55,160 and 724 00:26:55,160 --> 00:26:57,280 that is basically it 725 00:26:57,280 --> 00:26:58,680 I don't know how we are doing on time 726 00:26:59,420 --> 00:27:00,120 let's see 727 00:27:01,240 --> 00:27:02,620 oh pretty good 728 00:27:02,620 --> 00:27:05,520 so since we are good on time 729 00:27:05,520 --> 00:27:07,180 do we have any questions from the audience 730 00:27:11,660 --> 00:27:12,560 dead silence 731 00:27:14,380 --> 00:27:15,980 how many of you guys have worked 732 00:27:16,140 --> 00:27:16,800 with FPGAs before? 733 00:27:18,020 --> 00:27:18,700 oh cool 734 00:27:19,420 --> 00:27:20,940 so you guys are all like 735 00:27:20,940 --> 00:27:23,000 oh this was too high level for me 736 00:27:23,000 --> 00:27:23,600 ok I got you 737 00:27:24,740 --> 00:27:25,700 it is ok 738 00:27:28,160 --> 00:27:29,460 alright well I am out then 739 00:27:29,460 --> 00:27:31,440 we have a question 740 00:27:40,100 --> 00:27:41,500 no I haven't seen that 741 00:27:44,140 --> 00:27:46,120 although I don't think it would be hard to put together 742 00:27:46,140 --> 00:27:49,820 some of the schemes I have seen proposed 743 00:27:49,820 --> 00:27:51,720 are taking something like 744 00:27:51,720 --> 00:27:52,920 I know that there is a 745 00:27:52,920 --> 00:27:55,400 GNU VHDL compiler 746 00:27:55,400 --> 00:27:57,160 that basically turns 747 00:27:57,160 --> 00:27:58,400 VHDL designs into 748 00:27:59,780 --> 00:28:01,220 native code for Linux 749 00:28:01,220 --> 00:28:03,320 I don't think that would be hard to instrument 750 00:28:03,320 --> 00:28:04,340 in the same way 751 00:28:09,740 --> 00:28:10,340 hmm 752 00:28:19,060 --> 00:28:19,860 oh ok 753 00:28:19,860 --> 00:28:20,480 yeah 754 00:28:21,500 --> 00:28:23,540 most of the literature 755 00:28:23,540 --> 00:28:24,800 is in the form of like 756 00:28:26,320 --> 00:28:27,120 alpha particles 757 00:28:29,820 --> 00:28:30,220 we 758 00:28:31,100 --> 00:28:31,960 I don't know 759 00:28:31,960 --> 00:28:33,380 the number off the top of my head 760 00:28:33,960 --> 00:28:34,980 but there is an interesting 761 00:28:37,080 --> 00:28:38,300 it might be the opposite 762 00:28:38,300 --> 00:28:38,820 of what you think 763 00:28:38,820 --> 00:28:39,880 like less is more 764 00:28:40,780 --> 00:28:42,360 there is sort of an annealing process 765 00:28:42,360 --> 00:28:45,400 that can go on when you slam the chip with lots of radiation 766 00:28:46,140 --> 00:28:47,420 as opposed to a little bit intermittently 767 00:28:47,420 --> 00:28:49,900 where the chip will be more reliable 768 00:28:52,220 --> 00:28:54,120 more reliable with more radiation than less 769 00:28:54,880 --> 00:28:55,980 and that is one of the problems 770 00:28:55,980 --> 00:28:57,580 if you look into there is a whole lot of literature 771 00:28:57,580 --> 00:29:00,220 like how unreliable the industrial testing 772 00:29:00,220 --> 00:29:01,580 can be on that 773 00:29:01,580 --> 00:29:02,440 if you are not careful 774 00:29:09,720 --> 00:29:10,080 alright 775 00:29:11,700 --> 00:29:12,700 have a good day guys