1 00:00:00,000 --> 00:00:03,800 Travis Goodspeed is a very well-known man, and I really think he needs no introduction, 2 00:00:04,000 --> 00:00:06,020 but because I get to stand here and do it anyway, I'm gonna. 3 00:00:06,480 --> 00:00:10,100 I've been a big fan of his ever since his neighborly belt buckle, to be quite honest, 4 00:00:10,240 --> 00:00:15,540 and just keeps going into the crazier and crazier stuff from random replay attacks on unknown radios 5 00:00:15,540 --> 00:00:19,700 to packet-and-packet technology, and apparently today we're talking about Matruska dolls. 6 00:00:19,980 --> 00:00:23,080 So, everybody give Travis a big welcome and enjoy. 7 00:00:30,140 --> 00:00:32,220 Is there a release for this, or is it just the tape? 8 00:00:32,380 --> 00:00:33,180 No, just the tape. 9 00:00:35,240 --> 00:00:37,540 Cool, now I get to run around and do the gangster rapper thing. 10 00:00:38,640 --> 00:00:43,340 So, like any gangster rapper, I need to do a shout-out to my homies. 11 00:00:43,860 --> 00:00:46,660 Has anyone read A Cannicle for Leibovitz? 12 00:00:48,160 --> 00:00:49,600 Right, right, two of you. 13 00:00:49,700 --> 00:00:54,660 Okay, so only two of you in the audience have read the greatest work of science fiction ever written, 14 00:00:54,760 --> 00:00:57,560 or the greatest religious book ever written by an atheist. 15 00:00:59,240 --> 00:00:59,980 A perfect... 16 00:01:00,000 --> 00:01:04,220 Protocol for Leibovitz is about the blessed St. Leibovitz of Utah, 17 00:01:06,000 --> 00:01:12,700 who, shortly after a nuclear holocaust, he was, before the bombs started falling, 18 00:01:13,250 --> 00:01:15,500 he was a Jewish electrical engineer. 19 00:01:16,120 --> 00:01:20,760 After the bombs fell, people got really weird and they started burning books. 20 00:01:21,520 --> 00:01:26,320 So, what he did was he joined the Catholic Church and he founded an abbey, 21 00:01:26,980 --> 00:01:28,220 the Abbey of St. Leibovitz. 22 00:01:28,220 --> 00:01:36,640 And this little abbey was, he created like an order of monks and he designed them into two parts. 23 00:01:36,860 --> 00:01:44,580 The first part were the memorizers, and it was their job to remember as much of the meaning of the books as possible, 24 00:01:44,720 --> 00:01:51,660 and of, like, science and technology and literature and those sorts of things as they could. 25 00:01:51,760 --> 00:01:55,020 They're like the book people from Fahrenheit 451. 26 00:01:55,780 --> 00:01:58,200 The other group were the... 27 00:01:58,220 --> 00:02:01,860 The book-leggers, and it was their job to drive out into the desert 28 00:02:01,860 --> 00:02:06,060 and to bury oil drums filled with physical artifacts of books, 29 00:02:06,760 --> 00:02:09,200 the positions of which were memorized by the memorizers. 30 00:02:09,600 --> 00:02:12,640 So, when the memorizers weren't, like, violently killed by the peasants, 31 00:02:12,760 --> 00:02:16,160 they would know that, you know, in a few hundred years they could go out 32 00:02:16,160 --> 00:02:18,540 and dig the books up and rebuild civilization. 33 00:02:20,360 --> 00:02:22,100 The book is in three parts. 34 00:02:22,260 --> 00:02:26,280 It walks all the way from the rediscovery of... 35 00:02:26,280 --> 00:02:33,220 of writing itself to the rediscovery of the light bulb in its second part. 36 00:02:33,480 --> 00:02:36,560 And then in the third part, there are starships again. 37 00:02:38,000 --> 00:02:41,580 And I won't spoil the ending, but a bunch of bombs fall and a bunch of people die. 38 00:02:42,420 --> 00:02:47,360 It was, like, a very good time for the carrion eaters. 39 00:02:47,620 --> 00:02:53,560 So, Sergey and I were talking about this book, and we were also talking about radio. 40 00:02:54,160 --> 00:02:55,620 Sergey and I started working together. 41 00:02:56,280 --> 00:03:03,320 When he got me blind drunk at Recon, and the next day I missed my flight, 42 00:03:03,440 --> 00:03:06,700 and I had to hitchhike back to the United States of America with him. 43 00:03:07,000 --> 00:03:11,040 And while we're, like, waiting in line for customs, 44 00:03:11,280 --> 00:03:14,820 he tells me that I agreed to be part of a wireless fingerprinting project. 45 00:03:17,920 --> 00:03:22,040 It seemed like a bad time to say no, so we continued with that. 46 00:03:22,140 --> 00:03:25,760 This resulted in an attack called Packet-in-Packet 47 00:03:25,760 --> 00:03:30,720 that allows you to remotely inject a Level 1 wireless frame 48 00:03:31,610 --> 00:03:34,640 if you control Layer 7 data without a software bug. 49 00:03:34,860 --> 00:03:42,120 It's a protocol bug in the way that noise damages a packet. 50 00:03:45,020 --> 00:03:50,520 So, when you think of a radio, we sometimes think of a parser. 51 00:03:51,600 --> 00:03:54,220 Right? The receiver is a parser. 52 00:03:54,240 --> 00:03:55,240 It's parsing the signal. 53 00:03:55,760 --> 00:04:00,720 But it's different from the parsers that you work with in computer science 54 00:04:00,720 --> 00:04:06,520 in that a radio receiver is dealing with a noisy signal. 55 00:04:09,160 --> 00:04:13,180 Very few other places in computer science deal with damage 56 00:04:13,760 --> 00:04:17,800 because we do everything in our power to abstract that away. 57 00:04:18,120 --> 00:04:22,900 So, we do packet retransmissions to pretend that our sockets never lose anything. 58 00:04:22,900 --> 00:04:26,100 So that if you're programming at a higher level, 59 00:04:26,200 --> 00:04:27,120 you never know that it happened. 60 00:04:27,340 --> 00:04:30,360 Our hard disks automatically identify damaged regions 61 00:04:30,900 --> 00:04:32,420 and move data to other regions. 62 00:04:32,580 --> 00:04:33,940 So, it looks like they're perfect. 63 00:04:36,320 --> 00:04:38,880 But this damage still happens under the hood. 64 00:04:39,380 --> 00:04:43,540 And in the same way that you can have parser bugs in software, 65 00:04:43,760 --> 00:04:46,280 you can have parser bugs in hardware or in radio. 66 00:04:49,640 --> 00:04:54,080 And the assumption was that because these machines were so simple, 67 00:04:54,280 --> 00:04:55,840 there wasn't anything you could do with them. 68 00:04:56,220 --> 00:04:58,440 Like, usually when you're trying to exploit a parser, 69 00:04:58,560 --> 00:05:01,040 you're trying to get native code execution. 70 00:05:01,800 --> 00:05:04,380 But there's this other style of security called LangSec 71 00:05:04,380 --> 00:05:07,500 started by Len Sassman and Meredith Patterson. 72 00:05:07,740 --> 00:05:10,900 And in this style, you don't need memory corruption. 73 00:05:11,340 --> 00:05:15,000 All you need is a difference of opinion as to the meaning of the signal. 74 00:05:15,520 --> 00:05:18,320 One of the earliest examples of this was an X.509 certificate 75 00:05:18,820 --> 00:05:21,900 that had a null byte in the Pascal string. 76 00:05:22,680 --> 00:05:25,700 Now, a Pascal string has a length and then that many bytes. 77 00:05:26,440 --> 00:05:29,400 And this is valid for the host name in an X.509 certificate. 78 00:05:31,140 --> 00:05:35,820 But in C, the string ends in the first null byte. 79 00:05:36,360 --> 00:05:40,080 So, if you put a null byte into a domain name in a certificate, 80 00:05:40,320 --> 00:05:43,420 there was a point in time in which some certificate parsers 81 00:05:43,420 --> 00:05:44,980 would think that this was a null byte 82 00:05:45,000 --> 00:05:46,640 and that the string ended on that null byte. 83 00:05:46,820 --> 00:05:48,800 And others would see the full thing. 84 00:05:49,120 --> 00:05:51,400 So, you could create a... 85 00:05:52,280 --> 00:05:57,540 You could purchase a certificate for Microsoft.com, 86 00:05:57,620 --> 00:05:59,180 nullbyte.travisgoodspeed.com. 87 00:06:00,640 --> 00:06:02,600 And to the Pascal string ones, 88 00:06:02,720 --> 00:06:04,100 I can prove that I own that domain. 89 00:06:04,360 --> 00:06:06,300 And to the C ones, 90 00:06:07,100 --> 00:06:10,160 I can prove that I have a signed certificate from Microsoft.com. 91 00:06:11,000 --> 00:06:12,540 This no longer works, of course. 92 00:06:12,640 --> 00:06:13,380 This was... 93 00:06:15,000 --> 00:06:15,820 fixed a while back. 94 00:06:16,040 --> 00:06:18,900 I think Moxie Marlinspike and Len Sassbin 95 00:06:18,900 --> 00:06:19,820 separately discovered this. 96 00:06:20,040 --> 00:06:22,420 But the idea here... 97 00:06:22,980 --> 00:06:25,660 The overarching idea is that this difference of opinion 98 00:06:25,660 --> 00:06:27,260 is something that we should pay attention to 99 00:06:27,260 --> 00:06:29,480 because you can get exploits out of it. 100 00:06:31,720 --> 00:06:37,020 So, these parser differentials are exploitable. 101 00:06:37,860 --> 00:06:40,480 We're just not talking memory, corruption, 102 00:06:41,800 --> 00:06:43,280 code execution exploits here. 103 00:06:43,280 --> 00:06:45,220 Like, the world is a larger place. 104 00:06:46,460 --> 00:06:46,980 Um... 105 00:06:47,980 --> 00:06:50,320 This sort of bug was also responsible 106 00:06:50,320 --> 00:06:51,600 for the Android master key. 107 00:06:53,060 --> 00:06:54,100 Zip files... 108 00:06:54,100 --> 00:06:55,300 Hey, come on in. 109 00:06:56,240 --> 00:06:59,480 So, zip files were originally intended 110 00:07:00,240 --> 00:07:02,540 for use on, like, tape archives. 111 00:07:03,540 --> 00:07:05,020 So, in a zip file, 112 00:07:05,260 --> 00:07:07,580 the index is actually at the end. 113 00:07:08,640 --> 00:07:11,340 So, a zip file is read from the end of the file backward. 114 00:07:11,340 --> 00:07:14,360 Um, if you make a small zip file 115 00:07:14,360 --> 00:07:16,540 and you just append that to a PDF file, 116 00:07:16,740 --> 00:07:18,520 you have, like, a valid polyglot 117 00:07:18,520 --> 00:07:20,240 that's both a zip file and a PDF file. 118 00:07:22,280 --> 00:07:24,540 But another reason for this 119 00:07:24,540 --> 00:07:26,160 was that, you know, you've got your file. 120 00:07:26,460 --> 00:07:27,420 It's very large. 121 00:07:27,560 --> 00:07:29,360 It's spread out over multiple floppy disks 122 00:07:29,360 --> 00:07:31,620 or, like, a long stretch of tape. 123 00:07:32,240 --> 00:07:34,760 And you want to update one file in it. 124 00:07:35,660 --> 00:07:37,600 Well, in the zip file format, this was thought of. 125 00:07:37,780 --> 00:07:39,660 There's no need to rewrite the entire file. 126 00:07:39,760 --> 00:07:40,580 You don't have enough storage. 127 00:07:41,340 --> 00:07:44,260 So what you do is you just append your new file 128 00:07:44,260 --> 00:07:45,860 and then a new index at the end, 129 00:07:45,960 --> 00:07:48,000 and you happen to have a garbage index in the middle, 130 00:07:49,100 --> 00:07:51,260 and you happen to have two copies of the file, 131 00:07:51,400 --> 00:07:54,160 but you've saved time because you've not had to insert 132 00:07:54,160 --> 00:07:55,580 and remove 26 floppy disks 133 00:07:57,020 --> 00:07:59,540 or waited for the tape to rewrite itself. 134 00:08:00,080 --> 00:08:01,760 So the Android master key bug 135 00:08:02,220 --> 00:08:04,720 was that you could actually have two copies of the same file, 136 00:08:06,160 --> 00:08:08,520 and the way that Android would work 137 00:08:08,520 --> 00:08:10,820 is that it would validate that every file 138 00:08:10,820 --> 00:08:12,160 had been properly signed, 139 00:08:12,760 --> 00:08:14,720 and then it would extract the files. 140 00:08:16,200 --> 00:08:18,540 But the validator and the extractor 141 00:08:18,540 --> 00:08:20,820 saw different versions of the same file. 142 00:08:20,980 --> 00:08:23,220 One of them would always look at the first copy, 143 00:08:23,320 --> 00:08:25,160 and the other would always look at the second copy. 144 00:08:25,720 --> 00:08:29,620 So you include one copy of the Angry Birds thing 145 00:08:29,620 --> 00:08:31,040 that is properly signed 146 00:08:31,040 --> 00:08:34,520 by the Dumejahiki ThreatBot people, 147 00:08:34,660 --> 00:08:37,920 and then you have another version that's backdoored, 148 00:08:38,980 --> 00:08:40,740 and the validator sees 149 00:08:40,820 --> 00:08:42,340 that the signature is correct for the first, 150 00:08:42,480 --> 00:08:43,640 and then it installs the second. 151 00:08:45,360 --> 00:08:46,860 These are useful. 152 00:08:47,240 --> 00:08:49,680 So we started playing around with this 153 00:08:49,680 --> 00:08:54,260 in Zigbee and in Wi-Fi, 154 00:08:54,320 --> 00:08:56,760 and we started looking for, like, 155 00:08:56,760 --> 00:08:59,400 what the good target was. 156 00:08:59,920 --> 00:09:01,620 And the good target that we found 157 00:09:01,620 --> 00:09:02,880 is the start of frame delimiter. 158 00:09:03,460 --> 00:09:05,760 So we did a trick called packet-in-packet. 159 00:09:07,840 --> 00:09:09,340 In packet-in-packet, 160 00:09:09,340 --> 00:09:14,320 you assume that as the wireless packet goes out in the air, 161 00:09:14,440 --> 00:09:15,440 you control layer seven. 162 00:09:15,880 --> 00:09:20,380 And if you remember the silly little OSI model fiction thing, 163 00:09:20,780 --> 00:09:22,140 fairy tales have their purpose, right? 164 00:09:22,300 --> 00:09:24,520 So at layer seven, 165 00:09:24,600 --> 00:09:25,880 you have, like, the application data. 166 00:09:25,960 --> 00:09:26,760 That's the cat picture. 167 00:09:27,720 --> 00:09:29,960 Generally, your phone will trust me 168 00:09:29,960 --> 00:09:31,140 to send it a cat picture. 169 00:09:31,520 --> 00:09:35,820 It won't trust me to allow you to send a random packet. 170 00:09:36,000 --> 00:09:38,420 It won't allow me to write anything at the low level, 171 00:09:38,420 --> 00:09:39,880 and we're assuming that I have no radio. 172 00:09:40,780 --> 00:09:42,700 But I can send, like, the layer seven data. 173 00:09:42,940 --> 00:09:43,920 So in doing that, 174 00:09:44,060 --> 00:09:49,120 we realized that the collision avoidance 175 00:09:50,240 --> 00:09:52,760 in 2.4 gigahertz wireless protocols 176 00:09:52,760 --> 00:09:54,880 is almost nonfunctional. 177 00:09:56,400 --> 00:09:56,920 So... 178 00:09:56,920 --> 00:09:59,420 And this exists for physical reasons 179 00:09:59,420 --> 00:10:00,640 as well as for protocol reasons. 180 00:10:03,820 --> 00:10:06,060 The first is that these protocols 181 00:10:06,060 --> 00:10:07,440 don't avoid each other. 182 00:10:07,440 --> 00:10:09,760 So Wi-Fi is based on the principle 183 00:10:09,760 --> 00:10:11,440 that you politely ask to speak, 184 00:10:11,640 --> 00:10:13,620 and then you give a very long message. 185 00:10:13,700 --> 00:10:15,300 That's what I'm doing right here to you, right? 186 00:10:15,400 --> 00:10:18,620 So I've asked for permission to take an hour of your time. 187 00:10:19,880 --> 00:10:20,740 Hopefully, afterward, 188 00:10:20,840 --> 00:10:22,220 you'll think that that hour is worth it. 189 00:10:22,280 --> 00:10:23,940 But you won't interrupt me 190 00:10:23,940 --> 00:10:26,000 until I've finished the transmission. 191 00:10:27,360 --> 00:10:29,220 You might walk out, but you won't interrupt me. 192 00:10:29,580 --> 00:10:33,260 Wi-Fi is more like a casual conversation 193 00:10:33,260 --> 00:10:36,720 with an overactive 14-year-old in the... 194 00:10:36,720 --> 00:10:37,760 Sorry, Bluetooth is more like 195 00:10:37,760 --> 00:10:40,060 an overactive conversation with a 14-year-old 196 00:10:40,060 --> 00:10:42,560 in that the different radios 197 00:10:42,560 --> 00:10:44,080 just interrupt each other all the time, 198 00:10:44,520 --> 00:10:47,340 and they repeat the same thing so many times 199 00:10:47,340 --> 00:10:49,760 that one of them is guaranteed to get through. 200 00:10:51,100 --> 00:10:53,860 And they have immediate acknowledgments. 201 00:10:53,880 --> 00:10:55,400 It's like, can I have my allowance? No. 202 00:10:55,500 --> 00:10:57,040 Can I have my allowance? No. Right? 203 00:10:57,140 --> 00:11:00,260 And this, like, bounce back works very well 204 00:11:02,000 --> 00:11:05,720 for avoiding serious congestion. 205 00:11:06,720 --> 00:11:07,700 And at the same time, 206 00:11:07,700 --> 00:11:09,540 asking permission to do a long transmission 207 00:11:09,540 --> 00:11:10,240 asks very well, 208 00:11:11,160 --> 00:11:12,560 unless you combine the two, 209 00:11:12,720 --> 00:11:14,940 in which case, as I'm giving a lecture, 210 00:11:15,100 --> 00:11:17,180 someone's bouncing up and down and saying, 211 00:11:17,360 --> 00:11:18,540 hey, hey, can I have my allowance? 212 00:11:18,640 --> 00:11:19,700 Can I have my allowance? Can I have my allowance? 213 00:11:19,800 --> 00:11:22,660 And that, like, breaks the flow of things, right? 214 00:11:24,000 --> 00:11:27,320 So what we found was that because these collide, 215 00:11:28,880 --> 00:11:30,960 there is damage to the encapsulation. 216 00:11:31,800 --> 00:11:35,580 So a ZigBee packet begins with 00A7. 217 00:11:35,580 --> 00:11:37,600 This is the start of frame delimiter. 218 00:11:38,460 --> 00:11:40,560 In Ethernet, we would call this a sync field. 219 00:11:42,060 --> 00:11:44,080 In Wi-Fi, it's a little bit more complicated 220 00:11:44,080 --> 00:11:46,200 because you've got, like, a prepacket and a real packet, 221 00:11:46,360 --> 00:11:48,060 but that's a different lecture. 222 00:11:49,120 --> 00:11:51,200 In ZigBee, though, 00A7. 223 00:11:51,460 --> 00:11:55,880 So if you damage that 00A7 224 00:11:55,880 --> 00:11:57,360 at the beginning of the real packet, 225 00:11:57,920 --> 00:12:00,640 then the receiver thinks it's listening to background noise. 226 00:12:01,840 --> 00:12:04,960 And if the attacker controlling layer 7 227 00:12:06,260 --> 00:12:09,500 inserts 00A7 and a valid packet with a valid checksum, 228 00:12:10,020 --> 00:12:13,200 the receiver, which is in the state of being in background noise, 229 00:12:13,400 --> 00:12:15,700 will accept that packet and will forward it up the stack. 230 00:12:17,720 --> 00:12:20,440 This allows you to remotely inject a layer 1 frame 231 00:12:20,440 --> 00:12:23,660 controlling only layer 7 data and without owning a radio. 232 00:12:26,240 --> 00:12:27,680 There are other ways of doing it. 233 00:12:27,740 --> 00:12:31,020 In the International Journal of Proof of Concept or Get the Fuck Out, 234 00:12:31,160 --> 00:12:35,340 we presented a version in which not a single byte 235 00:12:35,580 --> 00:12:36,700 is in common, 236 00:12:37,430 --> 00:12:40,500 because we create a string that, 237 00:12:40,580 --> 00:12:43,800 when viewed one nibble off, 238 00:12:46,240 --> 00:12:46,900 becomes... 239 00:12:47,530 --> 00:12:49,420 Sorry, one eighth of one nibble off 240 00:12:50,310 --> 00:12:53,240 becomes the valid attack string. 241 00:12:54,440 --> 00:12:56,100 This paper is called 242 00:12:57,320 --> 00:13:00,400 Defense Mitigation Bypass for Packet-in-Packet, 243 00:13:00,460 --> 00:13:03,880 or I burned ODE to use the phrase 244 00:13:03,880 --> 00:13:05,120 eighth of a nibble in a paper. 245 00:13:08,660 --> 00:13:12,920 So what we'd like to do here is a little bit different. 246 00:13:14,080 --> 00:13:16,000 Here we're talking about ham radio. 247 00:13:17,480 --> 00:13:21,840 In the leave of its paper that'll be available here 248 00:13:21,840 --> 00:13:24,400 and at the No Starch Press booth 249 00:13:24,400 --> 00:13:25,800 and a few other places this afternoon, 250 00:13:26,540 --> 00:13:30,080 we set up this elaborate story of Alice and Bob 251 00:13:30,080 --> 00:13:34,060 trying to smuggle data across the U.S.-Canadian border. 252 00:13:34,400 --> 00:13:34,920 Right? 253 00:13:35,580 --> 00:13:36,900 So Christopher Segoyan 254 00:13:37,660 --> 00:13:39,380 becomes dictator of the United States 255 00:13:39,380 --> 00:13:40,420 and he outlaws ODE. 256 00:13:40,880 --> 00:13:44,240 The Canadians would like to share some literature with us, 257 00:13:44,320 --> 00:13:46,000 but it's illegal to import it. 258 00:13:46,180 --> 00:13:48,740 So you gotta, like, sneak it across the border, right? 259 00:13:49,160 --> 00:13:52,820 So ham radio really shouldn't be used for doing this 260 00:13:52,820 --> 00:13:54,540 until there's an evil dictatorship. 261 00:13:55,880 --> 00:13:58,360 But as long as you don't use cryptography 262 00:13:58,360 --> 00:14:02,300 and as long as you're not, like, intentionally obfuscating it 263 00:14:02,300 --> 00:14:05,300 to, like, hide the meaning of the signal, 264 00:14:06,320 --> 00:14:09,160 it's completely legitimate to play around with the protocols 265 00:14:09,160 --> 00:14:10,840 that would allow you to do such things 266 00:14:10,840 --> 00:14:12,640 if you flipped two switches. 267 00:14:14,220 --> 00:14:17,140 So what we propose is that you treat this as sort of like a game 268 00:14:17,140 --> 00:14:21,520 and then you start creating signals for your friends 269 00:14:21,520 --> 00:14:24,120 and then swapping them back and forth 270 00:14:24,120 --> 00:14:25,620 and playing around with reverse engineering them. 271 00:14:26,060 --> 00:14:27,860 And in doing it that way, you know, 272 00:14:27,880 --> 00:14:30,180 you're, like, sticking to the spirit of ham radio 273 00:14:30,720 --> 00:14:33,360 and the spirit of exploration, 274 00:14:33,620 --> 00:14:35,280 of, like, trying new things out. 275 00:14:40,520 --> 00:14:42,500 So part of this is steganography 276 00:14:42,500 --> 00:14:44,720 in that you're trying to hide that you have a second message. 277 00:14:45,540 --> 00:14:49,320 But we're not doing it in a style focusing on steganography. 278 00:14:49,400 --> 00:14:53,560 We're doing it in a style focusing on weird signals. 279 00:14:53,800 --> 00:14:55,460 So, like, one of the things that I'll show you 280 00:14:55,460 --> 00:15:00,520 is a polyglot that is valid as both Morse code and as PSK31. 281 00:15:01,900 --> 00:15:05,260 Because in Morse code, your channel is so wide 282 00:15:05,280 --> 00:15:07,540 that if it wobbles a little bit, 283 00:15:08,200 --> 00:15:10,300 the receiver still knows what's going on. 284 00:15:10,400 --> 00:15:15,060 Like, that your tone is 60 hertz wide 285 00:15:15,060 --> 00:15:18,660 instead of 1 hertz wide doesn't matter 286 00:15:19,170 --> 00:15:21,540 because the older transmitters weren't that stable anyways. 287 00:15:23,420 --> 00:15:25,920 So the idea here is that you can, like, 288 00:15:25,940 --> 00:15:30,680 smuggle your traffic on the back of an older signal. 289 00:15:32,880 --> 00:15:35,260 So how do you actually, like, create a radio signal? 290 00:15:35,280 --> 00:15:38,720 Like, we don't want to just do 291 00:15:42,220 --> 00:15:47,040 protocol checks that might be found. 292 00:15:47,220 --> 00:15:49,800 Or, like, when you do, you want them to be in a clever way. 293 00:15:50,680 --> 00:15:52,440 Like, in image steganography, 294 00:15:52,680 --> 00:15:56,340 there's this issue where there are all sorts of false assumptions. 295 00:15:57,480 --> 00:16:00,340 My favorite is the false assumption 296 00:16:00,340 --> 00:16:03,220 that the least significant bit of an image is random. 297 00:16:03,220 --> 00:16:06,620 You can actually take a picture 298 00:16:06,620 --> 00:16:09,980 and try this yourself if you like image steganography. 299 00:16:10,140 --> 00:16:12,240 Take just a regular photograph 300 00:16:12,900 --> 00:16:15,100 and then, with Python or whatever, 301 00:16:16,120 --> 00:16:18,820 select only the least significant bit 302 00:16:18,820 --> 00:16:20,300 and draw that in black and white. 303 00:16:20,700 --> 00:16:23,480 And you'll actually see an outline of the picture itself 304 00:16:23,480 --> 00:16:25,280 because the less significant bits get biased. 305 00:16:26,760 --> 00:16:29,080 The analog-to-digital converters are not perfect. 306 00:16:30,780 --> 00:16:33,200 So every receiver is built for a specific reason. 307 00:16:33,200 --> 00:16:34,560 There's a certain modulation, right? 308 00:16:34,920 --> 00:16:37,520 But it also has to ignore noise. 309 00:16:37,940 --> 00:16:43,000 So it ignores, like, the other styles of modulation 310 00:16:43,000 --> 00:16:45,300 if they're orthogonal to the original. 311 00:16:45,440 --> 00:16:49,140 Like, if the receiver knows 312 00:16:49,140 --> 00:16:52,900 that the signal is encoded in a phase change, 313 00:16:53,280 --> 00:16:56,820 it generally ignores a change in amplitude, 314 00:16:57,940 --> 00:17:00,360 especially if you do the change in amplitude slowly 315 00:17:00,360 --> 00:17:01,820 or at an expected time. 316 00:17:04,060 --> 00:17:06,360 You can also do tricks with error correction. 317 00:17:06,700 --> 00:17:09,760 There was a talk on ham radio steganography 318 00:17:09,760 --> 00:17:12,420 here at DEF CON last year by some folks from Boston. 319 00:17:13,120 --> 00:17:14,820 And they flipped... 320 00:17:15,360 --> 00:17:16,120 Oh, howdy, guys. 321 00:17:16,920 --> 00:17:18,000 We should grab a beer later. 322 00:17:19,320 --> 00:17:22,600 So what they did was they flipped the error correction bits 323 00:17:22,600 --> 00:17:26,880 of a very strongly error-corrected signal, 324 00:17:26,940 --> 00:17:29,900 one that was intended for, like, weak signals 325 00:17:29,900 --> 00:17:31,460 or moon bounce or things like that. 326 00:17:31,820 --> 00:17:35,340 And they figured out which ones were safest to change 327 00:17:35,340 --> 00:17:38,100 in order to cause the received signal 328 00:17:38,100 --> 00:17:41,240 through error correction to produce the clear text signal 329 00:17:41,240 --> 00:17:43,600 while leaving, like, the ciphertext signal 330 00:17:43,600 --> 00:17:45,360 in the corrected bits. 331 00:17:46,080 --> 00:17:47,740 So error correction helps you. 332 00:17:48,140 --> 00:17:50,100 There's also encoding, 333 00:17:50,400 --> 00:17:53,660 which for ham radio is very loose and forgiving. 334 00:17:54,960 --> 00:17:55,960 Postel's principle, 335 00:17:56,140 --> 00:17:58,500 the idea that you should always transmit 336 00:17:58,500 --> 00:18:00,500 perfectly within spec, 337 00:18:00,500 --> 00:18:07,200 but you should receive as liberally as possible. 338 00:18:07,420 --> 00:18:09,120 Like, be conservative in your implementation 339 00:18:09,120 --> 00:18:11,300 and liberal in what you will accept. 340 00:18:12,000 --> 00:18:14,740 This is terrible for security. 341 00:18:16,280 --> 00:18:18,400 But it works out pretty well in ham radio 342 00:18:18,400 --> 00:18:20,160 because in general people are polite. 343 00:18:20,360 --> 00:18:22,280 I mean, except for that one guy on your local repeater 344 00:18:22,280 --> 00:18:23,220 who keeps playing pooping noises. 345 00:18:24,640 --> 00:18:26,500 The, like, things... 346 00:18:28,080 --> 00:18:30,500 Like, my yesu can talk to your baofeng 347 00:18:30,500 --> 00:18:32,140 and there's not that much trouble with it. 348 00:18:33,860 --> 00:18:36,460 So I'm going to quickly review some radio concepts, 349 00:18:36,620 --> 00:18:38,640 and some of those will be, like, lies to children. 350 00:18:39,820 --> 00:18:41,860 But that's how teaching works, 351 00:18:41,960 --> 00:18:44,120 and there's only an hour, so forgive me for that. 352 00:18:47,360 --> 00:18:50,880 You basically have, like, a raw signal, right? 353 00:18:50,940 --> 00:18:54,680 And that is the waveform that goes out over the air. 354 00:18:55,240 --> 00:18:56,480 And you want to put something in there 355 00:18:56,500 --> 00:18:57,820 and put some data on that so you modulate it. 356 00:18:58,120 --> 00:18:59,800 One way to do this is an AM 357 00:18:59,800 --> 00:19:03,100 where you're changing the amplitude. 358 00:19:03,980 --> 00:19:05,400 There are variants of this, 359 00:19:05,520 --> 00:19:07,100 like single sideband modulation, 360 00:19:07,660 --> 00:19:08,920 which are more efficient 361 00:19:09,920 --> 00:19:13,080 or which have some other benefits. 362 00:19:14,160 --> 00:19:17,480 FM, your actual, like, the height of your wave, 363 00:19:17,540 --> 00:19:18,760 your amplitude is staying the same, 364 00:19:18,900 --> 00:19:21,500 but you're scrunching it down and spreading it out. 365 00:19:21,540 --> 00:19:22,940 So your frequency is changing 366 00:19:22,940 --> 00:19:25,360 in order to encode your signal. 367 00:19:28,720 --> 00:19:31,040 There's also this phase thing. 368 00:19:31,520 --> 00:19:34,920 Like, phase-shift keying 369 00:19:35,390 --> 00:19:37,280 I used to describe in lectures 370 00:19:37,280 --> 00:19:39,200 as just this phase-shift thing. 371 00:19:40,000 --> 00:19:41,460 But the general idea, 372 00:19:41,600 --> 00:19:45,820 and this is not really what it would look like on the air 373 00:19:45,820 --> 00:19:47,160 because this change is too abrupt, 374 00:19:48,080 --> 00:19:50,320 but you can imagine it as, like, 375 00:19:50,360 --> 00:19:53,260 a sine abruptly becoming a cosine. 376 00:19:54,140 --> 00:19:56,480 So you're sort of jumping off the plane, 377 00:19:56,500 --> 00:19:57,280 by half of a wave. 378 00:19:58,720 --> 00:20:00,340 If you do it this way, 379 00:20:00,460 --> 00:20:02,820 you get audio and radio artifacts. 380 00:20:03,140 --> 00:20:04,520 It, like, spreads the signal out. 381 00:20:04,760 --> 00:20:06,640 So instead what you do is you sort of 382 00:20:06,640 --> 00:20:08,220 scrunch down the amplitude to nothing 383 00:20:08,220 --> 00:20:09,140 and raise it back up. 384 00:20:10,000 --> 00:20:11,380 And in doing it that way, 385 00:20:13,280 --> 00:20:16,460 the actual changeover point 386 00:20:16,460 --> 00:20:18,540 is when your signal is at the least strength. 387 00:20:19,460 --> 00:20:21,340 So even though you're creating noise, 388 00:20:21,460 --> 00:20:23,000 it's too quiet for anyone to hear. 389 00:20:25,880 --> 00:20:27,960 And then mathematicians look at this, 390 00:20:28,080 --> 00:20:29,380 and they've got, like, 391 00:20:29,400 --> 00:20:31,160 all the fancy symbols and stuff. 392 00:20:32,840 --> 00:20:35,380 But what we sort of want 393 00:20:35,380 --> 00:20:36,980 is, like, Python code 394 00:20:36,980 --> 00:20:38,240 or something that we can play with 395 00:20:38,860 --> 00:20:40,500 that is related to these symbols 396 00:20:40,500 --> 00:20:41,820 but with fewer Greek letters. 397 00:20:44,880 --> 00:20:46,900 The other thing to keep in mind 398 00:20:46,900 --> 00:20:49,540 is this idea of a Fourier transform, 399 00:20:51,280 --> 00:20:52,980 which converts from time to time 400 00:20:53,000 --> 00:20:54,220 domain to frequency domain. 401 00:20:54,460 --> 00:20:55,500 That's what produces 402 00:20:55,500 --> 00:20:57,620 these lovely little waterfall diagrams 403 00:20:57,620 --> 00:21:00,000 in which you can visually see 404 00:21:00,000 --> 00:21:02,000 how much of the spectrum is taken up by the signal. 405 00:21:02,820 --> 00:21:06,120 So a ham thinks about a digital signal 406 00:21:06,120 --> 00:21:08,300 in rather different ways. 407 00:21:08,540 --> 00:21:12,480 And I'm talking here mostly about HF digital radio. 408 00:21:13,500 --> 00:21:16,040 In VHF and UHF and Wi-Fi, 409 00:21:16,160 --> 00:21:18,580 like, as the data rates become faster, 410 00:21:18,720 --> 00:21:20,040 it becomes harder to visualize 411 00:21:20,040 --> 00:21:21,240 what's happening under the hood. 412 00:21:22,340 --> 00:21:25,560 So these tricks might apply to those signals, 413 00:21:25,700 --> 00:21:27,380 but the barrier to entry is very high. 414 00:21:28,620 --> 00:21:32,260 When I implemented 802.11's Scrambler, 415 00:21:33,420 --> 00:21:35,520 I was, like, speaking in tongues for a week. 416 00:21:35,800 --> 00:21:39,260 So dates really don't like it 417 00:21:39,260 --> 00:21:40,440 when you start talking in Verilog. 418 00:21:41,620 --> 00:21:43,020 So upper sideband 419 00:21:44,840 --> 00:21:47,440 has some specific, like, filtering definitions to it. 420 00:21:47,520 --> 00:21:49,040 But the gist is that you're taking 421 00:21:49,040 --> 00:21:50,360 a chunk of spectrum 422 00:21:50,360 --> 00:21:52,480 that's at radio frequencies, 423 00:21:52,680 --> 00:21:54,800 let's say 28.120 megahertz, 424 00:21:54,980 --> 00:21:58,320 and you yank that entire region 425 00:21:58,320 --> 00:22:00,980 down to the audio frequencies 426 00:22:00,980 --> 00:22:02,660 so that you can hear it. 427 00:22:03,640 --> 00:22:06,880 And if you have an audio tone of 1 kilohertz, 428 00:22:07,060 --> 00:22:09,660 that means that the actual radio wave 429 00:22:10,360 --> 00:22:12,260 is 1 kilohertz higher 430 00:22:12,260 --> 00:22:15,860 than the zero point that you've tuned to on your radio. 431 00:22:16,700 --> 00:22:18,520 Is this making sense? 432 00:22:19,880 --> 00:22:22,100 So upper sideband is really cool 433 00:22:22,100 --> 00:22:25,280 because all of this radio problem 434 00:22:25,280 --> 00:22:27,400 suddenly becomes an audio problem. 435 00:22:28,740 --> 00:22:30,260 You run an audio cable 436 00:22:30,260 --> 00:22:34,360 from a 1970s ham radio to a laptop, 437 00:22:34,440 --> 00:22:36,620 and you can receive these digital signals. 438 00:22:37,480 --> 00:22:39,900 At the same time, you can record them on a tape recorder 439 00:22:39,900 --> 00:22:41,720 and play them back, and they're still legible. 440 00:22:44,660 --> 00:22:46,700 Now, FSK and PSK 441 00:22:46,700 --> 00:22:48,180 are whether you're changing the frequency, 442 00:22:48,840 --> 00:22:49,820 or the phase. 443 00:22:50,300 --> 00:22:51,480 If you change the frequency, 444 00:22:51,780 --> 00:22:54,420 you have like a high frequency and a low frequency, 445 00:22:54,500 --> 00:22:55,500 and you just bounce between them. 446 00:22:55,700 --> 00:22:57,880 The high frequency is a 1, the low frequency is a 0. 447 00:22:58,700 --> 00:22:59,680 Phase shift keying, 448 00:23:00,660 --> 00:23:03,340 you are flipping the signal upside down. 449 00:23:03,480 --> 00:23:06,240 So as the wave is going like this, 450 00:23:06,340 --> 00:23:07,880 you just abruptly bounce it off 451 00:23:07,880 --> 00:23:09,920 like the singing bouncing balls 452 00:23:10,480 --> 00:23:12,880 on 30s cartoons, you know, 453 00:23:13,400 --> 00:23:14,500 where it bounces on each word, 454 00:23:14,560 --> 00:23:15,580 and then sometimes it gets stuck 455 00:23:15,580 --> 00:23:16,880 when the words are sung wrong. 456 00:23:18,520 --> 00:23:20,160 And this is very low data rate 457 00:23:20,160 --> 00:23:21,900 because it has to fit into the audio channel. 458 00:23:22,780 --> 00:23:25,240 Another cool thing about it fitting into the audio channel 459 00:23:25,240 --> 00:23:30,000 is that the audio channel digitally 460 00:23:30,520 --> 00:23:33,340 contains a lot more information 461 00:23:33,340 --> 00:23:35,420 than you would use in a voice channel. 462 00:23:36,880 --> 00:23:38,520 So like a conversation 463 00:23:39,300 --> 00:23:42,800 at a normal, not really stressed typing speed 464 00:23:43,360 --> 00:23:45,160 takes about 31 baud. 465 00:23:46,020 --> 00:23:50,380 So PSK31 is 31 and a quarter baud, 466 00:23:50,460 --> 00:23:52,140 baud in symbols per second. 467 00:23:52,420 --> 00:23:56,120 So this is only 60 hertz wide in the spectrum. 468 00:23:56,820 --> 00:24:02,780 You can fit a lot of those into a 1,500 hertz audio channel, 469 00:24:02,880 --> 00:24:04,240 or 2,500 hertz audio channel. 470 00:24:04,420 --> 00:24:07,920 So what you do is you transmit on one frequency, 471 00:24:08,100 --> 00:24:12,000 I transmit 100, 150 hertz higher than that, 472 00:24:12,100 --> 00:24:13,800 and in upper sideband, 473 00:24:13,800 --> 00:24:16,080 these signals just combine, 474 00:24:16,320 --> 00:24:17,440 and then they're both available 475 00:24:17,440 --> 00:24:18,860 and they don't interfere with each other. 476 00:24:19,740 --> 00:24:21,040 And in this way, 477 00:24:21,120 --> 00:24:22,680 you can have a single audio channel 478 00:24:22,680 --> 00:24:24,660 that supports a lot of conversation. 479 00:24:26,380 --> 00:24:30,060 You'll commonly see 15 or 20 conversations 480 00:24:30,060 --> 00:24:31,280 going on at once, 481 00:24:31,420 --> 00:24:33,320 and your computer is powerful enough 482 00:24:33,320 --> 00:24:34,440 to parse out all of them 483 00:24:34,440 --> 00:24:35,560 and show you what everybody is saying. 484 00:24:38,660 --> 00:24:41,060 Upper sideband was initially created 485 00:24:41,060 --> 00:24:42,860 as a response 486 00:24:42,860 --> 00:24:45,720 to the epidemic of band spreading. 487 00:24:48,980 --> 00:24:50,520 In full AM modulation, 488 00:24:51,160 --> 00:24:53,560 you actually send two copies of your signal, 489 00:24:53,680 --> 00:24:55,080 one in the upper sideband 490 00:24:55,080 --> 00:24:56,240 and one in the lower sideband, 491 00:24:56,420 --> 00:24:58,520 and then there's this giant peak in the middle. 492 00:24:58,760 --> 00:25:00,940 And this peak in the middle is very handy 493 00:25:00,940 --> 00:25:05,660 because it tells you where the signal is 494 00:25:05,660 --> 00:25:08,520 if you have a poorly designed or... 495 00:25:08,520 --> 00:25:10,820 if you have poorly designed components in your receiver. 496 00:25:11,520 --> 00:25:12,980 So what you can do is 497 00:25:12,980 --> 00:25:14,400 you can feed this back into itself 498 00:25:15,400 --> 00:25:18,880 and use that to center in on the signal. 499 00:25:19,080 --> 00:25:20,880 This is why when you are in... 500 00:25:21,540 --> 00:25:23,640 like you're driving around in a Studebaker, 501 00:25:23,900 --> 00:25:25,180 you're having a good time, 502 00:25:25,240 --> 00:25:26,060 you got the windows down, 503 00:25:26,320 --> 00:25:29,440 and you're turning the knob on the AM radio, 504 00:25:29,680 --> 00:25:32,000 you don't have to be exactly on the station. 505 00:25:32,800 --> 00:25:33,900 And the reason why 506 00:25:33,900 --> 00:25:35,880 is that you can correct by finding this peak. 507 00:25:37,220 --> 00:25:39,860 But as proper gentleman ham radio operators, 508 00:25:40,820 --> 00:25:42,380 we have much nicer equipment 509 00:25:42,380 --> 00:25:46,080 than anyone at the Crosley Corporation could have imagined. 510 00:25:47,880 --> 00:25:49,460 The Crosley brothers made radios 511 00:25:49,460 --> 00:25:52,280 and one of them would just go through the assembly line 512 00:25:52,700 --> 00:25:54,400 and he had a pair of wire cutters. 513 00:25:54,840 --> 00:25:58,100 And when an engineer was really proud of his design 514 00:25:58,100 --> 00:25:58,560 and he was like, 515 00:25:58,620 --> 00:26:00,460 look, you know, I came up with this great radio, 516 00:26:00,660 --> 00:26:02,040 Crosley would go, oh, cool, 517 00:26:02,640 --> 00:26:03,860 take out his wire cutters 518 00:26:03,860 --> 00:26:04,840 and he would just snip a component. 519 00:26:05,440 --> 00:26:07,520 And if the radio did not break, 520 00:26:08,800 --> 00:26:10,160 he would send the engineer back 521 00:26:10,160 --> 00:26:11,720 to cut off some components and save some money. 522 00:26:13,760 --> 00:26:15,200 So in single sideband modulation, 523 00:26:15,380 --> 00:26:17,540 what you do is you only send this upper half 524 00:26:17,540 --> 00:26:19,060 or you only send the lower half. 525 00:26:20,600 --> 00:26:24,400 And this has the advantage of using half the spectrum. 526 00:26:25,460 --> 00:26:26,920 It also has the advantage 527 00:26:26,920 --> 00:26:29,300 that you're getting more oomph 528 00:26:29,300 --> 00:26:30,560 for the power that you're pushing out. 529 00:26:31,720 --> 00:26:35,780 So this was originally done as, like, a power thing. 530 00:26:37,820 --> 00:26:39,540 So now we're gonna get to the good stuff. 531 00:26:39,540 --> 00:26:41,320 You've got Alice, Bob, and Eve. 532 00:26:42,180 --> 00:26:45,720 Alice is trying to transmit some O'Day to Bob. 533 00:26:48,200 --> 00:26:54,420 Bob lives in the, like, fundamentalist hellhole, right? 534 00:26:55,760 --> 00:26:59,020 And Eve works for the Fairness Communications Commission, 535 00:26:59,180 --> 00:27:00,460 and she's trying to make sure 536 00:27:00,460 --> 00:27:02,660 that net neutrality is maintained at all times. 537 00:27:03,820 --> 00:27:06,840 And she has a special mandate from the ACLU 538 00:27:06,840 --> 00:27:09,520 that no exploits are allowed. 539 00:27:09,520 --> 00:27:11,460 Or articles about exploits 540 00:27:11,460 --> 00:27:12,500 are ever shared over this medium, 541 00:27:13,180 --> 00:27:14,720 because baby killers or something. 542 00:27:14,940 --> 00:27:18,340 So one protocol that they can use 543 00:27:18,340 --> 00:27:21,040 to speak to each other is RTTY. 544 00:27:21,860 --> 00:27:23,020 Over here on the right 545 00:27:23,020 --> 00:27:28,100 is a picture from the second release of PacoGTFO. 546 00:27:28,740 --> 00:27:31,520 This is from a mechanical ticker tape machine. 547 00:27:33,440 --> 00:27:36,340 This is a photograph of the style of the machine. 548 00:27:36,620 --> 00:27:38,160 If any of you were at OHM, 549 00:27:38,160 --> 00:27:40,040 the Dutch hacker camp four years ago, 550 00:27:40,160 --> 00:27:41,780 two years ago, six years ago, 551 00:27:42,620 --> 00:27:44,380 they had two of these, 552 00:27:44,520 --> 00:27:46,320 and they actually ran a cable between them, 553 00:27:46,420 --> 00:27:47,920 and you could send teletype messages 554 00:27:48,740 --> 00:27:50,320 on this sort of ticker tape. 555 00:27:50,480 --> 00:27:53,200 The middle row is just to keep everything centered, 556 00:27:53,340 --> 00:27:56,220 and then you have five dots, 557 00:27:56,380 --> 00:27:57,740 three on one side and two on the other. 558 00:27:57,860 --> 00:28:01,500 These are five bits of the Baudot code. 559 00:28:02,820 --> 00:28:05,200 Now, in a modern style, 560 00:28:05,200 --> 00:28:09,120 I live in a third-world hellhole called Manhattan, 561 00:28:09,420 --> 00:28:12,480 so I can't afford to have a giant ticker tape machine 562 00:28:12,480 --> 00:28:14,940 in my cramped hellhole of an apartment. 563 00:28:15,500 --> 00:28:18,120 So what you can do instead 564 00:28:18,120 --> 00:28:19,820 is you can just run a program called FLDigi 565 00:28:22,000 --> 00:28:23,280 to receive it. 566 00:28:23,800 --> 00:28:28,280 Over here on the top left, 567 00:28:28,380 --> 00:28:31,320 you have the frequency that the radio is tuned to, 14.070. 568 00:28:31,840 --> 00:28:35,180 This is the frequency that your radio is actually set to. 569 00:28:35,200 --> 00:28:39,720 A little bit to the right of this, 14.071.085, 570 00:28:39,960 --> 00:28:42,680 that's, like, the radio frequency 571 00:28:42,980 --> 00:28:44,220 plus the audio frequency. 572 00:28:44,480 --> 00:28:46,520 That's where the signal is actually centered. 573 00:28:48,120 --> 00:28:53,260 And the signal consists of two different frequencies, 574 00:28:53,380 --> 00:28:54,880 and it's bouncing between them, 575 00:28:55,000 --> 00:28:56,580 and it bounces between them 576 00:28:56,580 --> 00:28:59,440 to send a serial port waveform. 577 00:29:01,240 --> 00:29:03,140 It's five bits, 578 00:29:05,700 --> 00:29:08,180 no parity two-stop bits, 579 00:29:08,340 --> 00:29:09,640 so, like, five and two 580 00:29:09,640 --> 00:29:11,760 at a particular baud rate. 581 00:29:11,860 --> 00:29:13,480 The baud rate is, 582 00:29:14,760 --> 00:29:17,300 I think, 70 symbols per second. 583 00:29:17,800 --> 00:29:19,620 I forget exactly which means which. 584 00:29:20,120 --> 00:29:20,500 But... 585 00:29:21,320 --> 00:29:23,140 So in the 70s, when this was popular, 586 00:29:23,980 --> 00:29:26,860 they started doing artwork with it, 587 00:29:26,900 --> 00:29:29,060 just like we would do ASCII artwork, right? 588 00:29:29,140 --> 00:29:31,680 This is a horse. 589 00:29:31,680 --> 00:29:32,720 This is Seattle Slough, 590 00:29:32,860 --> 00:29:36,060 who won the American Cup that year. 591 00:29:39,140 --> 00:29:41,340 RTTY is based on an alphabet 592 00:29:41,340 --> 00:29:44,120 of five-bit symbols. 593 00:29:44,340 --> 00:29:46,040 One thing that you'll note about this alphabet 594 00:29:46,680 --> 00:29:51,360 is that the letters and the numbers 595 00:29:51,360 --> 00:29:53,580 are in typing order, right? 596 00:29:53,640 --> 00:29:57,340 So Q maps to one, W maps to two, like QWERTY, right? 597 00:29:57,480 --> 00:30:00,500 The reason for this is that the symbols 598 00:30:00,500 --> 00:30:04,560 and the letters had to share physical keys 599 00:30:04,560 --> 00:30:05,060 in the keyboard. 600 00:30:06,120 --> 00:30:07,800 There are a couple of special ones, though. 601 00:30:10,500 --> 00:30:12,520 So in addition to carries your turn and line feed, 602 00:30:12,720 --> 00:30:13,240 like, they... 603 00:30:13,240 --> 00:30:15,340 I still don't know whether they used both 604 00:30:15,340 --> 00:30:17,020 or just the one, like, civilized people. 605 00:30:18,340 --> 00:30:18,740 Um... 606 00:30:20,000 --> 00:30:23,880 So, you know, you've got, like, a figures symbol, 607 00:30:24,040 --> 00:30:25,440 and then you've got a letters symbol, 608 00:30:25,580 --> 00:30:26,960 and you'll note that they don't have, like, 609 00:30:27,420 --> 00:30:28,320 matching ones, right? 610 00:30:28,320 --> 00:30:32,240 So figs says to jump to the figures side, 611 00:30:32,360 --> 00:30:34,180 and letters says to jump to the letters side. 612 00:30:34,700 --> 00:30:37,180 And this is, like, a state change, okay? 613 00:30:37,240 --> 00:30:39,200 So you actually send, like, um... 614 00:30:40,160 --> 00:30:41,900 a thing saying that the next thing will be a letter 615 00:30:41,900 --> 00:30:42,860 or the next thing will be a number, 616 00:30:43,020 --> 00:30:43,700 and that's how it knows. 617 00:30:50,900 --> 00:30:51,780 Thank you kindly. 618 00:30:51,980 --> 00:30:54,780 So, uh, teletypes ran DOS. 619 00:31:01,180 --> 00:31:01,620 So... 620 00:31:02,240 --> 00:31:04,140 Then they need to extend this a little bit 621 00:31:04,140 --> 00:31:06,760 because, uh, there was this war, 622 00:31:06,940 --> 00:31:08,120 and Germany was acting up, 623 00:31:08,180 --> 00:31:09,860 and Russia couldn't manufacture anything for itself. 624 00:31:10,460 --> 00:31:11,340 So, um, 625 00:31:12,300 --> 00:31:13,700 the United States stepped in 626 00:31:13,700 --> 00:31:15,540 and built a bunch of radios for the Soviet Union. 627 00:31:16,800 --> 00:31:18,600 And, uh, they need some vodka. 628 00:31:18,740 --> 00:31:19,080 You know? 629 00:31:19,140 --> 00:31:19,460 Like, . 630 00:31:21,080 --> 00:31:21,960 So, um... 631 00:31:24,960 --> 00:31:25,840 The, um... 632 00:31:25,840 --> 00:31:28,300 This is a transliterated Cyrillic, right? 633 00:31:28,300 --> 00:31:29,420 So this isn't really Russian. 634 00:31:29,480 --> 00:31:30,640 This is just the Russian alphabet. 635 00:31:31,360 --> 00:31:33,080 Um, now, in letters, 636 00:31:33,180 --> 00:31:34,820 you have four vodkas. 637 00:31:35,220 --> 00:31:37,280 But if you have a figures byte 638 00:31:37,280 --> 00:31:38,380 and then you send the rest, 639 00:31:38,520 --> 00:31:39,580 you just get, like, the... 640 00:31:40,040 --> 00:31:42,360 Uh, who are you symbol, 641 00:31:42,460 --> 00:31:43,180 the bell symbol. 642 00:31:44,120 --> 00:31:44,560 Um... 643 00:31:44,560 --> 00:31:47,720 So they realized they could just add a null symbol, 644 00:31:48,320 --> 00:31:50,020 which previously wasn't used for anything, 645 00:31:50,200 --> 00:31:52,840 and make that a shift to the Cyrillic alphabet 646 00:31:52,840 --> 00:31:54,520 and in that way support all three. 647 00:31:56,480 --> 00:31:57,840 So the little bear gets his vodka. 648 00:31:58,580 --> 00:32:00,620 And letters is kind of special 649 00:32:00,620 --> 00:32:02,080 in that it's an idle tone. 650 00:32:02,340 --> 00:32:03,220 Uh, they... 651 00:32:03,220 --> 00:32:04,400 They call these, uh, 652 00:32:04,580 --> 00:32:05,660 ditties or diddles 653 00:32:05,660 --> 00:32:06,960 or all sorts of other words. 654 00:32:07,080 --> 00:32:08,220 So, um, 655 00:32:08,400 --> 00:32:10,600 basically you've got, like, five ones in a row. 656 00:32:11,400 --> 00:32:12,860 And you just keep sending that. 657 00:32:13,180 --> 00:32:15,320 And the receiver is just switching 658 00:32:15,320 --> 00:32:17,740 to the letter style constantly. 659 00:32:18,400 --> 00:32:20,520 And you can do this in a live mode 660 00:32:20,520 --> 00:32:22,780 so that the operator, like, uh, 661 00:32:22,980 --> 00:32:24,120 has time to think. 662 00:32:25,860 --> 00:32:27,560 Um, because these... 663 00:32:27,560 --> 00:32:29,800 can be used for recorded messages, 664 00:32:30,080 --> 00:32:32,860 but they're intended to be at about the rate that we type. 665 00:32:33,400 --> 00:32:35,520 Uh, and the reason was that these were great 666 00:32:35,520 --> 00:32:37,160 for live conversations. 667 00:32:37,540 --> 00:32:40,200 So, uh, you wouldn't have to use Morse code 668 00:32:40,200 --> 00:32:42,160 in order to have a live conversation 669 00:32:42,160 --> 00:32:43,260 over a narrow bandwidth. 670 00:32:44,980 --> 00:32:45,500 So... 671 00:32:46,340 --> 00:32:48,000 other idle tones are legal. 672 00:32:49,480 --> 00:32:52,040 You can do, uh, letters to figures 673 00:32:52,040 --> 00:32:53,200 to figures to letters. 674 00:32:54,020 --> 00:32:56,440 And the standard receiver will ignore 675 00:32:56,440 --> 00:32:58,260 everything except for the last one. 676 00:32:59,740 --> 00:33:02,160 So your idle tones that are being ignored 677 00:33:02,160 --> 00:33:04,100 can instead be used to hide information. 678 00:33:06,680 --> 00:33:07,900 So your beers... 679 00:33:07,900 --> 00:33:09,940 Uh, your bears can, uh, pass through the village 680 00:33:09,940 --> 00:33:12,540 and they can have some, uh, some books on them. 681 00:33:12,660 --> 00:33:14,180 I bet you guys can't tell at all 682 00:33:14,180 --> 00:33:15,120 which slides Sergey wrote. 683 00:33:15,340 --> 00:33:16,000 You know? 684 00:33:17,660 --> 00:33:20,380 So then PSK 31 for, like, 685 00:33:20,560 --> 00:33:22,040 you know, the modern style of it. 686 00:33:22,840 --> 00:33:23,280 Um... 687 00:33:23,280 --> 00:33:25,400 So this was a 1990s replacement 688 00:33:25,400 --> 00:33:26,440 for RTTY. 689 00:33:27,400 --> 00:33:27,720 Um... 690 00:33:28,760 --> 00:33:30,120 You can actually, uh, 691 00:33:30,300 --> 00:33:31,920 sort of tell by the technology 692 00:33:31,920 --> 00:33:34,060 that, um... 693 00:33:35,820 --> 00:33:36,940 Uh, I'll get back to that in a bit. 694 00:33:37,060 --> 00:33:38,980 So it's 31 and a quarter baud. 695 00:33:39,340 --> 00:33:41,600 Uh, and this is also normal for human typing speeds. 696 00:33:41,720 --> 00:33:43,260 So you can use this for a live conversation. 697 00:33:44,320 --> 00:33:45,900 Um, so you get on and you're like, 698 00:33:46,000 --> 00:33:47,620 CQ, CQ, is anyone out there? 699 00:33:47,780 --> 00:33:49,540 And then the guy will reply and he'll say, 700 00:33:49,620 --> 00:33:51,680 yeah, yeah, I'm, uh, calling you from Bogota. 701 00:33:52,280 --> 00:33:54,120 And you're like, cool, I'm just contesting, bye. 702 00:33:55,400 --> 00:33:55,580 Um... 703 00:33:59,060 --> 00:33:59,500 Um... 704 00:34:00,300 --> 00:34:02,260 There really ought to be an alternative to CQ. 705 00:34:02,440 --> 00:34:06,420 Uh, like, it's illegal by the full force of part 97 706 00:34:06,420 --> 00:34:08,160 to reply to it except in, like, 707 00:34:08,160 --> 00:34:09,200 a proper RackTube conversation. 708 00:34:10,040 --> 00:34:12,740 Uh, anyways, uh, a couple things to notice here. 709 00:34:12,980 --> 00:34:15,140 First, uh, we still have, like, 710 00:34:15,200 --> 00:34:16,260 the frequency at the top. 711 00:34:16,360 --> 00:34:18,680 We got the, like, offset for it. 712 00:34:18,780 --> 00:34:20,580 So here, uh, one... 713 00:34:21,420 --> 00:34:23,620 one kilohertz above the radio signal 714 00:34:24,380 --> 00:34:25,380 is the offset. 715 00:34:25,380 --> 00:34:25,760 That's the audio signal. 716 00:34:26,700 --> 00:34:28,200 The other thing, um, 717 00:34:28,480 --> 00:34:30,680 is that instead of having 718 00:34:32,080 --> 00:34:33,280 two peaks, 719 00:34:33,460 --> 00:34:34,180 we only have one. 720 00:34:35,180 --> 00:34:36,480 Right? Uh, because 721 00:34:37,200 --> 00:34:38,800 PSK31 is changing the phase 722 00:34:38,800 --> 00:34:39,760 and not the frequency. 723 00:34:40,580 --> 00:34:43,220 Now, a phase change of this is the same 724 00:34:43,220 --> 00:34:44,440 as a frequency change 725 00:34:44,440 --> 00:34:47,480 of about one hertz being rather abrupt. 726 00:34:48,280 --> 00:34:49,980 Uh, for weird reasons. 727 00:34:50,160 --> 00:34:52,240 So the, uh, 728 00:34:52,420 --> 00:34:54,740 the actual line is a little bit wider 729 00:34:54,740 --> 00:34:56,180 than a Morse code line would be. 730 00:34:56,600 --> 00:34:58,600 And that's how you can visually tell the difference. 731 00:35:02,080 --> 00:35:05,000 PSK31 uses a phase inversion to mark as zero. 732 00:35:05,780 --> 00:35:07,280 Oh, it's a fancy way to say that, like, 733 00:35:07,300 --> 00:35:08,000 sine becomes cosine. 734 00:35:08,240 --> 00:35:10,020 Or that cosine becomes sine. 735 00:35:12,020 --> 00:35:13,940 Always in phase shift keying, 736 00:35:14,100 --> 00:35:15,600 you're dealing with a relative change. 737 00:35:16,380 --> 00:35:19,480 So you don't know whether it's sine or cosine 738 00:35:19,480 --> 00:35:21,480 because, like, everything is sort of sliding by. 739 00:35:21,800 --> 00:35:24,620 You just know that it's not what it used to be 740 00:35:24,740 --> 00:35:25,460 one symbol before. 741 00:35:28,380 --> 00:35:30,480 Um, the phase is inverted 742 00:35:30,480 --> 00:35:31,700 to mark as zero. 743 00:35:32,500 --> 00:35:34,140 And it is not inverted 744 00:35:34,520 --> 00:35:35,320 to mark a one. 745 00:35:35,720 --> 00:35:38,180 So the non-inverted one is just a sine wave. 746 00:35:38,240 --> 00:35:40,240 This is the same thing that you would do on your TI-86 747 00:35:40,680 --> 00:35:41,780 in, uh, high school 748 00:35:41,780 --> 00:35:44,840 or your HP-48 if you were actually cool. 749 00:35:45,700 --> 00:35:46,180 Um... 750 00:35:47,360 --> 00:35:47,840 But... 751 00:35:49,940 --> 00:35:51,320 I said the 48. 752 00:35:52,980 --> 00:35:53,460 41C! 753 00:35:55,820 --> 00:35:56,600 Is that Bluetooth? 754 00:35:58,520 --> 00:35:59,880 So the, um... 755 00:35:59,880 --> 00:36:01,920 So you got, like, the sine waving. 756 00:36:02,060 --> 00:36:04,660 And then at this point, we just abruptly change it. 757 00:36:05,020 --> 00:36:06,820 We just abruptly say, uh, 758 00:36:06,840 --> 00:36:08,220 nope, we're doing it the other way. 759 00:36:08,280 --> 00:36:09,820 So the thing sort of hops around. 760 00:36:09,940 --> 00:36:11,560 And that's the phase shift. 761 00:36:13,960 --> 00:36:16,040 Um, this is sort of a lie to children, though. 762 00:36:16,080 --> 00:36:17,220 If you do it this way, 763 00:36:18,180 --> 00:36:20,140 everyone in the band will start yelling at you, 764 00:36:20,220 --> 00:36:22,380 and you will get reported more than the guy 765 00:36:22,380 --> 00:36:24,640 who plays pooping noises on the local repeater. 766 00:36:24,740 --> 00:36:25,920 And the reason why 767 00:36:26,680 --> 00:36:28,900 is that if you actually listen to it, 768 00:36:28,960 --> 00:36:30,680 this really hurts your ears, 769 00:36:30,840 --> 00:36:32,620 and it also physically hurts the speaker. 770 00:36:32,920 --> 00:36:34,340 Because if you think about it, 771 00:36:34,340 --> 00:36:36,220 the speaker is sort of wobbling in and out 772 00:36:36,220 --> 00:36:37,020 with the wave. 773 00:36:37,500 --> 00:36:38,820 And then just abruptly, 774 00:36:38,960 --> 00:36:41,320 as inertia is carrying it out, 775 00:36:41,360 --> 00:36:42,280 you yank it back. 776 00:36:43,000 --> 00:36:44,840 And that creates, like, a little pop. 777 00:36:45,100 --> 00:36:47,220 And the pop happens to air pressure, 778 00:36:47,280 --> 00:36:49,240 and it happens 31 times a second. 779 00:36:49,500 --> 00:36:50,720 And it's really loud. 780 00:36:50,980 --> 00:36:53,120 And my iMac needs new speakers. 781 00:36:54,400 --> 00:36:56,000 Um, so instead what you do 782 00:36:56,000 --> 00:36:57,380 is you drop the amplitude. 783 00:36:57,600 --> 00:36:59,340 So this actually, like, drops the amplitude, 784 00:36:59,500 --> 00:37:01,660 and then here is when it does the phase change. 785 00:37:01,860 --> 00:37:03,200 And then it grows back up 786 00:37:03,200 --> 00:37:05,240 so that at the time it makes the phase change, 787 00:37:06,160 --> 00:37:07,840 there's, like, nothing important going on. 788 00:37:09,020 --> 00:37:11,140 Um, now you have to raise it back 789 00:37:11,140 --> 00:37:12,620 by the middle of the symbol. 790 00:37:13,980 --> 00:37:14,420 Um... 791 00:37:15,820 --> 00:37:18,160 Then the idea is that the receiver 792 00:37:18,160 --> 00:37:20,480 just checks, like, the middle of the symbol 793 00:37:20,480 --> 00:37:21,580 to see if the phase has changed, 794 00:37:21,580 --> 00:37:24,540 and ignores the borders between the symbols. 795 00:37:27,520 --> 00:37:31,680 So when you open up a PSK31 message 796 00:37:31,680 --> 00:37:33,220 in Audacity, 797 00:37:33,340 --> 00:37:34,800 we're talking a clean one, 798 00:37:34,860 --> 00:37:36,160 like, no background radio noise, 799 00:37:36,320 --> 00:37:38,420 uh, just one party talking 800 00:37:38,420 --> 00:37:40,460 centered at exactly one kilohertz, 801 00:37:40,520 --> 00:37:41,460 like a clean signal, 802 00:37:41,560 --> 00:37:43,940 you can actually look by the amplitude 803 00:37:45,300 --> 00:37:47,140 to see where the zeros are. 804 00:37:47,320 --> 00:37:49,640 So you'll see, like, the amplitude drop for a zero 805 00:37:49,640 --> 00:37:51,080 or not drop for a one. 806 00:37:55,180 --> 00:37:57,200 To decode this, um, 807 00:37:58,180 --> 00:38:00,400 I know we're getting back into the fancy math here, 808 00:38:00,440 --> 00:38:02,500 but you remember that, uh, 809 00:38:02,640 --> 00:38:04,980 a positive times a positive is also positive, 810 00:38:05,100 --> 00:38:09,100 and a negative times a negative is also positive? 811 00:38:10,020 --> 00:38:11,940 So the only thing that'll actually, like, 812 00:38:11,980 --> 00:38:12,980 multiply to become negative 813 00:38:12,980 --> 00:38:14,600 is when you have a negative times a positive. 814 00:38:15,600 --> 00:38:18,140 So what you do is you multiply the signal 815 00:38:18,140 --> 00:38:20,520 by a time-delayed version of itself. 816 00:38:21,600 --> 00:38:23,660 When they were first implementing this in hardware, 817 00:38:23,920 --> 00:38:25,520 they had to have, like, a speaker 818 00:38:26,240 --> 00:38:27,960 and, like, a little tube of mercury 819 00:38:27,960 --> 00:38:29,440 and then a microphone at the end, 820 00:38:29,500 --> 00:38:32,360 and they would actually use that for the delay 821 00:38:32,360 --> 00:38:34,200 because the sound goes slower through mercury 822 00:38:34,200 --> 00:38:35,720 than through air or an electric wire. 823 00:38:36,700 --> 00:38:38,540 Um, I love living in the future. 824 00:38:40,400 --> 00:38:41,620 Uh, on the other hand, 825 00:38:41,640 --> 00:38:43,240 I still don't know what to do with my half liter of mercury. 826 00:38:43,660 --> 00:38:44,080 So... 827 00:38:46,220 --> 00:38:49,320 Um, so you multiply with its delayed self, 828 00:38:49,320 --> 00:38:52,320 and the result of that is that the result is positive 829 00:38:52,320 --> 00:38:53,560 when the phase has changed, 830 00:38:54,380 --> 00:38:56,460 but it's negative in all other cases. 831 00:38:57,460 --> 00:38:59,140 And then you wind up with a new signal 832 00:38:59,140 --> 00:39:01,920 that sort of only hops above the zero line 833 00:39:01,920 --> 00:39:03,320 for a phase change 834 00:39:03,320 --> 00:39:07,080 and stays beneath the zero line if there's no phase change, 835 00:39:07,400 --> 00:39:09,100 and that's very easy to filter out 836 00:39:09,100 --> 00:39:10,340 because then you're just looking to see 837 00:39:10,340 --> 00:39:11,380 whether it's positive or negative. 838 00:39:14,000 --> 00:39:16,140 PSK31 uses a Veracode alphabet, 839 00:39:16,880 --> 00:39:18,600 which is different from the one 840 00:39:18,600 --> 00:39:21,100 that's in RITI, R-T-T-Y. 841 00:39:21,500 --> 00:39:24,840 So ASCII is not very efficient for English text. 842 00:39:26,200 --> 00:39:26,760 Um... 843 00:39:28,900 --> 00:39:32,200 Uh, I mean, like, it's great for screwing up 844 00:39:33,360 --> 00:39:34,600 Unicode quotation marks 845 00:39:34,600 --> 00:39:37,820 that you copy and paste from, uh, OpenOffice. 846 00:39:38,400 --> 00:39:41,520 I used to love Freedom, and then I tried OpenOffice. 847 00:39:41,920 --> 00:39:43,620 Uh, now I'm not so sure. 848 00:39:44,580 --> 00:39:48,020 Um, so in Veracode, common letters are short. 849 00:39:48,600 --> 00:39:49,860 Uh, so just like in Morse code, 850 00:39:50,180 --> 00:39:54,020 E should be shorter than, uh, W. 851 00:39:55,560 --> 00:39:58,680 Also, lowercase letters are far more common 852 00:39:58,680 --> 00:39:59,720 than uppercase letters. 853 00:39:59,940 --> 00:40:02,560 So instead of wasting an entire bit 854 00:40:02,560 --> 00:40:05,740 to declare whether the letter is uppercase or lowercase, 855 00:40:06,620 --> 00:40:09,040 Veracode just assigns them different codes, 856 00:40:09,220 --> 00:40:11,140 and the uppercase ones are longer. 857 00:40:12,900 --> 00:40:16,620 Um, for Morse code, that trick wouldn't have worked 858 00:40:16,620 --> 00:40:19,960 because the operators would then have to learn 859 00:40:19,960 --> 00:40:21,120 twice as many symbols. 860 00:40:21,960 --> 00:40:25,220 But for PSK31, we can make the machine learn 861 00:40:25,220 --> 00:40:28,320 whatever we're stubborn enough to program it, 862 00:40:28,420 --> 00:40:31,180 and adding extra entries to a table doesn't cost much. 863 00:40:31,880 --> 00:40:35,060 So this is the PSK31 Veracode alphabet. 864 00:40:35,520 --> 00:40:37,300 I'm leaving out some symbols here, 865 00:40:37,460 --> 00:40:40,520 um, but this is, like, what you need for a conversation. 866 00:40:40,900 --> 00:40:42,560 Uh, so punctuation marks 867 00:40:42,560 --> 00:40:44,240 and that sort of stuff will come later. 868 00:40:44,660 --> 00:40:46,500 Um, so, like, you'll note that 869 00:40:46,620 --> 00:40:49,560 A is much shorter than uppercase A. 870 00:40:50,000 --> 00:40:56,220 You'll also note that E11 is not the shortest letter. 871 00:40:56,380 --> 00:40:58,260 The shortest letter is a single one, 872 00:40:58,800 --> 00:40:59,800 which is a space. 873 00:41:02,240 --> 00:41:03,520 Now, zooming in on these 874 00:41:03,520 --> 00:41:04,680 so that you can actually read the numbers, 875 00:41:04,960 --> 00:41:07,560 um, there are a couple of properties of this 876 00:41:07,560 --> 00:41:08,040 that you'll notice. 877 00:41:08,260 --> 00:41:11,100 For example, nowhere in this entire table 878 00:41:11,100 --> 00:41:14,020 do you ever see more than a single zero in a row. 879 00:41:16,620 --> 00:41:18,520 The reason for that is that 880 00:41:18,520 --> 00:41:20,720 zeros delimit the letters. 881 00:41:21,500 --> 00:41:23,120 So a letter keeps going 882 00:41:23,120 --> 00:41:25,560 until you see two zeros at once, 883 00:41:25,720 --> 00:41:27,440 and then you lop those off 884 00:41:27,440 --> 00:41:29,060 and the letter is whatever came before it. 885 00:41:29,460 --> 00:41:33,480 So if you keep sending zeros, 886 00:41:34,440 --> 00:41:36,840 the next letter hasn't begun yet, 887 00:41:36,880 --> 00:41:38,660 because the next letter begins on a one. 888 00:41:39,280 --> 00:41:43,120 This makes it very easy for live letters 889 00:41:43,120 --> 00:41:46,260 to at most delay by a single bit. 890 00:41:46,900 --> 00:41:49,620 So as it's idling, if you hit the space key, 891 00:41:49,780 --> 00:41:52,400 the very next symbol can become a one, 892 00:41:53,140 --> 00:41:54,520 and then two zeros, like, 893 00:41:54,560 --> 00:41:56,140 you don't need to queue it up very far, 894 00:41:56,300 --> 00:41:58,820 as you would if you were synchronizing a longer symbol. 895 00:41:59,740 --> 00:42:01,640 The other thing is that 896 00:42:01,640 --> 00:42:04,240 the letters have no maximum length. 897 00:42:04,700 --> 00:42:06,900 So unlike, uh, RIDI, 898 00:42:07,080 --> 00:42:09,500 where every symbol is five bits long, 899 00:42:10,220 --> 00:42:11,560 here in PSK31, 900 00:42:11,800 --> 00:42:14,420 we could have a million-bit letter 901 00:42:14,420 --> 00:42:15,960 added to the code sequence. 902 00:42:17,940 --> 00:42:19,920 So every letter begins with a one. 903 00:42:20,340 --> 00:42:23,380 No letter contains more than a single zero in a row. 904 00:42:23,660 --> 00:42:26,060 And wherever you see more than a single zero, 905 00:42:26,200 --> 00:42:27,740 that's a delimiter between letters. 906 00:42:29,580 --> 00:42:30,820 Do this make sense? 907 00:42:31,320 --> 00:42:34,600 So we can do tricks with this. 908 00:42:35,200 --> 00:42:38,080 We can vary the idle count to hide data. 909 00:42:38,900 --> 00:42:41,840 So as I'm sending you a long message, 910 00:42:42,100 --> 00:42:44,360 um, in PSK31, 911 00:42:44,600 --> 00:42:46,600 it's traditional to see 912 00:42:46,620 --> 00:42:49,620 that you send a computer-generated list 913 00:42:49,620 --> 00:42:51,840 of, like, who you are and where you are 914 00:42:51,840 --> 00:42:52,960 and what sort of antenna you have 915 00:42:52,960 --> 00:42:54,380 and what model of radio you have, 916 00:42:54,860 --> 00:42:55,860 and then to say, 917 00:42:56,060 --> 00:42:57,560 K, thanks for contesting, bye. 918 00:42:59,560 --> 00:43:01,520 Um, and all of that is done 919 00:43:01,520 --> 00:43:03,060 by the operator just hitting a single button, 920 00:43:03,160 --> 00:43:04,680 and a prerecorded message goes out. 921 00:43:05,700 --> 00:43:07,780 Well, when you're doing this prerecorded message, 922 00:43:08,040 --> 00:43:10,680 you can space the letters out slightly differently. 923 00:43:10,820 --> 00:43:13,580 Like, uh, two zeros is standard. 924 00:43:15,040 --> 00:43:17,440 So you could send three for a one 925 00:43:17,440 --> 00:43:18,600 and four for a zero 926 00:43:18,600 --> 00:43:20,340 and hide your message that way. 927 00:43:21,960 --> 00:43:23,820 Um, also, illegally letter... 928 00:43:24,220 --> 00:43:25,660 Illegally long letters are ignored. 929 00:43:25,860 --> 00:43:27,920 And this is how the designer of the protocol 930 00:43:27,920 --> 00:43:29,520 added support for Hayaski. 931 00:43:29,700 --> 00:43:31,120 He happened to be British, 932 00:43:31,280 --> 00:43:36,300 and the British enjoy stubborn standards of their own, 933 00:43:36,380 --> 00:43:37,660 like this weird Celsius stuff. 934 00:43:39,520 --> 00:43:41,140 And...so they have the pound symbol. 935 00:43:41,860 --> 00:43:43,560 But as God wants you to know, 936 00:43:43,560 --> 00:43:45,000 God-fearing Americans were in charge 937 00:43:45,000 --> 00:43:47,680 of creating the, uh, the ASCII table. 938 00:43:47,960 --> 00:43:50,140 Well, we're not going to put the Queen's money in there. 939 00:43:50,700 --> 00:43:52,100 We fought a war over this. 940 00:43:53,680 --> 00:43:55,800 Then we fought another war with Canada over it, 941 00:43:55,820 --> 00:43:57,260 and Canada thinks they won, and... 942 00:43:58,220 --> 00:43:59,740 So, what we do is, 943 00:43:59,860 --> 00:44:01,560 uh, what he decided to do 944 00:44:01,560 --> 00:44:04,300 was to just have longer letters, 945 00:44:04,360 --> 00:44:05,880 because he figured that the pound key 946 00:44:05,880 --> 00:44:07,000 wasn't very common, 947 00:44:07,780 --> 00:44:09,900 and it would only be used by two Brits 948 00:44:09,900 --> 00:44:10,840 talking to each other. 949 00:44:12,060 --> 00:44:13,560 So, what he could do 950 00:44:13,560 --> 00:44:15,260 is he could just make longer sequences 951 00:44:15,260 --> 00:44:17,620 that meant the upper half of the ASCII table, 952 00:44:17,780 --> 00:44:21,200 uh, which in...in older styles of windows 953 00:44:21,200 --> 00:44:24,320 would be, like, the region-specific letters. 954 00:44:24,700 --> 00:44:27,380 So, the E with an acute accent for French, 955 00:44:27,440 --> 00:44:29,700 or the O with an umlaut for German, 956 00:44:29,900 --> 00:44:32,420 um, or the pound key in British. 957 00:44:32,560 --> 00:44:34,540 And that way, all of these things could go through 958 00:44:35,580 --> 00:44:37,780 without having to break compatibility 959 00:44:37,780 --> 00:44:39,220 with older implementations. 960 00:44:39,220 --> 00:44:41,660 An older implementation would just be missing a letter, 961 00:44:41,720 --> 00:44:42,800 but the message would still be clear. 962 00:44:48,860 --> 00:44:52,180 So, then you could do some, uh, some physical tricks. 963 00:44:54,720 --> 00:44:57,560 Uh, this is, um, a screenshot 964 00:44:57,560 --> 00:45:00,220 of how PSK31 is operated. 965 00:45:00,740 --> 00:45:03,520 Uh, you have, uh, a ASCII radio on the right 966 00:45:03,520 --> 00:45:04,860 and a laptop on the left, 967 00:45:04,920 --> 00:45:07,420 and the PSK31 is generated as audio 968 00:45:07,420 --> 00:45:08,640 with a cable that runs 969 00:45:08,640 --> 00:45:10,120 into the sound card, right? 970 00:45:10,240 --> 00:45:11,560 Like, all of this is audio, 971 00:45:11,700 --> 00:45:12,960 and all of this can be dealt with 972 00:45:12,960 --> 00:45:14,900 entirely in the, uh, the audio domain. 973 00:45:16,320 --> 00:45:19,140 So, what you do is, uh, in Python, 974 00:45:19,240 --> 00:45:21,720 you just specify your audio rate and your volume. 975 00:45:22,120 --> 00:45:25,480 Um, then you divide that 976 00:45:26,800 --> 00:45:29,140 into, like, how many waves per second you want. 977 00:45:29,280 --> 00:45:31,080 This is your audio frequency, 978 00:45:31,340 --> 00:45:32,600 in our case, one kilohertz. 979 00:45:33,380 --> 00:45:35,000 And then the length of your symbol 980 00:45:35,000 --> 00:45:38,460 is that audio rate divided by 31, 981 00:45:38,460 --> 00:45:40,440 and a quarter, right? 982 00:45:40,500 --> 00:45:42,900 Because there are 31 and a quarter symbols per second. 983 00:45:43,160 --> 00:45:47,140 So, if we have 48,000 audio samples per second, 984 00:45:47,240 --> 00:45:50,340 we want one 31.25 of that. 985 00:45:50,720 --> 00:45:53,860 Um, now, you note that I'm using 48,000 986 00:45:53,860 --> 00:45:56,220 instead of 44,100. 987 00:45:57,480 --> 00:45:59,120 I'm not doing CD audio. 988 00:45:59,640 --> 00:46:00,160 Why? 989 00:46:01,660 --> 00:46:02,180 Yes? 990 00:46:02,960 --> 00:46:04,000 It divides nicely. 991 00:46:05,720 --> 00:46:07,480 PSK31 was written in the 1990s, 992 00:46:07,480 --> 00:46:11,260 when PCs were not quite fast enough to do this live. 993 00:46:12,060 --> 00:46:14,860 So, instead, all of the early implementations 994 00:46:14,860 --> 00:46:16,880 were done as firmware 995 00:46:16,880 --> 00:46:19,120 that would run in a digital signal processing board. 996 00:46:19,780 --> 00:46:23,440 Digital signal processing being, um... 997 00:46:24,660 --> 00:46:27,420 being less than, like, uh, CD quality 998 00:46:27,420 --> 00:46:30,200 was based around an eight kilohertz sample rate. 999 00:46:31,740 --> 00:46:35,000 48,000 is, like, the modern equivalent of that. 1000 00:46:35,180 --> 00:46:37,460 So, it's at these rates that you get, uh, 1001 00:46:37,480 --> 00:46:38,680 more even division, 1002 00:46:39,340 --> 00:46:40,620 and then fewer audio artifacts. 1003 00:46:43,500 --> 00:46:44,020 Um... 1004 00:46:45,520 --> 00:46:48,640 You also have, like, your, uh, symbol index. 1005 00:46:48,840 --> 00:46:49,920 You got a value. You got a phase. 1006 00:46:50,460 --> 00:46:53,560 Um, and if you just create the wave 1007 00:46:53,560 --> 00:46:54,900 and you invert the phase that way, 1008 00:46:55,000 --> 00:46:58,140 you will get a horrible-sounding PSK30 implementation... 1009 00:46:58,140 --> 00:47:00,940 PSK31 implementation that actually works. 1010 00:47:02,000 --> 00:47:03,600 This little loop is enough 1011 00:47:03,600 --> 00:47:05,080 to produce the samples at those points. 1012 00:47:05,240 --> 00:47:06,580 You dump that to a WAV file, 1013 00:47:07,480 --> 00:47:08,300 and you have something legible. 1014 00:47:09,860 --> 00:47:11,260 Then you need to filter it. 1015 00:47:12,000 --> 00:47:13,220 So to filter it, 1016 00:47:14,800 --> 00:47:16,000 you attenuate it 1017 00:47:16,820 --> 00:47:19,880 in order to sort of scrunch down the volume 1018 00:47:19,880 --> 00:47:21,140 as you're changing the phase. 1019 00:47:22,800 --> 00:47:26,000 Again, this isn't, uh, a terribly hard addition to it. 1020 00:47:27,820 --> 00:47:29,980 The left is as we're filtering, 1021 00:47:30,100 --> 00:47:31,760 and the right is as we're not filtering. 1022 00:47:32,040 --> 00:47:33,440 Which would you rather listen to? 1023 00:47:36,380 --> 00:47:37,460 So in reality, 1024 00:47:37,480 --> 00:47:45,280 real PSK31, the filter only happens when the phase changes. Remember I told you that the 1025 00:47:45,280 --> 00:47:48,720 receiver is only looking at the middle of the symbol. It doesn't look at the borders 1026 00:47:48,720 --> 00:47:53,300 between the symbols. So no filter is used where the phase remains constant. 1027 00:47:55,780 --> 00:48:02,740 So I was describing some of the earlier tricks to Craig Hefner, and he started tooling around 1028 00:48:02,740 --> 00:48:11,300 with it, and he came up with this idea of doing it in that he had written a PSK31 receiver 1029 00:48:11,300 --> 00:48:16,900 the lazy way. Do you remember how I told you that you could look at the audio recording 1030 00:48:16,900 --> 00:48:21,100 and by the dips in the amplitude you could tell where the zeros were? That's how his 1031 00:48:21,100 --> 00:48:32,400 receiver worked. So what he did was he made a signal in which you would drop the amplitude 1032 00:48:32,400 --> 00:48:32,720 into a certain space. And that's how you could tell where the zeros were. 1033 00:48:32,740 --> 00:48:35,520 inside of a 1, even though it's not required. 1034 00:48:37,060 --> 00:48:44,700 This creates a symbol that real PSK31 interpreters see as the 1035 00:48:44,700 --> 00:48:45,700 one that it really is. 1036 00:48:45,900 --> 00:48:48,880 But his PSK31 interpreter would misinterpret 1037 00:48:48,880 --> 00:48:49,780 as being a 0. 1038 00:48:50,960 --> 00:48:53,380 So you can drop the amplitude anyways. 1039 00:48:53,580 --> 00:48:54,960 It does not break the signal at all. 1040 00:48:55,100 --> 00:49:00,340 And it actually gives the thing a distinctive tone if you 1041 00:49:00,680 --> 00:49:01,560 drop it all the time. 1042 00:49:01,560 --> 00:49:04,760 So most receivers don't notice the difference, but it's 1043 00:49:04,760 --> 00:49:06,120 measurable if you look for it. 1044 00:49:06,240 --> 00:49:08,980 And that's what you need to hide some information. 1045 00:49:09,300 --> 00:49:14,260 So these two recordings have the same meaning in legitimate 1046 00:49:14,260 --> 00:49:15,020 PSK31. 1047 00:49:15,360 --> 00:49:18,440 And anywhere, say in this region, where we drop it down 1048 00:49:18,440 --> 00:49:21,540 even though we don't have to, because that can be measured 1049 00:49:21,540 --> 00:49:25,380 on the other side, we can selectively drop it only to 1050 00:49:25,380 --> 00:49:28,200 encode a bit and thereby hide information. 1051 00:49:29,980 --> 00:49:31,300 You can also do a 1052 00:49:31,300 --> 00:49:31,460 . 1053 00:49:31,560 --> 00:49:33,620 PSK31 Morse code polyglot. 1054 00:49:33,780 --> 00:49:39,220 Because PSK31 is about phase, and Morse is about the 1055 00:49:39,220 --> 00:49:41,020 existence and the non-existence of the signal. 1056 00:49:42,260 --> 00:49:52,720 So you can drop the amplitude in order to throw a Morse code, 1057 00:49:53,680 --> 00:49:59,260 in order to throw a PSK31 signal on top of a Morse code 1058 00:49:59,260 --> 00:49:59,500 signal. 1059 00:50:02,280 --> 00:50:05,960 This is what it looks like in a waterfall. 1060 00:50:06,460 --> 00:50:08,500 This is the da-da-da. 1061 00:50:09,680 --> 00:50:12,680 The e is short enough to fit inside of a dit. 1062 00:50:13,860 --> 00:50:16,920 On the left, this da-da-da is Morse code for k. 1063 00:50:17,880 --> 00:50:22,580 And the first da actually contains the letter k in PSK31. 1064 00:50:22,900 --> 00:50:24,240 You can combine the two. 1065 00:50:25,200 --> 00:50:27,740 This is what it looks like in Audacity. 1066 00:50:29,240 --> 00:50:35,040 So you can do a Morse PSK polyglot in order to combine these two. 1067 00:50:38,320 --> 00:50:43,580 You can also, although it's a bit trickier, do a PSK31 RTTY polyglot. 1068 00:50:44,240 --> 00:50:50,420 RTTY expects you to completely drop out the power on one of the bit channels. 1069 00:50:50,640 --> 00:50:56,160 So the lower one is completely turned off when you're sending a one, and the upper one 1070 00:50:56,160 --> 00:50:57,720 is completely turned off when you're sending a two. 1071 00:50:57,720 --> 00:50:58,780 And the lower one is completely turned off when you're sending a zero. 1072 00:50:59,300 --> 00:51:04,180 The PSK31 is very tolerant to changes in power, because it only cares about the phase. 1073 00:51:04,880 --> 00:51:11,200 So what you can do is you can combine these two, and you can have two PSK31 messages 1074 00:51:11,760 --> 00:51:16,420 and change which one of them is stronger in order to encode your upper message. 1075 00:51:16,680 --> 00:51:23,200 And then you have two PSK31 channels that are also a valid single RTTY channel. 1076 00:51:26,020 --> 00:51:29,580 Error-correcting codes are added in the faster versions of PSK31. 1077 00:51:30,020 --> 00:51:31,320 This is QPSK. 1078 00:51:31,700 --> 00:51:33,860 It goes on forever. 1079 00:51:34,340 --> 00:51:40,560 And because some of these bits can be flipped safely, you can do the same trick that Drapeau 1080 00:51:40,560 --> 00:51:46,200 and Dukes did last year in JT65 in this PSK31 message. 1081 00:51:47,700 --> 00:51:49,960 They're the folks over there who were waving at me. 1082 00:51:50,600 --> 00:51:51,200 OK. 1083 00:51:52,580 --> 00:51:53,180 All right. 1084 00:51:53,200 --> 00:51:57,040 You can also do bit flipping in forward error correction, right? 1085 00:51:57,120 --> 00:51:59,380 So oh, no, this is the same style. 1086 00:51:59,520 --> 00:52:02,580 So you just let the error correction take care of it. 1087 00:52:04,220 --> 00:52:09,300 So I'm nearly done, but I have one last trick for you that is fucking incredible. 1088 00:52:11,860 --> 00:52:12,340 OK. 1089 00:52:12,580 --> 00:52:15,260 So data runs over Ethernet. 1090 00:52:15,880 --> 00:52:18,220 I as the attacker control a little bit of data. 1091 00:52:19,760 --> 00:52:21,420 But I don't control it very well. 1092 00:52:21,860 --> 00:52:23,180 Let's say you're doing HTTP. 1093 00:52:23,200 --> 00:52:23,880 You're doing HTTP over Tor. 1094 00:52:24,340 --> 00:52:26,220 And you're downloading a large file from me. 1095 00:52:26,760 --> 00:52:31,720 I can change the rate limiting of how fast I'm sending that file in order to control 1096 00:52:31,720 --> 00:52:34,120 the congestion on your local area network. 1097 00:52:35,140 --> 00:52:38,080 And let's assume it's a home network, so you're like the only user. 1098 00:52:40,000 --> 00:52:42,760 Now I want to exfiltrate a signal. 1099 00:52:42,940 --> 00:52:46,140 Like I want to say, the guy's here, guys. 1100 00:52:46,260 --> 00:52:48,100 Like that's physically where he is. 1101 00:52:50,220 --> 00:52:52,540 Well, if the Ethernet wiring is bad. 1102 00:52:52,540 --> 00:52:53,860 So I'm kind of lazy. 1103 00:52:53,980 --> 00:52:57,680 And you know how like in Ethernet, the wires are like sort of wrapped around each other? 1104 00:52:58,420 --> 00:53:04,580 And if you're a good IT guy, you'll know to unwrap them as little as possible. 1105 00:53:05,040 --> 00:53:12,060 But if you're a southern Appalachian neighbor just trying to get off Wi-Fi, then you'll 1106 00:53:12,060 --> 00:53:16,000 notice that it's a lot easier to crimp them if you just completely unwrap them and have 1107 00:53:16,000 --> 00:53:17,240 really long leads to push in. 1108 00:53:19,520 --> 00:53:22,520 So if you combine that with like a bunch of other things, you're going to be able to 1109 00:53:22,520 --> 00:53:25,180 get a kind of noisy Chinese router. 1110 00:53:27,660 --> 00:53:31,540 I'm not Mandiant, but ThreatButt tells me that China might be responsible for this. 1111 00:53:35,840 --> 00:53:44,200 This is the letter K sent over Morse code by me changing the screen that I'm looking 1112 00:53:44,200 --> 00:53:48,460 at while in a VNC session, as received by my neighbor down the block. 1113 00:53:49,980 --> 00:53:50,820 Isn't that cool? 1114 00:53:51,320 --> 00:53:51,880 That's awesome. 1115 00:53:51,940 --> 00:53:52,500 Thank you. 1116 00:53:56,480 --> 00:54:02,520 So if you'd care to play along, I think it'd be pretty cool if we did like a wide area 1117 00:54:02,520 --> 00:54:03,100 CTF. 1118 00:54:03,560 --> 00:54:06,300 Again, you got to do this in like a neighborly way. 1119 00:54:07,040 --> 00:54:12,240 I intended to do this as a 10-meter beacon, and then I kind of got distracted, and then 1120 00:54:12,240 --> 00:54:14,560 the sun decided that it doesn't like me. 1121 00:54:15,400 --> 00:54:22,000 So instead, I'll be doing this as like locally monitored transmission. 1122 00:54:22,000 --> 00:54:22,780 It's probably meant to be like aставля, like a transcendental transmission scheduled 1123 00:54:22,780 --> 00:54:24,300 on like 20 or 40 meter. 1124 00:54:25,260 --> 00:54:32,320 You can receive this by upper side-band in much of the Western hemisphere, and the actual 1125 00:54:32,320 --> 00:54:40,140 signal is a lecture on PSK31 in multiple parts about how to implement PSK31, how to 1126 00:54:40,140 --> 00:54:46,520 implement PSK 31 polyglots, and how to implement PSK 31 steganography with messages hidden inside 1127 00:54:46,520 --> 00:54:46,980 of the lecture. 1128 00:54:49,660 --> 00:54:51,980 There are a couple other things that come back up. 1129 00:54:52,000 --> 00:54:59,440 kinks to work out, but this should be finished in another few weeks. In conclusion, the PHY layer 1130 00:54:59,440 --> 00:55:04,840 is something that you can mess with. And when you're starting, you really should start with 1131 00:55:04,840 --> 00:55:10,660 the simpler protocols like PSK31 and RIDI. You should do this for a couple of reasons. Not least 1132 00:55:10,660 --> 00:55:16,600 of all, you'll actually have someone to talk to about it. I don't know how many of you have met 1133 00:55:16,600 --> 00:55:23,240 folks who know the really nitty-gritty details of Wi-Fi's PHY layer, but they're all too traumatized 1134 00:55:23,240 --> 00:55:28,720 to speak about it. And I mean, I know it's rude to bring things up with a victim like that. 1135 00:55:30,880 --> 00:55:36,420 But with the simpler protocols like PSK31 and RIDI, these are fun, and you can implement them 1136 00:55:36,420 --> 00:55:43,700 in a very short time. You can implement a PSK31 generator in a weekend. Just get yourself a cup 1137 00:55:43,700 --> 00:55:46,380 of coffee and sit down at the computer and look at the standards. 1138 00:55:46,600 --> 00:55:50,800 And you can do it. And it works. And you will have built your own modem from scratch. And you 1139 00:55:51,380 --> 00:55:58,900 can't do that for things like Wi-Fi yet. Also, these parser differentials are everywhere, 1140 00:55:59,060 --> 00:56:07,160 and we should be spending the time to understand them, both for art project reasons and also for 1141 00:56:07,160 --> 00:56:12,880 exploit writing reasons. So whether you're a hobbyist or an O'Day-selling baby killer, 1142 00:56:13,440 --> 00:56:15,500 this is something that you should pay attention to. 1143 00:56:16,600 --> 00:56:25,160 And these polyglots are fun. So you're not just able to combine file types in digital files. 1144 00:56:25,360 --> 00:56:28,220 You can also combine protocols in digital radio. 1145 00:56:29,860 --> 00:56:34,160 Thank you kindly for your time and attention. I'm going to have a beer now.