 Hi guys, my name is Farhan and This is something that I've been working on for some time now. This is the first time I'm talking about it anywhere at all it's very much a work in progress and How many of you are programmers here? You can just can I have another raise of an alright fine? so This is more of something which you know probably should have been spoken out Spoken out at FOS or something like that. I was told that this is going to be primarily a technical audience So hence I'm just you know, this is a work in progress, but hopefully you like what's being shown here I Have my original background is Analog electronics That's what I do best but I'm also fairly convergent in C language And that these two things apart last ten years we've been running a place called Lamakan, which is a critical public Open space for liberal politics and culture as well. So it's a mishmash of a lot of things happening here But essentially what I'm going to talk about here Is actually something which you have borrowed directly from the military from the from the defense electronics? So in the defense world there is a concept called Manit, I don't know many if any of you have heard of it So Manit means mobile ad hoc network and the idea of mobile ad hoc network Is firstly it's mobile So it's something that you carry with you like a cell phone or whatever or a man pack Usually they were man packs back in the 70s, but they've reduced the size considerably And as it happens with defense that there are a lot of security implications You should not be able to intercept it. You should not be able to block it It should be reliable. It should last a long time. It should have a very long range I mean all the things that you can think of are there in the Manit So my project is actually called free man. It's a free mobile ad hoc network which is meant for Challenging atmospheres and environments and by challenging I mean that They can be deployed where there is a natural disaster or a man-made disaster or the internet is down or the you know I mean a war situation in times of peace everywhere But it's of particular interest to where the internet is down and I will tell you why that is But just before we get there a couple of points that I wanted to make one is that after 1857 revolution The British decided that it was very important that the communication lines across The subcontinent were you know strengthened So what they did is that they actually put together The telegraph network of India right and the 1882 Telegraph Act also came in as a result of that And if you imagine that there's just 6,000 of white mostly men who ran the country and They ran it on these couple of Telegraph lines and the Telegraph lines are at best about 10 bits per second Right and they managed to control us all so that actually shows you the Amplifying power the multiplication factor that communication networks bring into subjugating somebody or into freeing yourself up And what has increasingly happened is this is something that you know I was discussing with Kiran also just a little while ago that We do not imagine how much of bandwidth we require actually we require far less bandwidth than we consume now Right and we do that because most of the bandwidth is you know pictures of kittens, you know videos Advertisements actually large part of it pawn I mean this you can just name it but if you look at for example The entire wiki-pedia can still the text of it fit into a single SD card Right, so the amount of internet that you actually require the data connection that you require for tactical information Tactical information. Okay, the word is tactical that is you know saying I'm going here. Where are you? I'm here where I mean, you know for instance to Denow the position where I mean that I'm standing here. I can do it in about eight bytes accuracy to the Probably one meter Anywhere on the globe, right? I have I can compress that into a single 64-bit integer So the amount of I mean that's the location update, right? You just require eight bytes of information to give a very accurate coordinate so The amount of information that you actually require is far less than we assume it to be And I'll actually discuss that a little what you know, and I'll show you what technology is being used by the armies across the world I'll just give you one example, right? So you look at this this Radio it's called the rifleman radio. Okay, NATO uses it. You guys must have heard of the Star Wars program, right? Ronald Reagan, I mean people who were born around that time, you know, most of this hall doesn't seem to have been born by then but so This is used by soldiers, right? Constantly keeps you in touch with your this is by the way from a brochure of rifleman Keeps you in touch with your entire platoon the platoon leader wise and position Information so it's you know, the entire team is sort of sharing that Leader gets to see where all your soldiers are so actually the many of them have this heads-up display, right? Like the Google glass which was actually inspired by them and you can actually see who's where you know Who's behind you who's in front of you so basically in front of you There's a virtual ring that you see and there's a 12 o'clock position Which is ahead of you and six o'clock behind you and around the ring your teammates are Spotted so when you turn around here the ring also rotates, you know in front of your eye Then it's completely encrypted So basically there is you can do secure communications and unsecure communications on that And what happens is that the frequency of this radio keeps fluttering about all the time, right? So it's never you know at one frequency So if one frequency gets jammed you move on to another frequency etc, etc And the way it works is that you basically use a pseudo random number generator, right? A pseudo random number generator basically generates a series of random numbers, but they are not random Given the initial number There's a particular sequence that it does and you use these to call various channels out at various points in time So that both the receiver and the transmitter keep jumping in the frequencies Simultaneously so that others can't jump around at the same time then they use encryption Encryption is already available for us civilians, right? We have the SSL 3 etc etc. They use a AES 25 now You see this Put a soldier on the radio in the mountain and he'll act as a bridge between Other soldiers etc. So you know they can relate from each other And you must have seen the dramatic use of this for example when they took out Osama bin Laden that People rushed in and from there to the helicopter from the helicopter to a flying drone from flying drone to a satellite all the way through a You know inter-satellite link to White House and you know this Obama Osama Okay Killing of Obama, you know something something is already fairly dramatic stuff But the most dramatic thing here is the radio itself by general dynamics You can't buy it Only the governments can buy it right and If you were a government it would still cost you about 50 lakh rupees That's the cost of this radio Now I can't imagine What would go into this for it to actually cost hundred thousand dollars right hundred thousand dollars is what it costs The Indian government has bought six thousand of these at a low rate of three thousand crores The order has just gone out So but the point is if you look at each of these technologies Individually they are doable right they're completely doable and This is the sort of stuff That there is no reason why citizens should not have That says that citizens should be able to communicate with each other without relying on infrastructure whether it's internet or whatever should be able to share or communicate very Permanent life-saving bits of information and their own personal status whatever you know alive dead. I'm here You know I've been caught whatever etc. Etc and You know coordinate with each other. I think it's that should be fundamental right You know given that the technology is here and it should be encrypted Nobody else should be able to interfere with you etc. I mean everything that is about the rifleman Should be available with free man as well So this is the whole idea that we have a mob an open source mobile ad hoc network Okay, and we do precisely and exactly the same thing that The army does But we replicate is exactly the same communication system on our own It should be able to do voice It should be able to do messaging it should be able to do automatic position reporting system Which is you know as you're moving around it should be able to report your position direct links That is from point to point There should be no need for any base station Wi-Fi router nothing etc. You should be able to have at least a range of 10 kilometers here and direct link and then You Should be able to evolve it you should be able to augment it for example You can add a GPS to show your position you should be able to you know pick sensors up You should be able to you know add all sorts of devices to it and Extensibles because it's open and you can hack it etc. And the most important thing is that from 10 million rupees you should be able to do it for less than thousand rupees. I think all these are possible And this is what this project is about so in order to do this these are the three Fields which have to merge together and I need people who will collaborate with us on this So the freemen the freemen uses codecs to compress voice. It's completely based on Arduino Okay, and the reason why it's based on Arduino is that a Raspberry Pi can be compromised because it's got an operating system Right you can route it you can never route an Arduino because it doesn't have an operating system So you might have left it somewhere and somebody would have you know planted a Backdoor onto it etc. Etc with an Arduino That's not possible because an 8-bit processor doesn't have an operating system and your entire source code is with you You can actually flash it from your Computer by yourself without you know relying on anybody else's help so you know that it's completely secure So what happens is on one hand you need to know voice over IP codec, etc I was actually part of the ITF work group which standardized voice over IP I've belonged to the stonage of voice over IP before the standards were there in fact the precursor to SIP protocol which is used for VoIP We actually wrote the first reference implementation very few people know this It was actually written in India by us and everybody else interoperated off with us You have to be able to do very very cutting-edge stuff with Arduino and I'll discuss that in a little while Where you have to actually debug not with a debugger word, but with an oscilloscope because this is where the analog meets the Digital you should know your radio's value should know your analog electronics well as well But all this has to because you know it has to be product productizable at the end of the day The magic is in the software not in the hardware the hardware is actually pretty simple This is what it looks like so that's the hardware and It can do voice and if you see here I've connected it through the serial port of the Arduino to a simple Terminal emulator on the phone itself so you can use the phone as a user interface right now I have problems even with that because the phone can be compromised right we saw what Pegasus did So it's best to actually instead of this have a terminal a hardware terminal itself written in a In something which is a little more elaborate than the Arduino Through which you can do messaging directly right and this is like the old IRC chat I mean you know this Goose is sitting here He and I have been through the pre-history of internet on IRC servers for a long time So as you can see the hardware is pretty simple and the magic is in the software And I'll explain what it takes to get this thing going and where we are now so this is the maths we are using a LoRa module and we have a spreading factor of six and Bandwidth of 500 kilohertz right so The spreading factor essentially is like this that LoRa does not work out one frequency, but it has this chirps with chirp from one frequency to another so right and The direction of the chirp says whether it's zero or one and the spreading factor will tell you how many chirps make up one bit Right, so there's a spreading factor and the bandwidth is 500 kilohertz So what happens is your chirp is 500 kilohertz wide when your chirp is 500 kilohertz wide You can't jam the signal anywhere because your jamming has to be 500 kilohertz wide for it to be effective And over and above that you can also do you know frequency hopping which is also possible With these LoRa modules. So we actually Have gone up to 25 kilometers range actually on this LoRa thing and With this setting of spreading factor six and 500 kilohertz bandwidth We actually have I can sort of demonstrate to you here the LoRa power output was 8 plus 18 DBM DPM which will amount about What 70 milliwatts right 70 milliwatts of power and 10 kilometers path loss at 433 megahertz is 105 dB by the way, all my entire presentation is this right. I mean they're all just my lab notes So you'll just have to put up with fairly bad Powerpoints, it's not a powerpoint. It just pictures from a notebook So what happens is plus 18 dBm path loss is minus 105 dBm So the receiver the signal at the receiver is minus 87 dBm and the minimum discernible level is Minus 111 dBm. Now, how do I know this? I know this because I measured it So you take a LoRa module you add an attenuator in the middle and you connect it to a spectrum analyzer and you keep going down Until the signal is no longer Receivable so you know at what point it's going. So actually this is all experimentally verified, right? So we've actually it took us almost two months to get this entire math at place Anyhow, but even with this 10 kilometers path loss You still have a 24 dB link margin that is your signal can go down another 250 times Before you lose the signal, so it's a fairly reliable even at 10 kilometers but the whole idea is that This margin of 24 dB can be simply lost if there is a wall or two or three walls in the middle Which is why the link margin has to be that much So that's first part of the maths the second part of the maths, which is this that At that setting we were able to get about 35 kilobits per second on LoRa Which is too high The human voice needs 8,000 samples per second for you to be able to listen to the human voice right actually four kilowatts bandwidth with an equest criterion it comes to 4,000 8,000 samples and The Arduino can give you 10 bits per sample that is 80,000 bits per second Which is far more than the 32 kbps that you have here so We have to compress this down to 32 kilobits per second, right? So what we do is we use something called as an adaptive pulse coding modulation. So what you do here is that you actually Just transmit the difference between two samples instead of transmitting the value of each sample And you digitally just keep adding up the differences and then make it back into the mean Waveform again at the other end But even there What happens is that to save the number of bits? You actually the step size that is if you say you know go five up or three down What is five five could be five into two So you have a multiplier which you are always using the steps to calculate the steps the multiplier that itself keeps moving Which is why it's called adaptive differential pulse code modulation. It's not only differential, but the difference Which is you know counted in the number of pulses is itself a dynamically varying thing There's still a work in progress as the demonstration will show you the voice is not still very clear But you know, this is the hard part. This is really the hard part. A codec usually takes a couple of years to stabilize I was maintaining the arm port of speaks codec and It took me about six months to stabilize it codecs are really hard to do because there is no objective criterion The waveform which goes in and the waveform which comes out are completely different So you can't you know, just take the pictures and compare them to each other It's a human intelligibility which has to be done It's like watching somebody's face and going and redrawing it somewhere else, right Based on five variables. Say, you know noses big eyes are short, you know, no hair So you if it's not the same person then it's not the same person. So voice coding is very difficult Which is why I've said that's still work in progress and This is actually as simple as the hardware gets which is you have an Arduino And you have these two amplifiers the LM386. They are the most commonly used audio amplifiers among Hackers and makers etc. They cost about 10 rupees or 15 rupees each and You use one to amplify the mic to the point where it can be digitized by the Arduino and What you do for the output is that there is no analog output on the Arduino, right? so what you do is you take one pin and you make it go up and down and the up to down cycle you Control in such a way that the average Works out to anywhere between zero and five volts I mean if it's on all the time, it's five volts if it's off all the time It's zero volts if it is on for half the time and off for half the time It's 2.5 volts average. So what you do is you basically charge this capacitor through a resistor and it keeps going up and down like this Yeah You get a waveform being produced by that so And we're using an Arduino because Arduino cost only 200 rupees to buy right 150 rupees actually So this is the entire circuit diagram of what we have to put together Most of this stuff is actually available in Chandni Chowk, right and you can buy this entire stuff for 500 rupees And put this thing in there together the Arduino is about 200 rupees The lower module is another 200 rupees and 50 rupees each for one of these I mean two of these are audio amplifiers and you're done So now the thing is that the Arduino has only two kilobytes of RAM We are not talking of two megabytes or gigabytes, but 2,000 bytes. That's all Can I get some water please? right So what we have to do is As the audio is coming in now the the key thing about Implementing wipe and such a small footprint is that from the mic You are 8,000 times digitizing something right and you have to keep Compressing it and keep shutting it out as well, right on the other hand there's stuff coming in from The radio which you need to keep playing back to the speaker as well So you're at least doing four or five things at once And there's no multitasking because there's no operating system and this is not Even a 16 bit processor. It's an 8 bit processor the processor That you know went out of fashion in the 1970s, but you're stuck with it. So What you have to and and there is no memory also so The total memory is 2,000 bytes and you are getting 8,000 samples per second So you can't even hold them with you, right? So what you have to do is One packet of sound has to go out Almost every 50 milliseconds, right? Less than 50 every 25 milliseconds. You should finish up with whatever you have so 25 milliseconds is 200 Samples 200 samples have to be shipped out before you can make space to get any more in So what you do is you implement this thing called a circle of upper Where as the packets are coming in as the samples are coming in they're just being written into some memory locations which wraps around and there's another pointer So they are being written by the head and the tail keeps picking them back again So there are two pointers which are sort of dog chasing its own tail all around it and you just keep picking these up And you you cannot wait for long So you basically keep shutting things out you do this both on receive as well as transmit Right, and you only have 16 megahertz of CPU speed. It's not in gigahertz. It's in megahertz, right 16,000 16 million instructions per second and 8 bits now about Jamming so here we use a combination of analog and Digital techniques now the analog technique is very simple. Somebody jams your on one frequency You just go off to another frequency. You just dial out another frequency, right? So that's actually a simple thing to do or you say that you know, let's meet on so and so frequency This is what we hams do you always get on a particular frequency But what happens here is That these frequencies are spread out so huge That it's impossible for anyone to jam Let me just see if I have a picture of that Okay, I'll I'll I'll come to it the pictures Dropped it somewhere the other thing that you could also do with a lower module is you can actually do frequency hopping That is you can actually rapidly change frequency From one packet to another that is you transmit one on frequency a you go to frequency x for the second come back to frequency j then frequency k etc But to do that both the sides have to you know jump and sink, right? So how do you sink that up is a question and the way you do that is actually By sinking the clocks of both the sides together and one way simple way of doing it is to use GPS module Not for positioning but to get your clock right because the GPS Also transmits a clock signal, which is the one of the most accurate clock Signals possible in the world because it's based on cesium clocks, which are flying on those satellites So you just take that and sink the clocks on both the Freeman radios that you have and then you can keep jumping in Sync and others will not be able to intercept you So if you do that, that's another 400 rupees a GPS if you would like to discipline do the GPS discipline Okay, then we come to encryption. So the the the uncrackable Encryption is not public private key encryption But but private key encryption that is, you know, both of us have one secret We say, okay now we'd like to speak secretly and then Both of us key in the same Key on both ends and everything is encrypted, right now for that AES is actually the most powerful encryption system it uses 256 bits But this is too expensive for the Arduino and I will talk about what to do when you run out of speed on the Arduino One way is to offload this To a Raspberry Pi or a PC that is you use this Freeman only as a modem connected to a PC and Do the encryption on the PC but the PC itself can be Compromise that can be keyloggers then there can be you know Things which are in the background monitoring your speaker and mic etc. So it's a little difficult to do that This was the defense Department of Defense US encryption standard for a very long time But it's no longer secure what happens with most of these encryption things is that you make It's so difficult to try out various combinations that you sort of lose track I mean you cannot do it in real time It might take you months to actually find out what the message was by trying out various keys If you remember the movie on Alan Turing There this these machines which keep on trying various things, right? So what happens is you come out with one encryption standard and after a couple of years the computers become so powerful that they can Crack it then you do something more complex. So this is crackable Not crackable by people in India, but you know the Freeman is supposed to be universally applicable solutions So you're not talking about Indian context here at all or Freeman could even be used by the Indian defense forces In which case, you know, they have to fight with others who have, you know, Chinese and all that who have more You know computing power at their resource One option here is this now what happens is that most of the time we choose passwords Which are based on your nephew's name or your girlfriend's name except I mean this is what we do, right? So they are guessable because most of the time they are text and if they are text then you are just limited to 26 letters That's why, you know, you say please again, you know include Punctuation mark and this and that etc. But even then they are actually guessable. So what you do is you take this password and Take an md5 checksum Which is a 40-bit thing. So whatever your password is even if it's a hello one two three you put it into that then you get an md5 Thing you use that as a password or you use that as a key, right on to something called an RC4 There's still a work in progress I have not managed to you know rewrite it and assembly because it has to work in real time on the Arduino You know while it is doing the encryption of your coding and decoding etc. And all the others are going on But this is where some help is required. The other way is to move To a more powerful embedded controller. So there's something called blue pill I don't know how many of you have heard of it, but blue pill is like Arduino But it it runs on an arm processor, which is a 32-bit processor. It's causes about the same but the problem with Blue pill and teen C are firstly they are costly, which is not such a big deal But the more important thing is that they are not universally available The whole idea is to put a solution together that in any city in the world You should be able to go to a hobby electronic market buy this stuff put it together And you have something working, right? That's the whole thing that it should be viral It should be hackable that everybody should have access to this stuff So this is a status now the the communication core has been done We managed to get about almost 4800 bytes per second out of this. We have already created the first Noise on wipe that is, you know, I can completely make out what the other person is saying So you you know, I mean what happens is when we talk about Telephony We are used to Certain levels of service, right? and These levels of service are always changing for example with 4g our voice is much more clearer than it used to be earlier and if you if you remember The a.m. Radio especially I don't know how many of you listen to Binaka Geetmala and Sri Lanka broadcasting corporation. It was far worse, right? but in times of emergency you can afford to relax the Quality of the voice as long as you can communicate intelligibly, right? So that's the whole idea that We should be doing that we have done range tests. It's actually goes up to 25 kilometers So the way we did it is we actually flew One of these on a party balloon Right because it's very small. So you put it with the mercury Thing and you know with the GPS you fly it out. So, you know where it has gone and So it's actually gone far more than 25 kilometers per 25 kilometers clear range And the user interface has to be done. So, you know, we need to still do some parts of it Now the whole idea is usually putting up a tft screen a QoT keyboard will make it extremely expensive one way is to pair it with a pair it with a phone like I've done here and other ways of course To build something, you know, which can input text because you have to be able to input at least your encryption key You have to be able to, you know, input your text messages Somebody else's name be able to chat with it, right? So either use a t9 in which case you can save the number of keys or go for 40 keys There's push buttons or something like that But all that makes it a little difficult to assemble, right as opposed to pairing it with a phone or with a Laptop in which case you can you know work well and everybody has a phone, but the whole idea is it's not Guaranteed to be secure You don't know what the phone is doing, which is why it's you know important to do that So this I have already pushed on to the jithub. So if you can go to jithub.com actually, I forgot to write that a for Han you can actually Download the circuit diagram and the software The software is very badly written right now It's not refactored and made smooth and very readable because I've been hacking at it all the time But this is the latest snapshot, which is there. So it's actually jithub slash a for an slash free man. That is the earlier And you know, that's how you contact me. That's my email address One of the businesses that we run is called hf signals comm which is an open source analog radios and There is also exceed comm we have built to Space missions till now one was launched by SpaceX the other by srow We are the first private space company as well. So there, you know, we have actually a Cube sat up in space Which can digipede meaning it it's a digital repeater of packets of data Which it can repeat but there's short packets 70 bytes and They can be paired with a new walkie-talkie, but you know again It's it's it's a good solution on paper But you should be able to track the satellite the satellite is available only for 20 minutes in a day You know where it is, you know, you should be able to point the see what happens is most of the solutions that we propose We do not look at how practical the solution is for example There's a solution saying you can do Wi-Fi range it will go to 10 kilometers You take a Pringles can and in that you put an antenna and you know it does but it's actually impractical because Both the Pringle cans which are 10 kilometers that we have to point to each other within about one degree accuracy So even a little bit of wind can shake it off, you know if it's raining the thing goes away, etc So you need something which is reliable which works on you know whip antennas or a piece of wire It just works, right? It should have no problems in working at all. So That's actually what we're trying to do here I can take questions if you have and then we'll try seeing if this thing works So two questions So what a little tangential There are hardware encryption check chips, right? Is that too complex? They're very expensive. Where do you get hold of them? Yeah, that's what that's a whole idea. The whole idea is this you should be able to you know put it together on your kitchen table Very interesting presentation first of all and you said the limit the range was 25 kilometers when you flew a balloon But what happens when you're communicating on the ground? So which is why 10 kilometers, right? So what happens is you are in the middle of Trees etc now the first thing is we are at 433 megahertz. So the trees and rain, etc Do not actually you know attenuate the signal as much, right? And we still have a link margin of 24 db over That range, right? So I can actually increase the because what happens is beyond a particular time the line of sight goes away Meaning the curvature of earth comes into space and you know other stuff happen actually cities for 433 megahertz actually better than let's say a forest because These waves will bounce off the buildings and you know get around Right the buildings are almost like mirror to 433 megahertz That's what's very wonderful about this frequency that it actually bounces off the buildings and it spreads all over So the but the range, you know, don't expect more than about five kilometers in an urban Place right but there can be software layer as you know We were talking about it on top of it which can sort of repeat the message Especially if it's encrypted then it doesn't matter who's repeating it, right? So you have a hop count saying okay to repeat for five hops and then it'll die off after that