Let's give Daniel and Daniel a big round of applause and hear about some uh crypto stuff. Have a great time boys. Thank you. Have fun. Alright good luck. Thanks everybody. They were nice enough to give me a shot too even though I've spoken before so. Although I didn't I didn't expect it to be room temperature Jack Daniels uh body temperature sorry body temperature Jack Daniels so. Um so uh so I'm Daniel Crowley um I run research at X4 Red. Um I'm a cryptography nerd if you've ever heard of the tool Feather Duster that's my work. Uh also I am Sealandic nobility um and I'd like to clarify that crypto does not mean either crypto currency or cryptography. Crypto means cryptozoology so please get that right. Yeah so it's my first time speaking here and uh I thought I would start out strong with a uh quality meme um. So that you know that's just for you guys. Um but I just graduated from Georgia Tech. Um I'm also Sealandic nobility whereas he's a baron I am a lord. Um and yeah so I'm I'm working with him doing our crypto stuff. Yeah. Uh I'd also like to point out that Team Sealand here is dangerously close to completing the Defcon Infinity Gauntlet. Uh we have the uh the uh the uh the speaker stone, the contest stone and the goonstone and the human stone as well. So for the sake of Defcon Spiderman please uh don't get a press badge near us. Um anyway, sorry so the there um there is a problem that we are trying to solve here um and as as any good uh solution should have a problem that is trying to solve. Um there are So there's this whole big thing made about hash cracking. Hash cracking is a huge thing in the hacker community and in information security in general. And this is for good reason. There's lots of practical applications for hash cracking in penetration testing and things like that and testing password strength. There's a long history of it. But it's even a sport and a business. You know, there's a competition here at DEF CON called Crack Me If You Can, which is all based around password hash cracking. Um, now something that is not quite as big by a long shot is cracking encryption keys. Um, there's examples of this that are, that are being done, um, sort of, uh, on a regular basis. So WPA2 cracking, um, is cracking symmetric encryption keys. Um, but then you also have a lot of, uh, you know, a lot of stuff that's being done in terms of side channel analysis. So analysis of power or timing or heat or something like that in order to recover encryption keys without, uh, any sort of, uh, key search attack. Any sort of brute force. So it's not really brute force. It's not really cracking. It's more of key recovery. And if you can recover a partial key, then you can brute force the rest. Um, and then we see algorithm specific attacks. So for instance, uh, there's been a lot of work in cracking DES keys because DES has a pitifully short key length. Uh, and so that makes it practical to do an exhaustive key search without any sort of optimization and it works. Um, the EFF has built a DSS, uh, uh, the most recent DES cracker that I'm aware of. And it's, it's just DES is dead. Uh, single DES is dead. Um, but this is sort of, um, what we see in the community on encryption key cracking so far. Um, but as far as general, uh, cracking of encryption keys, there's not a whole lot going on. Um, nobody has really talked about how, in general, you take encrypted data and try to guess the key in a meaningful way, in a practical way. And this is really what we're going to be discussing here today. Um, but first, let's talk about why the traditional wisdom of encryption is so important. Um, first, let's talk about why the traditional wisdom is that symmetric key cracking should fail in theory. Um, when, you know, we've seen with like WPA2 key cracking that it really does work in practice, at least with some applications. So, the first big thing is key validation. When you take the wrong key and try to use it to decrypt some encrypted data, decryption can't fail. It's, it's, it's basically an equation. You're, you're just running through a step, uh, a series of steps. Um, and it can't, it can't fail, really. Uh, it just produces a different output. Um, because you're really just permuting data from one, one thing to another. Um, so you just get a different pseudo-randomized output instead of the correct output. Now, in theory, academically speaking, uh, the, the common wisdom is that it should be impossible to guess encryption keys because you can't tell when you've got the correct key because you don't know anything about the message. Now, we'll talk about why this is a bad, uh, assumption, why the theory doesn't match the practice, why the real world is different. Um, but then you also have the problem of key space. Now, um, the, when you don't, when you're not talking about like an export strength cypher, which is specifically weakened to have a key length that can be exhaustively searched, where we can guess every key with modern hardware, um, you, you know, when you're talking about like AES 128, for instance, you're talking about, uh, 16 bytes of key material, 128 bits of key material, and to guess every single key with all of the computing resources on planet Earth right now, it should take longer than we will take to reach the heat death of the universe. So, that is another reason why, in theory, what we're doing practically should fail. Um, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, um, that the challenge this time is to mesh out on our own, here, in, in, in the real world, here on the back demand is that we're changing bizg. Um, so let's talk about the solution to validating our guesses. Um, so in the real world there is an easy distinction that we can make in most cases between the pseudo-random output that we get from using the wrong key to the structured, meaningful data that we get from decrypting data using the correct key. In the real world, we can, we, we do have expenses of spending a span of time to actually some information about what the message is supposed to be. And we'll dive deeper into that. But, you know, like, if you're seeing English words in a decrypted, uh, uh, in decrypted data, if you're seeing meaningful looking data, uh, if you're seeing, uh, formats like XML or JSON, that, that, that's, you know, statistically it's possible that you can come out with that, but it's unlikely. And we'll talk about just how unlikely, uh, later on. Um, but knowing or guessing part of the plain text is often very easy. We can make a lot of good general assumptions about what data we're going to get. And we'll talk about that a little bit more later. Um, but if we can validate the data, we can validate that the key is correct. Um, so, uh, with electronic codebook mode, um, as an example, um, there are certain cons- so, there are certain considerations that we need to make. So, AES by default, by itself, is just a black box that takes 16 bytes and a key and turns those 16 bytes into some other 16 bytes and back. Um, so, it's sort of like a, um, it's, it's a pseudo-random permutation, right? Um, now, in order to process data with AES, it needs to be exactly 16 bytes in length. Um, and electronic codebook mode is the, the, the, the, the, the, the, the, the, most naive construction is the simplest construction. And this is just for demonstration purposes. We won't get into the, all the, the problems with ECB. Um, but the, the thing is that if we have data that is longer than 16 bytes, we need to split it up into chunks and do something with those chunks, process them individually with AES or whatever block safer we're using. Um, now, the thing is if we don't have enough data, we need to add what's called padding. So, we add at the very end, we add a little bit of padding, or junk padding, to the data to the end that is recognizable in our crypto system as junk data so that it can be removed. So that we can take data that's 15 bytes or 30 bytes or something that doesn't evenly fit into 16 byte chunks and process it with AES which is a function that processes 16 bytes and no more and no less. And what this means for us because padding is required to use AES in a useful way, it means we have data that we can validate. So we need padding. We need to apply padding to messages and when we decrypt it we can see that padding. And in fact many common encryption libraries when decrypting will check the padding and if it does not uh uh look correct it will actually fail. So while encryption can be used to decrypt data it can also be used to decrypt information. You know while decryption cannot really fail with the wrong key if you were to use the wrong key in decryption your library would probably fail. So this is a way that we can easily validate. Now it is possible for padding to be on a random output just by chance. Just by random chance. But let's talk about how feasible it is. Let's talk about how much of a problem that is. So, let's talk about one of the most common padding schemes in the world. This is called PKCS5 or PKCS7 padding. And the trivia there is that this was originally released in a standards document uh called PKCS number 5. And then they, they defined it for 8 byte block ciphers. 64 bit block ciphers. And then later on um they said well actually this scheme works for any block size so it works for any block size so just use it like that. And, and, and, and, and, and, and, and, and, and, it's fine. And that was in PKCS number 7. So um if a cryptographer uh which we cryptographers are notoriously pedantic um ever is like eh that's actually PKCS7 now you know why. Um so uh but if you, the way it works is basically like this. However many bytes you need to get to the next block boundary uh you just take the, that number and, and make that in more than the, the byte value of every byte that you add. So you have 5 open bytes to get to the next block boundary, you add 5 5s or 2 2s. And the beauty of this scheme is that if you have for instance 4 spots empty, 4 bytes that you need to pad and you have a ASCII value 4 byte at the end of your plain text, um a well written PKCS 7 padding uh removal routine will just take a look at the last byte and say okay is the number 4, are there 4 4s at the end? There are, great, I'll remove them. So this is totally unambiguous. Um this is one of the, this is very simple padding and it's very commonly used, it's very well uh supported. Um but we can validate this, right? So um any message that ends in a uh uh a byte with a value 1 is padded correctly under PKCS 7 padding. So this is totally unambiguous. This is totally unambiguous. So this is totally unambiguous. This is totally unambiguous. This is totally unambiguous. Um, which means that we have a 1 in 256 chance uh of getting a message that is padded correctly under PKCS 5 slash 7 padding. So padding alone produces too many false positives. But we also have the, the assumption that we can make that our data will be printable. So we can say you know if we decrypt some piece of data with a cat-, with a key that we're guessing we can don't know if it's the correct key or not, we can validate the padding and we can also most of the time make the assumption that the data that's coming out is printable. Now there are 100 printable characters in the ASCII character set out of 256. So our chances of getting 7 characters assuming like an 8 byte block is 1 in 120, sorry 1 in 720. So if we have longer blocks, more characters, we have an even lower chance of a false positive. So this, in this 8 byte scenario, we have approximately a 1 in 250,000 false positive chance. Now that's not great when we're guessing a large volume of keys, but it's also not that bad. And we'll talk about how we can improve that further. Um, one of the things to remember here is that it's way more likely for the last byte to be one particular value out of 2 bytes than the other. So when we have a false positive on the padding, it's overwhelmingly likely to be just 1 byte value 1, uh, at the end. Um, so keep that in mind. In our worst case scenario, we have a single block of ciphertext. Um, and this, this is, you know, it's, it's, it's, it's, it's, you know, this, this checking for printable characters is something that we can apply across multiple blocks. Um, if we have only a single block of 64-bit block, uh, uh, uh, 64-bit, uh, block cipher, ciphertext, and we don't know anything about the plaintext, we are only checking on padding and printable characters, we get about 4,000 false positives every billion guessed keys. Now, that's not that bad. And we can actually use character and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, ahem. functions can be fucking crazy right now,Et anThousand hertz, or, or maybe it'll be like 16-meter zoom, or, or something. So, if we run out of igt bizzare. We're going to be able to verify, we have permission language, and, and, and, and, and, and, and, and, and, and appears plenty of runs in a lockpack. But it's something, you can , uh, bad PR inside. But even if you can controversially iterations without something clean, uhm, you not even be theverbs. You can walked a block of ciphertext of PKCS7 padding, that's a much better result. That is much more likely to be the correct key. And using these factors, we can score the output. So, yes, maybe we have 4,000 false positives for a billion keys in the worst-case scenario, but we can score them, and like Google results, the first page is going to be a lot more useful than the seventh. If we have more samples, and this, again, we're talking about worst-case scenario, 8 bytes of ciphertext, uh, per ciphertext, and multiple samples, if we have two, suddenly our false positive rate drops dramatically. We have 1 in 62.5 billion false positives. So, every 62.5 billion keys we guess, we get one false positive. And with three words, we get one false positive. So, if we have three worst-case ciphertexts, this is an obscene number. It's like, I think, quadrillions, it's in the quadrillions. So, this is, becomes a terribly practical attack when you have even two worst-case ciphertexts. Alright, I, uh, I talk. You know, I'm not going to be silent the whole, the whole presentation, don't worry. Um, so, the next part of our solution is, uh, the key space. So, basically, um, there is the way, um, you can, um, you can use the key space, that developers should be doing this and then there's what actually happens. So how they should be choosing their keys, at least, is through actual random number generators. Um, true random number generators or um, also slightly worse but still uh valid is to kind of take a password and then basically you want to run it through a computationally expensive function, uh, like those shown and uh, basically that, that is a decent way of generating a key whereas you don't want your key to be, say, looking like these. Um, so, these are some keys that we have actually seen in the wild, uh, in some, like, real production code. So, yeah, I mean, you can obviously see how, how easy that would be to guess, um, but it's, it's, it's uh, kind of a different, um, concept. Um, and, uh, sometimes developers try to do, uh, like homebrew crypto and that's never a good, good thing to try. Um, so a very common is to just, you know, choose your password and then just pad nulls, no bytes until you hit 16 bytes. Um, or just repeat your chosen password over and over until you hit that 16 bytes. And then also, um, I talked about like computationally expensive password derivation functions, um, running it through MD5 is really, really, really computationally cheap. So, uh, that's basically nothing if I know that you're using MD5 to generate your keys, then I can run all of my password lists through MD5 and that's nothing. Um, it would be very easy to do. Um, so yeah, and it's kind of weird but, um, if you look at the first result of Google as a Java developer for how to do AES encryption, they actually tell you the incorrect way of generating your key. Um, either, you know, just running it through MD5 or SHA-1 or even just hard coding the bytes into your code which is terrible. Um, so yeah, um, so this is just a basic usage of SHA-1 to generate the, uh, key. Um, uh, this is actually the exact code that they give you in the first result in Google. Yeah, yeah, this is from, from their example. Um, and yeah, so, so this is bad, obviously, um, and, uh, so sometimes, you know, developers think, oh, you know, I can just add a little bit more onto it and it'll be a little bit more secure. Ah, XOR. Just take the SHA-1 and run it through a couple of XORs which is easily reversible. Um, this is no problem for, for uh, us to attack. Um, because it's, and this is open source code, right? Like, this is real code that, uh, exists, unfortunately. Um, so then, if you're going to not, you know, just hard-code it or use a hash function, um, some people like to, you know, use random number generators. And there are inherent issues with this, uh, depending on, uh, how you seed it and how you, the actual random number generator that you choose. Um, so, two common ones are, right, libsys rand, probably all of us have used that, and also java util random. Um, so yeah, um, the DES cracker that EFF released has, uh, 56, DES has, it's 56 bits of security and that, right, you can run that off of a laptop and crack DES keys, right? So, these reduce your key space to 32 bit seeds, uh, seed space, um, or 48, and that's almost child's play, like, I could crack this stuff on a raspberry pi, right? Like, this is a joke almost. Um, and so, that's a poor random number generator choice, assuming that you have truly, you know, like, perfect seeding of your random number generator. Um, but what if you use, uh, you know, a secure random number generator, but, you know, you don't have to do a lot of work on it, but then you're, you go to seed it, and, uh, yeah, we've seen developers use timestamps in their seeds, easily guessable, um, and then that allows us to, you know, you can just guess the time they probably, uh, created or generated the key, and then you're, you can start guessing keys. Um, so, both of those things are not very ideal. Um, so, yeah, we've seen all of these different problems and how we've, uh, managed to, uh, it's, uh, uh, have these techniques to kind of bypass what developers are doing with, with, uh, their encryption. Um, so there's ways that we can optimize a, uh, basically key cracker for this. And we can abuse, uh, a lot of different techniques to make this insanely fast. Um, so one thing we can do is use parallelization. Um, obviously, you know, if you want to write up any form of brute forcing, you're going to have to parallelize your workload. Um, but we can actually parallelize in multiple ways here. Um, so we're trying, right, a bunch of keys. You can, you know, do all of those in parallel against your ciphertext. But you can also, um, uh, AES itself in, in certain modes, um, block modes, are, is parallelizable within the actual operation that you're doing. Um, so we saw, like, ECB had all those, you know, s- like, no, um, it wasn't, like, streamed together. And that means that we can even parallelize there. Um, so that leads to massive speed up. Um, and also, for, uh, block, these block modes, uh, you can also introduce this technique where, right, we're, we're looking for checking things that we know to be there to validate whether our key guess is correct. And for something like PKCS padding, um, we're, we're, we're, we're, we're, we're, we're, we're checking, um, we, that padding is only on the last block. So if we had, like, a 40 block message, I can throw away 39 of those blocks and just decrypt the last block in these certain modes, and I can check the padding. Um, and then if it ends up being, you know, an interesting result, then you can go back and decrypt it fully. Um, but for the purpose of just finding our, our keys that are probable real keys that the developer used, uh, you can use that. Um, and we can see that here, uh, CBC itself is actually, you're able to do this, um, last block decryption, cause you just need, um, right, the last block of the ciphertext, your guess key, and then you can see at the end we're XORing the second to last ciphertext, uh, block, uh, into that decrypted result. Um, so that cuts out the whole rest of the chain before, um, and ECB mode, yeah, it, it's, there's no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no. Nothing complicated about just doing the last block there. Um, another optimization we can do for our tool is early exit. So, these are just the block modes for a stream, or for a symmetric cipher, but there can be, uh, basically streaming modes, basically, uh, that don't allow us to do that last block decryption. Um, but with this, we can do an early exit, right? Uh, so if we know we're looking for ASCII, we know, we know we're looking for, uh, say, JSON, uh, we can, uh, exit early once we don't satisfy any of our parameters. So, we're basically doing block by block until something is invalid, just throw it away and continue cracking with the next, uh, key. And, um, yeah, another thing we can do that's, uh, pretty interesting is, uh, AES uses, uh, it has, internally, the block cipher has many different rounds and it has these subkeys that it derives from your guest key. So, if you were to pre-compute all of these subkeys, uh, you can um, it's possible, you know, like that you can, uh, save on space, performance, et cetera, by pre-computing. Um, and so, for optimization, right, we're, we're wanting this basically to run as, as fast as possible. Um, so, there's a lot of different choices of hardware, uh, basically, you know, CPU, GPU, FPGA, ASICs, where do we start, really? Um, so, with CPUs, um, they're, they're, they're good. Um, they support SIMD instructions, uh, which basically allows you to handle more data than you normally would. Um, but, uh, for AES, it's unfortunate, SIMD instructions don't actually apply, uh, cause AES is a little bit longer than those instructions. The, the data, internally, is a little bit longer than those instructions. Um, so CPUs can definitely do it. Um, but, yeah, we'll, I'll get back to CPUs later. Um, and then, uh, the, the, the, the, the, the, the, so graphics cards, everybody knows, graphics cards for pa-, for password cracking, hash cracking, all this stuff, yes, they are really fast for that, and highly parallelizable. Um, and they have that great advantage, but, um, there's kind of been back and forth, which is better CPU, GPU, um, so I will settle that debate after I explain, uh, FPGAs and ASICs. Um, so, FPGAs, we looked into it, um, basically, uh, you can program, uh, you can program, uh, you can program, uh, your FPGA to basically do the, like, at the gate level, your programming, uh, like, uh, yeah, your programming gates, and then you can create specialized hardware, whereas, you know, on CPUs, you're running actual instructions, where here, we could have specialized logic that is at the gate level. And then, obviously, ASICs, I mean, it's the fastest you can get. You, you can manufacture a chip that's dedicated just to doing this, uh, decryption, um, but we don't, we don't have that kind of money or time yet. Um, so, it was kind of interesting to choose, but there's a twist, right? I, I was holding off on the CPU versus GPU debate because, actually, in 2008, Intel introduced dedicated AES instructions. Um, so, basically, right, where, you know, SIMD wasn't quite enough to, to support AES very quickly at a hardware level, um, AES and I, uh, basically, is specialized hardware in probably most of your CPUs that does this very common encryption incredibly fast. Um, and it's great for parallelizable workloads, and that's exactly what we have. Um, so, we can basically just flood our AES and I instructions and just, just go all out into this and crack insanely fast. Um, and GPUs are still valuable. Um, and, and, and, and, and, um, they're still valid. Um, if you have a password cracking rig or know someone who does, they're still valid for this. Um, but in this case, AES and I is such a widespread thing, um, that it's, it's perfect for this application. Um, so, we can see some benchmarks here. Basically, we can see with the eight cores, um, it's, uh, beating out the GPU at higher ends. So, like, somehow, you know, an eight core CPU is destroying this GPU. Um, and, and, and, and, and, and, and, and, and, and, and so in this test, um, this was not done by us, but in this test, um, basically, there's also the consideration of price when you're building these, and the GPU is before the sale and after the sale, um, more expensive than the CPU that they used. Um, so, CPUs are way more cost effective for this and actually there is.. And the CPU is refurbished too. Yeah, and the, the GPU is actually refurbished too, so, and the CPU is new in this case. Um, and in the test, um, this is an actual Um so CPUs are definitely the best in as far as cost effectiveness and uh so then there's this, the Atomic Pi which has a CPU with AESNI and it's 50 bucks. So theoretically you could just rig like as many of these as you want together, create a computing cluster and just deploy uh like basically run all of those AESNI instructions across all of those relatively cheap devices. Um so yeah AESNI provides a good speed up um but uh we need to utilize it effectively um and and we can do that with our tool. Yeah. So I know this slide says limitations um and as I was writing it, it really should have been limitation um but the great news is that as I was writing this and having conversations with people about this and doing dry runs with uh friends and colleagues and and and what not, um what I came to realize is that this wasn't actually that big a limitation. So this is, this slide is a bit of a misnomer uh from the get go. So this is the limitation. Um one thing that because we are talking about real world, we do need to take real world uh uh design choices into consideration. Something that developers who don't really understand cryptography would not want to do. So the one thing that developers will do which is most of them, let's be, let's be honest um what they will do is take the IV and say I don't know what to do with this. Uh they'll look at the documentation and say it this needs to be, they see this needs to be a random uh value of 16 bytes or whatever it is. So they will choose a random value and then hard code it and use it for every single operation. Um which is not how an IV is supposed to use. So let's go back to the first slide. So I'm going to show you a picture of a key that is used to be used. It's supposed to be different per operation. But what's really common is the developer doesn't understand what an IV is for. They just know it has to be some value. And so they will pick a random value and keep it secret because normally you're, you're, you know if you don't understand cryptography you're thinking well I have to keep the key secret I probably have to keep this secret too. So they just have these two different hard coded values. And so if you have a single block of some of the ciphertext in CBC mode and you have your IV kept secret, the best that you can get without the IV, you know, even guessing keys, is a value that is the real plain text of the message XORed with the initialization vector. Um, and this basically boils down to the one time pad problem. As long as you've chosen your IV correctly, there's really no information that you can get with this. There's nowhere you can go from here. But, because developers generally choose a single fixed IV and keep it secret, if we can get more than one message, uh, we can do something with this. So, this is, you know, uh, CBC decryption enhance. Um, and so when we look at the first block, the decryption starts out with a block cipher operation in decrypt mode. Um, and then, uh, you know, you have a block cipher operation in decrypt mode. And it continues on with an XOR unmasking step. So, we take this sort of halfway decrypted block and we XOR it, um, and we get about here. So, we have, you know, we have the IV XORed with the plain text. Now, if we have two or more ciphertexts that are using the same IV and they're single block messages that had this limitation, um, what we're going to do is we're going to do a BIM beautiful. Oh, that's funny. Write us a letter, dude. We can actually do something here. So all printable ASCII characters start with the bit zero. So, we know that the first byte of a message is always data. Anything after that could be data, could be padding, up to the last byte. So, we can look at the first bit of the, uh, the first byte and it shouldn't change between messages, because the IV is always going to be the same. So the first bit of the IV is always going to be the same. And so we have something that is zero XORed with the first bit of the IV in the case that we're dealing with printable data, which is generally a strong assumption to make. Um, so we know that if that first bit changes between encrypted messages, between sort of half-decrypted messages we'll call them, with any given key, we know that it's not the correct key. Because we can make the strong assumption that that first bit is always going to be a zero. And whether that's flipped or not because of the, the first bit of the IV, it's always going to be the same. So, the other thing that we know is that the last byte of the message can only be between certain values. Um, if we're doing, dealing with an 8 byte block cipher, the largest value that we can have is 8. If we're dealing with a 16 byte block cipher, uh, the largest value that we can have is 16. So, for, uh, for any given message, we know that the last byte is always going to be padding and therefore will always be at maximum 16 or 8, depending on what we're dealing with. So, for a 16 byte block cipher, a 128 bit block cipher like AES, we know that the first three bits are always going to be zeros. So we can check the last, the first three bits of the last byte of any given block cipher. We can message and be, uh, and throw out any key that doesn't produce the same first three bits in that last byte. Um, so, that's pretty rad. Um, we can also, uh, because we're assuming ASCII printable data and either null byte or PKCS7 style padding, we can assume that every single byte is going to start with zero, whether it's a padding byte or a single byte. So, we can say, we get a data byte. Now, for 64 bit block ciphers, this means we get seven bits of data at the, one at the start of each byte that isn't the last that we can reliably say should be the same across all messages. And for the last byte, we can say we get, uh, four bits because the maximum value is eight. So, it should start with zero, zero, zero, zero, regardless of the value of the padding byte at the end. That gives us 11 bits. And what this means is we have two, two to the eleven times n, uh, uh, possibilities, um, and only one of those possibilities is a false positive. So, for two samples, that's a false positive chance of one in about four million. Uh, and in, with three samples, that's about 8.5 billion. Um, and this is if we have secret, fixed IV, single block CBC ciphertext, which is, you know, not always the situation we're going to end up in anyway, but we can deal with this. And it, as it turns out, if we just have two samples, we already have an incredibly practical attack still. And for 16, for 128 bit block ciphers like AES, it gets even better. At two samples, we have a 68.7, uh, uh, one in 68.7 billion false positive chance, which is insanely practical. Um, and so, once we get to three samples, it's like I'm not even going to bother trying to, like, read that number aloud because that's, you know, that's a phenomenally good chance. So let's talk about the tool. All right, so basically, we wanted to actually make this practical, um, so, we had to show, build a tool to show it's legit. Um, but, we actually didn't have water in it. We had to So we came up with AES Burst. Um, yeah. So basically right now it just supports ECB, CBC and CTR modes. Um, and it has a couple of those optimizations that I was talking about. Um, it does use AES NI currently and it's fully multi-threaded. Um, so, uh, basically what you can do with the tool is you, you find, uh, some sort of encryption scheme that's vulnerable to what we've talked about. And you can use your own word list, whatever you want. Um, and we provide a conversion tool. The word list will use different approaches to convert that, uh, word list into, uh, possible keys. Um, and then, uh, you can run it. And we get some very good, uh, performance out of this. Um, so the blue here is, uh, is, um, is, um, the uh, our first implementation, which was in Python. Um, and it, you know, it was a single thread. Performed well. Um, and we're getting, like, 125, uh, thousand, um, keys per second. So pretty decent. And the multi-threaded one that I produced, uh, was, uh, basically double the speed. So, um, we're getting amazing, uh, performance out of this. Um, and, um, we're getting, like, performance optimization here. And the thing about this is this is all running off of just a laptop. Um, so I'm getting about, like, 250,000 keys per second off a single laptop, you know. Um, and you can imagine how this would be in a computing cluster made up of all of those atomic pies that I was showing earlier. Um, so yeah. And, and that, that was for ECB mode. CBC mode, very similar results, um, because of the optimizations, like, last block decryption and all of that. We get very similar, similar results to ECB from a more complex thing like CBC. Um, yeah. So, unfortunately, no demo today. I'm sorry. Um, but yeah. Future work. So, um, the, unfortunately we had, uh, some AV issues that prevent us from showing it to you. But the code is available. Um, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and and, and, and, and, and, and, and, and, and, and, and, and, and. We probably, uh, uh, can you, can you give everybody the URL where you can get the tool? Um, so it will be on my alright. So that sounds good. Um, so this is, this is using a really amazing Beast for it. Um, so it will be on my Github, uh, Ghostpep, um, and the tool is AES burst. So you should be able to find it just by typing AES burst into Github. And, yeah. So we talked a lot about, uh, about, um, various techniques that we, we, we can use to do, properly, um, practical key cracking attacks. Um, but not every one of them is built into AES Burst. Um, so the plain text scoring, the, uh, that, that could be used to sort the results and it isn't currently. Um, we can add more key derivation methods. Um, currently we support only a few of them. Um, we can, uh, you know, I, as I mentioned that limitation section late on was when I realized that this technique could work. So, uh, that's not in there. Um, we could add distributed computing support, possibly via Kubernetes. Uh, so we can just tie a bunch of existing computers, uh, uh, together. Um, we could, you know, throw a bunch of atomic pies together and create the cracking cluster that we, we talked about. Um, I think that, that the final word is not necessarily out on GPUs versus CPUs because at some point in the future, some point there might be a work load large enough and so, uh, so to be massively parallel, parallelizable, uh, such that we might be able to get slightly more, uh, performance out of GPU versus CPU, but we get so much great performance out of the average CPU. And this is across Intel, uh, uh, CPUs, AMD CPUs, you know, like if, if it's in your laptop and you got your laptop with you right now, I would bet that if, uh, um, it will work, it will work just fine. Um, uh, that your laptop probably supports the AES and I instruction set. Um, right now we only support AES 128. Uh, AES and I instructions support AES 128 and 256. Um, but we can also, like this, this technique is not specific to AES. It, it, the techniques that we presented today should work with any block cipher or stream cipher. Uh, it is a, a, an algorithm independent set of techniques. Um, we'd love to work with established pass, password cracking groups like, uh, CoreLogic or Hashcat or who, really whoever wants to work with us, to be honest. Um, because, you know, it's one thing to produce a tool that implements this and it's another to produce work for some group that already has wide adoption where they can just roll out an update and suddenly your favorite password cracking tool can do AES key cracking or whatever else as well. Um, and it's something that they're not currently doing today. Um, we can also add support for AEAD cipher mode. So, this is something where when you get the correct key you know it because you already have, um, sort of an, uh, an authentication, uh, built into your cipher mode. So, that is another way that we didn't even discuss that you can validate your key guesses. So, but we're not doing that currently. So, there's a lot of room for future work here and this is sort of, uh, where we want to call everybody to action. Like, this is obviously, we've shown, we've done the calculations, it's an incredibly practical attack. We've built a practical tool that implements this on a basic level and it still works. We've, you know, uh, we've, um, this, this, this is a practical technique. And now what we would love to see is for you to take this and run with it to go as far as, you know, the hash cracking community has gone with password hash, uh, cracking, uh, and do the same with encryption keys. And that's, that's really what I personally hope to see. And I think I speak for the other Daniel as well. He does. Yeah. So, confirmation. We have confirmation. And, um, I, I'm sorry, but I haven't been able to see if we are, uh, good on, five minutes? Okay, thank you. I can finally see you. The lights are fantastic, but, you know, a little blinding. So, at this point, we'd like to open it up to questions. Um, does anybody have, does anybody have questions? I see, I see somebody raising their hand back there. Uh, do we have microphones for questions? Or, we, we're, we're, we're, we're, we're, we're, we're, we're, we're, we're, we're, we're, no. Okay. Um, can you just shot your question really loud and then I'll repeat it into the mic for the recording? So, um, the question is, um, one of the, the, the keys that I'm using um, are needed to to get out the big things that we've done here is validate the padding on block ciphers to check whether or not we've got the correct key. And do we, is there a padding method that has been standardized that randomizes the padding? So there is. There is a padding scheme which is referred to as like a ciphertext stealing padding scheme. Which, so for instance in CBC mode, um, you take whatever the ciphertext is of the second to last block and you use bytes from that, uh, after a fixed byte to say, you know, here's the, you know, here's the, um, here's the, uh, the, the bytes. Now, while this does prevent against certain attacks like padding oracle attacks, this does not actually, uh, prevent, uh, the, uh, the, uh, the, uh, the, uh, the, uh, the, uh, the, uh, ability make a meaningful difference for our attack. Because any padding scheme that you can validate which really should be all of them based on what padding is used for, um, we can validate it. So, you know, even if you're, um, even if you're stealing ciphertext from the second to last block, um, it needs to be something that you can validate during decryption. So we will by design always be able to use this regardless of the padding scheme unless it's a really shit padding scheme. So, great question. Thank you. Are there other questions? Go ahead. I saw that whenever you ran it, it seemed to be better, right? But was it actually linear? Is there any instructions that could be available independently? Or is there some limitation there? So, our results in benchmarking would, actually, I'll give this to Daniel since he was the one who did the coding and the benchmarking. Oh, yeah, repeat the question. So, the question is basically for hard limits on, like, the multi-threaded version and, basically, you saw that it was linear. So, in this case, linear is, as far as, like, complexity, time complexity of the, of what we're doing, linear is best case, right? Anything other than that would just be wasteful. And you can't go below linear if you're doing, you know, the N keys against one ciphertext that's, you know, O of N. So, we want linear, it's just, can we, can we get it faster and, you know, changing it from, oh, you can decrypt this single threaded in, in a week versus can you do it in an, in a weekend, right? Yes. So, that was on four, a four core and in that case, so AES NI is actually on its own die in your CPU. So then you're limited by what your CPU technically has. Um, in this case, on the test machine it was, uh, I had four, I was able to run four at, at a time. Um, so you're limited, not by necessarily your cores, you're actually limited by the AES hardware that you have. Um, which is why, uh, the atomic pies are so interesting is because, uh, you can, uh, you can run, you can run, uh, a because, yeah, the CPU itself, right, from a traditional standpoint, pretty crap. But it's, it's $50, right? But it has the exact same AESNI instructions and for, for us that's, that's already our, our bottleneck. So, that's why those are so attractive, really. Um, because it's mega cheap for a specific part of that CPU that we're targeting. Alright. Okay. So, it looks like we're out of time. So, uh, if you have additional questions, uh, do we have, uh, sorry, do we have a, like a, an after room or? We do not have an after room. Okay. Uh, find our attractive, beautiful faces that are unmistakable and ask us any questions that you might have that you were not able to later on. Um, we will be around the conference. So, uh, thank you for coming. Uh, have a good DEF CON. Thank you.