Dominic Letz | Diode DPKI: Why blockchain is the solution to IoT security | COSCUP 2019
Taipei Ethereum Meetup·Wed, Oct 9, 2019, 12:00 AM
Diode DPKI: Why blockchain is the solution to IoT security Web PKI is the standard for resolving server authenticity in IoT device deployments. We highlight it’s known problems and recent hacks against Web PKI specifically in IoT deployments, and show a blockchain-based decentralized PKI (DPKI) approach that enables devices to fetch pinned certificates directly from blockchain to solve most, if not all, of the shortcomings of Web PKI. The demo runs on Raspberry PI on the device and a Firefox extension on the client side both connecting securely to the blockchain will be presented. Previous attempts on light clients struggled to either keep data size small or sacrifice security. We show a new approach that allows even tiny devices such as ESP32 to connect securely to a blockchain. 共筆: https://hackmd.io/@coscup/Hyr-gQg4r 講者: Dominic Letz Dominic Letz, Chief Technology Officer of Diode at Exosite has more than ten years experience in managing large scale M2M and IoT deployments both at Exosite and before that at Nokia in Europe. Dominic innovated in connecting smart devices and using collected data to improve products and learn user behavior. His focus is now on bringing the security of smart device communication to the next level. Slide: https://www.slideshare.net/yahsinhuangtw/coscup-2019-diode-dpki-why-blockchain-is-the-solution-to-iot-security ===== 加入 Meetup 以得知下次聚會時間地點: http://www.meetup.com/Taipei-Ethereum-Meetup/ slack 討論:https://ethertw.slack.com 。請先從網站取得邀請信: http://bit.ly/252hNY0 通關密語:decentralized 臉書社團: https://www.facebook.com/groups/443751072484739 歷次講座投影片、程式碼整理: https://github.com/EtherTW/Taipei-Ethereum-Wiki/wiki
Transcript
first English today thank you so today we have dominate which is says who is the CEO from Thailand I have the company and so let's give him the power Thank You June yeah we have this company here exercise that I'm working for and we have launched this project and I want to dive really quickly into this so the name is a bit provoking and there's maybe a second name for this talk which is doing block Chang was Alexia the good the bad the ugly and we're going to talk about that as well a little bit because everything we done we've done we don't do a lot with Alex here thanks for the introduction I just did a little bit of a summary here so I'm actually having lived in Taiwan for seven years now I'm back to Berlin and we're working from there International there's like a lot of etherium going on in Berlin and we were going to talk about the next item the block click algorithm and we also active in the theory magicians I don't know if anybody knows the exterior magicians is a improvement group to improve the etherion protocol and to make suggestions and that's where we what we do and what I what I mostly hacking is I started with PHP long long time ago and C++ and Iran Aleksei now is my new stuff if you hear anybody talk blog Shannon IOT this should be your first reaction usually like whoa like take take them take them in like why would anybody have the idea of using blockchain and IOT so if you hear that take a little bit distance and we want to do that take a little bit and see like what's happening here so typical IOT devices we're talking about that we do like in the company I'm from is like smoke detectors or smart locks so these are usually very small chips so you and ESP 32 this even if you know our Dino like on that level of computational power usually like a very very small machines that we work with in IOT and getting their clock Chang running is not an not a trivial task but there's really big security like some really big security problems that people don't talk about love and there's some qualities me not readable that I wanted to highlight there's some soy difficult here on the left-hand side and what we thought of this would be better on the right-hand side and I want to go through that a bit so what you have you mentioned the store or if you buy it it was offline and no power and you were putting it on the first time can't find out what's what's the current time actually in an IOT device that connects how does it find out the current time made a pasta some something there's a DNS lookup give me the DNS name my time circle maybe 50 but like a DNS lookup is already unsafe as you guys might know like me an ass is not an anchor just into some public server you ask you what's the name and gives you some ideas if the Wi-Fi you have connected you is taken over by somebody or somebodies in your Wi-Fi network who has bad intentions it gets sent around a bit over next Messing's it tries to actually ask the server what is a part time my name is thank you for the poem that's also not encrypted not secure in any way so it's a second leg where you have no security then service you don't try to actually connect to your server again and in Japan you try to connect it up and you again DNS about here again con say you don't know and then what usually happens here in the last step is you know have an SSL and you see correct time to check this but if the current time you got up here unfortunately unsafe because this I hope you guys learned otherwise another time and you're checking in it's missing a snake we should also not know whether 22 process giving so all of these steps are currently in security the makeup done yes if you don't know the current time for the very time is probably modified by somebody by a certain party modified then you actually validate the certificate down here and if you can't do that and now your lot of your door your smart lock connects to the wrong server imagine what's happened what's happening then somebody can take it over give your own data and so on and when we thought about blockchain this is what we wanted to do what change the size blockchain actually allowing us to do all of the security and the first interest point is actually that up here the time if they are able to connect to a blockchain securely establish what is the most recent block for example as I said if you might get the most recently in some way I can get a rough time already come back and if I have the rough time I can actually also get from the most recent law even better the real server address the real certificate cache that I need to connect and then I can connect to it security I'm sorry for like this being unreadable you would probably get a copy of this so this is where we started out because right now if you use any IOT devices like we just talked about they probably have all these problems on the left hand side so we check the address and then from this contract and every time when it gets data from this contract in to show that this data is actually true and if it does that the only there's not trusted search party it doesn't need to trust the server an instant it doesn't need to trust any big authority somebody the only thing it needs to know is that what's the hash of the block and everything else it can prove and this is really what we call trustless here so it becomes trust as IOT you don't need to trust a third party you don't need to trust anybody else I need to be a bit quicker I left too many slides so I'm gonna try to accelerate related to this and this insecurity that's happening is like you probably saw that in the media China and your way these routers like the yes doesn't like your way around us anymore and from time to time China's redirecting traffic and I wanted to highlight that this is happening since 2010 and it's happening because the the way the Internet Protocol works BGP the border gateway protocol is actually also not a secure encrypted protocol but talk to the other person depends on corporation so this is one example that the article has developed in 2017 somebody wanted to send it to sleep impacted by the HTTP connection from Los Angeles to Washington right so you should you should think the connection goes here but over here the route that I have the shortest route I have the shortest route the shortest route for you to go from Los Angeles to Washington is to send it to Beijing and then to send them and then back again to Washington so all this network traffic went this route and now people say like well this is it's HTTP there's a public key infrastructure so it's secure HTTPS is secure is encrypted so nobody can can go in right well if you if you start out with wrong assumptions bad things can happen this is what I wanted to highlight here and especially the handshake in PKI is right now very problematic just to recap a little bit if you connect and if you trust in the company go find all that he is like some justice for something but select rosters that's why they are a global good but there's a couple of these companies and most of them you want to know in fact always resolve intermediate circuits on this level and they each create so it's for any domain on the planet what this means concretely is that they can do men in the middle attacks so what's happening here is you get this is you sending men from from Los Angeles and you want to connect to Washington well and on this traffic yes for some reasons through the smell box in China might be something else this middle box has another good intermediate certificate so what it does is it gets it that HTTP subject it looks at that and that's all you want to connect to this guy over here I'm going to create a fake certificate a fake city that I sign was my immunity and this takes a then you start sending data and I decrypted a yeah and I send it over to Facebook now I can recall in your audio HTTP traffic and the coolest thing is about that your brother's want to show you a green bar it's gonna be green now you could say like lon nobody is doing that right the problem is people are doing that so if you today connect to Facebook from outside and he goes through these details what you will see is that in Palestine you get this tip in the rest of the world to get listen they all play over mostly the same there's a little difference here so that the authority that has created the certification research that's one of the big companies feature is another one if you connect home hello side will say security certificates the company once and the company the country of those companies kzskull of sun protection because of some government has introduced a global root certificate that you have to install on every machine in Kazakhstan so they can they can read all the traffic if you impossible and they do this because I know this is so this list I collected there is some showing like all the states that have no intermediates so this right now this resource is somewhere 3406 3,800 is actually number going out and so in Europe we have like 2000 set of these certificates a lot of universities for example table so any university can create those and you see that but it's not all countries and the question is like this isn't as unfair why can some countries create signatures for domains but other countries not and this is what you wanted to change one it actually to change listing like let's remove these rules that's just not have them like why do we need a third party dip Global sign to connect our IOT devices why introduces this is a systematic issue so this is a trust only okay we have five deputies they have one 372 medias and this is whatever the process and you don't know these companies you can check them all to find it of use in this clip you don't know and you have no idea who these are but they sign off all your secure connections the idea was doctoring is if you are facebook.com or you are like this company doing the smart locks you put yourself it's needed blockchain right you register on here and the custom of the device or the user is checking and also from the options so we gather the blockchain as a central registry for all these secure circuits and this removes the need to have a certain party that can then do funny stuff like kind of fun can trade this is immediate certificates or anything like this it totally removes that possibility and makes this communication secure so why has nobody else done that that sounds great right like it's like cool let's do it there's something not a lot of people talk about here and this is on one hand how much storage and resources we have on our on our hardware and how much we need to actually do fun stuff with the blockchain so the advice we work with a but RV no 11 ESP servitude for example at the very commonly white might ship from China a public Wi-Fi light switches Wi-Fi monitors or blocks anything like this you will probably have a chip like this and link it for example is a hard bass one from MediaTek they have that 500 500 kilobytes of RAM 300 above ground and sorry it's like a couple of megabytes give it right now into the current time so you see that we need a hundred times more resources I put like get in are two equal parts maybe it's a sign up to show that because that's like the starting place boss I'm often getting ask like why don't you guys use iota we tried Toyota and the problem is it's like Java base and needs like 40 40 gigabytes on the ramp but we have 300 kilobytes of RAM we cannot even start drama - same as a storage so it s for iota to give them some credit if you have an audience or BMW and this is your class I'm sure they have to have a real computer inside and run it there but if you think you guys are small like this it's not possible so this is a charge we started out with we created this this paper and published that and the other is a block way that actually is solving this it's called the super light client is right now two other isms to introduce a super light kinda does not change value Asian on very very little amount of memory so this is a new addition here so quick and also very gay 20 kilograms around 50 kilobyte and this is like what we wind up with the tape and stuff then started implementing and still working on so what we are the set like that we that we started out using it we do everything based on material because basically what they do is is the right thing and add on that lovely so quick just requires a couple of blog header changes so we have to have to do this but it's also a nucleus to change the chain search engine also the working la vez en s which is the interior mainland systems and if you remember the beginning of the target of above unsecure DNS for us because the NSA exactly addressing that that's what DNS the same is true that is true for BGP that is true for PKI if you put the stuff into the blockchain Omega blockchain the authority so you don't have the problem with a certain part and transmissions so if you go there we actually want to be able to connect devices so we are all about IOT devices we want to enable device not only connect and securely check the certificates but use of blockchain to actually have secure transmission anywhere and now we go a bit ly to coding like there was the question father how much code we need to meet if I want to understand the theorem so we checked out the different code bases and they never get you missed because it has multiple implementations I just mentioned three it is Hakeem more than that so there's a restful face it's a pretty nice and this is thought 445 solve interesting atom which is just 90,000 and then if you do spill or biggest batch all this six hundred thousand lines of code if you take everything into account they nearly approaching a million lines of code so far as we wanted to start a branch of a theory and implement the pure luck block quick and try out like ensure that the algorithm can work and the problem was like they're very big foster base Boston was that this is also moving target as I'm moving to a theory of 2.0 I don't know if you guys have heard of that they're very focused on these changes so they're making a lot of change whether it be if you try to stay on top of that you probably have more work rebasing than anything else so we start with an elective prototype and I mentioned the good the bad the ugly the good part if you start with Alex here is there's actually there's actually some community in there some aetherium work happening in Alex here so there's a an AVM that we use from eternity that's also like a theorem start up using the EDM as open source there is like a really good network browser rock scout you can browse like your transactions all of that we use we also use that and you can also obviously use the cryptographic functions to to actually do this stuff that clearly does and this there's even like a relatively recent a full note implementation called mana that is relatively active and this is a bit of a software overview here so what has happened not so that's like volcano we use the opportunity BFF sort of fraternity to run a new protocols to talk to these devices that's using that that others but then you have we do the same if your hardly see that is a negative so you can use any of the tools like we make sorry and we also have a new note report and this is because we want to publish more information about these devices through the whole property network and most of that is some of us never once a block code is actually changed inside the note inside [Music] the block tickets up thanks for five minutes and some of that is level 2 and level 2 means fairly in sight what runs in said they need answers a smart context here so we also set up a small contract because the question is if your devices connect this pretty fundamental question that you're not with any of these devices to block chain rattles why should this is why should we open this party ready he'll define a new work for you regardless and why should you open this as a minor a minor is my name is Ross and he's making some money from line of the blocks so what what is his reason to waste resources and talking to somewhere in the mighty devices they don't have in mind well and so there is a neat fun incentive what makes sense for him to actually open the sport and that devices ask you it's funny questions like what is this DNS address so what is the speaker so anything like this and so we came up with the incentive that is implemented up here on level 2 mostly in a registry of tweets and devices and for each one of those three contracts that contain information for the devices to fetch but also a way to generate incentive for the diagonals and this is really where I want to go of it but if we change want to change the security model we have to fundamentally address all these streams bgp the they look routing dns the domain name system those are not encrypted and key karai isn't isn't prepped it but it's centralized all these three like basically the street fundaments of Internet the one address invisible yes aware devices actually both sides in the same way clients and in the middle block chain blockchain network we used for transmission so the yes itself using central service that device or client permits to the nearest nodal points and create opens like a persistent connection connection and keeps open can be any of those you can is totally trustless as long as you can validate that the data you get is the right one a device and stores its location in the chain so that's why we have the peer-to-peer protocol and the chain that's near and the client can use that I'm activating here bit which is located and then create a connection either a direct connection device connections to the vulcanism and so imagine that like if you right now I don't know anybody of you have done a Raspberry Pi for a bit but if you do that and you bring on maybe your webcam or some sensor data the problem is you can't actually just show that to your friends and family because that Raspberry Pi is only online in the white light it's not reachable from anywhere on the planet you always leave like a proxy server or a central server but that central server either introduces cost a lot introduces security because it's controlled by a third party with this model it becomes server less right so the chain itself becomes your proxy in a trust this way some comments about writing this in a theorem it's fun it's like little code and it's especially nice to write in these recursive functions are wonderful to write in but at the same time if you have large trees actually copying them in a functional language like every modification is a full copy of an approaching it that's big like they can get by in the country and you have an intimate table functional language they're copying like a gigabyte of memory all the time so that on the other hand to coat you you can write to modify the truth what's more small like like compared to what we looked at but now we have latex in our line and all of this are not what is actually the EVM that we just used the Eternity EVM the baddest yeah Alysia is not like for fast computation so don't rewrite cryptographic Sutton and an Alex here and I'm saying that because I did and I found it's pretty slow you can still check it off and I'm scrolling today we don't have time for demo we're at the end actually so I'm gonna skip that and look at the end thank you very much for this it's pretty it's pretty good yeah thank you so actually talked about him I what is the wrong information is the question right so I think if you if you register like an address for example like you deploy your smart contract that smart contract addresses is yours right nobody can register the same address again if you put garbage at your own okay you can put garbage at your location but then probably nobody cares I whether the this is actually all blockchain so what you use to often authenticate is basically your wallet right is you have a private key and a public key and I used to facebook-dot-com as an example right but but this is actually like a string a name what the device is like the IOT devices look at are usually like contract addresses or public/private key addresses so you if you know if you have the public key you can prove it but it because you can sign a post your private key if you don't have the private key to that it's really hard to prove but you cannot until somebody breaks cryptography I guess that makes sense ENS has like a really interesting solution they want to actually use human readable names like short names and so they have an auction auctioning system so you can say I want to buy the name Facebook you know somebody can now say I also want to buy it and then they can do this I think this is a really interesting system for humans it's super important because we want to have short URLs for the missions like IOT devices not some part we just use the addresses but for for human interactive interaction we want to use that as well probably is and they claim to be effective yeah it's it's very I mean Google is Google is really like two sided support because on one side they support that on the other side they don't trust it themselves so what Google actually does and so if you if you create a fake certificate for Google what they are doing actually they bake check in all their browsers they have pre-loaded their own server certificates they know all our servers have these certificates and they preload the money in the browser now if some like Kazakhstan treats a fake Google's etiquette the Google browser itself will send a report to Google and they will find it in the sitting a transparency now the certificate transparency works as long as people contributing are submitting this feedback right so if you use the Google browser the Google browser will automatically send this feedback if you use an IOT device it will not send anything back it will probably not even implement most of the standards correctly and if you are in a man-in-the-middle attack there's even no guarantee that you can send anything back like you get this fake certificate you can only prove it looks right I've never seen it before but the fact that you have never seen it before it's not guaranteed that you have a pass to send that back yesterday the transparency is interesting like if you use curl for example but it's a it doesn't even check verifications right it doesn't do certain transparency it doesn't do anything like this so anything that is that machines do right now this is real secure thank you any questions okay I guess that times up yeah that's thanks Dominic again [Applause]
Automatic transcript — names and jargon may be misspelled.