Chris Hickman and Jon Christensen of Kelsus and Rich Staats of Secret Stache begin a series of episodes focused on encryption - starting with the essentials.Â
Some of the highlights of the show include:
Encryption: Everybody depends on it, but most donât understand itTransmitting sensitive information, such as credit card and social security numbers, via the Internet is taken for grantedKey to Encryption: Plain text converted to ciphertext (no resemblance to original)Encrypt Everything: Most major browsers requiring Web traffic over secure port Whatâs the difference? End-to-end vs.at rest and in transit encryption Encryption Types: Hashing (one-way function) and Salting (added secret to hashed) Encryption Methods: Symmetric and asymmetric (public) keys, including DES, TripleDES, Blowfish, and TLS I am who I say I am: Trust, identify, share, and sign
Reddit
Links and Resources
Transcription
Rich: In episode 73 of Mobycast, we start a new series on encryption and dive into the essentials. Welcome to Mobycast, a weekly conversation about cloud-native development, AWS, and building distributed systems. Letâs jump right in.
Jon: Welcome, Chris and Rich. Itâs another episode of Mobycast.
Rich: Hey, itâs good to be back.
Jon: Yeah. Good to have you back. Chris, what have you been up to this week?
Chris: As Iâve mentioned several times on the podcast, Iâm a cycling nut.Â
Jon: No spoilers, please. Iâm a couple days behind.
Chris: Come on. Okay, fine. So be it. Let me just say, it will not disappoint as far as drama. Weâll put it that way. Itâs amazing the last few days.Â
Jon: Iâm almost done with [...]. Theyâre about to start up the [...].
Chris: July is definitely the month of Tour de France. My wife is equally a cycling nut following the pro peloton. During July, we joke that our kids become tour orphans. Itâs quite a bit of commitment. Itâs 4â5 hours of coverage everyday. Weâre done except weâre actually behind on the final stage, on the [...].
By the way, we subscribed to DIRECTV to watch this, this year. You just do it all over the intertubes, donât have to have cable installed or get a satellite dish, but the software is just absolutely horrible. They say itâs in beta but it was in beta last year when we got it. Itâs just often terrible. Weâve had so many snafus this month. Weâre trying to record it and it drops in recording and not recording things.
NBCSN for some reason on yesterdayâs stage, the last stage is they decided to switch channels midway through. We said weâre DVR, right? Weâre watching it. We think we have the whole stage and then, no, itâs missing the last hour. Theyâre like, âAlert, switch over to NBC to see the rest of it.â But we gave you [...]
Jon: Thatâs so terrible. Itâs only available on [...] probably because a lot of DIRECTV developers are in Denver and thereâs a new shiny thing in town for them to go work for named Slack.Â
Chris: Weâre done with it. I am cancelling today.
Jon: How about you, Rich? What are you up to?
Rich: Weâve been busier than weâve ever been. The idea of project portfolio management is becoming pretty important. I really didnât know what that was until a couple of months ago. Itâs like the birds eye of a few of all projects. The idea of using Gantt charts and trying to figure out how you can jigsaw puzzle human resources so that you can layer projects in creative ways so you can get more done.
Trying to figure that out, which has been challenging since I donât have any experience with project management, so Iâm learning as I go. Weâre not at a point where itâs already a problem. Iâm doing this ahead of time, but nonetheless, itâs challenging to put that out on and be effective when you donât know what youâre doing.
Jon: Yeah. Youâre not talking a little bit about it and Iâm excited to see your journey.Â
Rich: Yeah.
Jon: I have a quick story to you. I had to get a new file cabinet. I had bought one on Amazon which donât do it because I spent $250 and some freight company came and dump it like itâs a totally dented piece of trash on my lawn. I had it sit there for another month while waiting for the freight company to come back and get it. Do not do that.
Chris: You can take it to Whole Foods.Â
Jon: Yeah. Simply drive over to Mount Pass to get to Whole Foods. Anyway, yesterday I saw one on classifieds. It was $75, I went down there, and I met the guy in this fancy neighborhood called [...] to pick it up and I was like, âThis really seems like a good deal.â Heâs at his driveway, I walk up to it proprietarily looking like, âOh yeah, Iâm definitely going to buy this.â Opening drawers and heâs like, âI donât know why my wife put this up for sale. I asked her and she said, âWell, it doesnât have any files in it.ââ I was like, âBut youâre putting it up for $75?â and he goes, âThat things costs $1300.â I was like, âOh, maybe I should be a little bit more polite and thankful and not just like, âYup, Iâm taking it.ââ
Chris: Was it plated in 18 karat gold?
Jon: Itâs pretty fancy. Honestly, itâs all wood, file cabinet is pretty fancy. Iâm excited, I just got to move in to my office. But thatâs not what weâre going to talk today. Letâs talk about encryption. Everybody depends on it, everybody talks about it all the time, and itâs one of those things that is not very well-understood.
I was having a conversation with one of our clients over ZooPix the other day, trying to talk about implementing a new direct messaging feature and we want to make sure itâs really lock down. Weâre talking about the difference between end-to-end encryption, making sure things are encrypted at rest and in transit, and it was quite explained. There was a lot to talk about and make sure that my client whoâs not a developer, whoâs a business person, was able to understand and make a decision because it affects his budget and the companyâs budget, and they want to spend their budget wisely.
The people listening to the podcast, you probably know a bit more about encryption maybe than my client, but thereâs so much to it and itâs so fascinating that we should get into it and talk a little more in detail. You want to kick us off, Chris?
Chris: Yeah. Absolutely. Encryption is one of those things we take for granted. Itâs there, it underpins so many things that we use like the web, things like https. Itâs pretty important whenever weâre transmitting anything thatâs sensitive information whether be credit card information, or security numbersâ or whatnot. Encryption definitely is important.
We know it needs to happen. Itâs a little bit of a black box for most people. How does it really work? What are the different types of encryption? Thatâs what weâre going to talk about today. This is going to be a multipart episodes on encryption.
To start off, weâre going to talk about the essentials of the encryption. What is it? What does it mean? Encryption interest versus transit, the major types of encryption, and how they work. Hopefully, itâs going to be pretty interesting and fill in some of the gaps that folks have out there like what is encryption? How does it work? Which types should I use?
Jon: When I was in college, I remember there were a demand among my peers and our computer science classes, thereâs a demand. Everybody was interested in it. I canât remember which class it was where I was introduced. I remember John Regor, the professor was the one that taught us. He taught us public key encryption and how it worked. I remember he said stuff like, âDo not share what Iâm putting in this board with anyone because Iâve just written down something that would be illegal if youâre going to share it with certain other people.â Weâre like, âWoah. This is cool.â The reason was because itâs got this reputation of being hardcore. When youâre dealing encryption, thatâs when you started to get hardcore with computer programming. Would you agree, Chris?
Chris: What I would agree is the actual cryptographic algorithms are intensely hardcore. It is a method, it is purist, and itâs incredibly complex. It is very, very difficult. Youâre trying to come up with an algorithm that is going to be very, very difficult to reverse engineer, to crack. Given how fast computers are evolving, things like Mooreâs law and transaction, how many operations per second computers can do, itâs up to the algorithms to become more complicated and to have more entropy in them. There are slight changes in data and you want your cryptographic algorithms to have big changes on the output. You donât want to be able to climb patterns in it. Having a really good strong cryptographic algorithm is very hardcore. You need the PhD and math and teams of people.
This is like a weapon [...]. Governments put lots and lots of millions and millions of dollars behind this stuff. The good thing is we donât have to. The normal people using encryption donât have to know the exact details and the proofs behind them. We can pop up a level or two.
Jon: it maybe instructive especially for anybody thatâs newer listening. I remember seeing an NSA catalog in the computer science office at my college. If I had seen that thing before I learned the cryptographic algorithms, I might have been like, âCool. NSAâs super cool cryptography. Yes, I want that,â and I might have applied, but fortunately, I saw the magazine, the pamphlet after we learned the cryptographic algorithms. I just remember learning them to me like, âI donât think I spend a lot of time thinking about that.â
Chris: Itâs [...], that excitement, that shame, that super secret agent, 007 away from it, right?
Jon: Right, but using this stuff is not that hard as you just said and itâs so important. Letâs talk not about how algorithm systems work but rather the practical use of this stuff because that is not only not hard but absolutely expected and important.
Chris: Exactly. Maybe starting off with the definition. What is encryption? What is it? Really quite simply, itâs the process of taking some plain text and you convert it to something that looks like gibberish. Itâs ciphertext. Youâre just transforming your information that you want to be kept secret into something that has no resemblance to what it originally was. Thatâs what we called ciphertext.
Some of these encryption methods require a key and thatâs key to the whole encryption algorithm. Itâs a secret thatâs known, thatâs part of that transformation, function to change that plain text to ciphertext. Use cases for encryption are many. It boils down to you have information thatâs sensitive to you donât want other parties that should be able to see it, be able to understand it.
Cryptography has been going on for thousands of years in various forms, where people, governments, civilizations have secrets that they want to keep within their ranks and donât want to share with others, whether it be a codex or like the example of World War 2, trying to send communications to the different armies. England trying to crack the transmissions from Germany and vice versa. Itâs been going on for a really long time.
That core use case of, âI need to easily make this message secret so that only the people that I want to be able to decode it can,â itâs at the core of it. Everything we do today has use cases whether be, again, like sending our credit card information over the internet, whether weâre storing sensitive data on a database server, we want to have secure communications from point-to-point between ourselves and someone else. Things like WhatsApp, thatâs one of its big features, encrypted communication between users. The WhatsApp server donât even know, canât even read the messages, itâs only the recipients that can read it.
Jon: Itâs better saying that even stuff that doesnât seem to need to be encrypted really should be these days. Itâs like encrypt all the things and the reason you should encrypt all the things is because bad actors, whoever they might be, are able to tell so much from contacts now, that if you just encrypt everything, then they canât really tell anything. Even if all youâre doing is looking at cheese-making recipes, put them on https. That way, whatever bad actor might need to know something about you canât use the fact that youâre looking at cheese-making recipes the day before, as a way of triangulating what youâre up to.
Chris: It sound silly, right? But with the machine learning and AI, that context can actually end up becoming useful. In the past, we didnât necessarily encrypt all the things just because there was such a performance penalty to it and it was also a lot more difficult. But now, itâs so simple to do, itâs so easy, and there really is very negligible in the way of performance.
In fact, most of the major browser now are moving to the point where theyâre requiring that communication, the web traffic is over TLS. Itâs secure and theyâre showing warnings if itâs not over a secure port. Encrypt all the things, Werner Vogels, CTO for AWS is famous for coining the phrase, âDance like everyone. Dance like no one is watching but encrypt like everyone is,â which is a good one.
Jon: I guess weâre going to talk about three different types of encryption now starting with hashing.
Chris: Maybe before we get into that, why donât we talk a little bit about where to encrypt. This is where things in terms of encrypt in transit and encryption at rest come in to play. It just makes sense to talk about those two things in general and it really boils down to what is it that you need to secure? And when are you going to use one or the other?
Encryption at rest, quite simply just means itâs data thatâs encrypted at where itâs stored. Itâs wherever itâs persisted, whether be in the database, or file system, or whatnot, it gets encrypted before itâs actually persisted. In its restful state, itâs encrypted and when something wants to read it, it reads the encrypted data and then decrypts it to be able to inspect data. Thatâs encryption at rest. Anything that youâre persisting, youâre storing in a database could be your credit card numbers in a PostgreSQL table, those need to be encrypted.Â
Jon: Or it could be just encrypting cute pictures of pets and things that people say about them, which is what we do on ZooPix.
Chris: Absolutely. Again, encryption at rest is one of those things that, in the past itâs much more complicated and expensive. Now, in the quad-native world, itâs one of those things where literally itâs a check box option. Itâs like, âWhy not do it?â
Jon: People get Twitter-pile on if the check box isnât automatically selected.
Chris: Yes. Then, we have encryption in transit. This is the data moving. Itâs going from point A to point B and as it travels from point A to point B, itâs encrypted. This is really to protect against things like eavesdropping.
Anything over the internet, any kind of traffic, you do not have a direct pipe from your machine to whoeverâs machine is youâre talking to. Youâre going through many, many hops along the way. Youâre going to many different servers, routers, and whatnot. Thereâs always a possibility for eavesdropping there. Thereâs also the possibility for folks to spoof on destinations and redirect traffic. Because of that, encryption becomes really important and you need to protect that.
Encryption in transit is just that data is moving, itâs going from point A and point B. Before it gets sent over the wire, it gets encrypted and then when the receiving end receives it, they can then decrypt it and read it. And make sure only the recipient has the ability to decrypt. So, thatâs encryption in transit.Â
Jon: Great. Now, weâre going to talk about types of encryption and you can tell us about that.Â
Chris: Yes. Weâll talk about the three main topics here. The first would be hashing. Definitely, this is one of those core foundational aspects of encryption but itâs not encryption necessarily, in and of itself. Hashing is an algorithm that, given an inputâ the thing that you want to protectâyou pass it through this hash algorithm and it gives outputs, some obfuscated hashed value or sometimes we call it a digest.
Itâs a one-way function. The same input input to this function will always produce the same hash and because it is one-way, it is impossible to do the reverse. Given just the hash value, you canât go back the opposite direction to get to the original data. Itâs a one-way function.
Also, given the particular hash value or digest, a good hashing function is going to be infeasible to create another string that would produce the same hash value. Thatâs called collision. Thatâs a common term that people may have heard like hash collision. Thatâs really where you have two different keys or input strings that produce the same hash value, that would be a collision and thatâs bad. A good hash function will make that very much infeasible that the likelihood of that happening is very low.
Jon: I guess that is important though. It definitely does happen and even the best hashing function have, for any given hash, there are infinitely many ways to make a collision, but itâs just really unlikely because thereâs infinite potential data inputs. You can keep trying them and trying them until you get another one that produces the same value.
The values themselves are not infinite. There maybe 36 and 48 characters long, so thereâs just so many of those. But there are infinite possible inputs. Therefore, for each one of the potential output, there are infinitely many ways of achieving it.Â
Chris: The important thing with this hash is usually the way when these are used in practice. What ends up becoming important is the actual digest itself. Thatâs whatâs used to figure it out whether or not this is the correct value that you want. That is the secret. The hash algorithm gets applied by two different parties and if they come in to the same result.
Jon: Yeah. Thatâs [...] for. Can I trust that this thing is the same as the other thing?
Chris: If you do have a collision, thatâs a really bad thing because it means you donât need to even know the secret to be now where the other side of things that you do know it. A good example would be a password. If you had really bad hash now, looking for your passwords, if I type in my password is foo and someone else guesses it and guesses bar. If it turns out that foo and bar both hash to the same thing, then the server is just going to just say you have the correct password. They donât but the hash value is the same. That would be an example of a collision and thatâs a really obviously simplistic thing.
Jon: When I think about hashes, I always think about the graph of the function. I think about the x-axis as it goes along, those are all the different potential inputsâfrom zero to infinity of inputsâand the y is just the hash that comes out of it. I just imagine this almost solid thick line because every time you move one increment down the x-axis, your output value is way different that the one was right before it. Itâs just this up and down, up, down, all over the place.
Chris: You should not be able to plot a curve.
Jon: Right, exactly. So, thatâs what I think about. I donât know if that helps anybody that thinks in terms of math but I think about that.
Chris: Complete entropy is really what youâre going for here. Some examples of hash algorithms are SHA, MD5 and then bcrypt is a specific hash algorithm thatâs specifically designed for password hashing. Most developers are pretty familiar with bcrypt, especially when youâre dealing with passwords and storing passwords and whatnot. That is a hashing function that is based on the Blowfish cipher and it also incorporates a salt into it. The salt is incorporated to protect against brute-force hacking. This is, again, interesting.
First of all, think about all the different security attacks and hacks that weâve heard about in the last five years, so you have the really bad ones where services store passwords in clear text. Thatâs really hard to understand. But then, you have systems where they hash the passwords but they werenât salted. I really think [...] is LinkedIn. The LinkedIn password hack, I think itâs in 2012, they stored their passwords as hashed values but they werenât salted.
Jon: I want to just explain what that means. The input value, I guess youâve been calling that the key, so say itâs duranium or pizza dough. To every single one of those input values before hashing it, theyâll add XYZ or 1234, just some salts, some few extra characters and then theyâll add those 1234 to the end of duranium and then hash it. When a person types in their password, they type in duranium. Again, to make sure itâs the right password, the system will add 1234, that same salt to it, hash it, and see if itâs the same as what was stored earlier. Thatâs what salt is.
Chris: Righ. Imagine weâre just using the bcrypt algorithm, weâre not giving it any salt. Letâs just say weâre not using salt for whatever reason. We think weâre doing the right thing, weâre using bcrypt for hashing these passwords and storing the hash values. They type in duranium, that generates the gobbledygook, we think weâre doing well.
The bcrypt algorithm is well known, anyone can use it. This is the rainbow table attack. Really what it is, is just a look-up table. You just go through and start picking passwords, run them through the bcrypt algorithm, you now have the hash value. Now, all you have to do is if youâve got a dump of hash values that represent passwords, you just use up your look table. Once you find a match, now you know what the actual password is because itâs just the same algorithm, that is the rainbow table attack.
Thatâs what lead to the issue with the LinkedIn problem back in 2012. Salt is basically an extra secret thatâs applied to the algorithm thatâs very specific to that particular service or application and it has to guard that very closely. That ends up becoming the actual true secret here. It really is. For all intents and purposes, it is the key in that particular case. With that salt, itâs a new rainbow table. Unless you know that specific key, youâre not going to be able to do that same brute-force password attack. So, always salt with your hashing.
Jon: Excited as I am to go into it, I wonât but Iâll just leave listeners also with that hashing cryptography is whatâs use for blockchain as well. This thing that we just explained is at the core of how blockchain works and that going and all that.
Chris: Whatâs really interested too with bcrypt and bcrypt actually, the standard allows for an adaptive function. As part of the algorithm, you can tell it how many iterations it needs to go through to compute the actual hash value. They do this so that you can make it slower as computers get faster. It makes it more resistive to the brute-force search. It is similar to how bitcoin works, you can just make the algorithm more computationally complex as needed as computers gets faster and faster.
Jon: Super interesting.
Chris: It was something I learned the other day as well.Â
Jon: Cool. Shall we talk about symmetric key encryption?
Chris: Yes. Now, we can get on to the two main encryption mechanisms. Thereâs symmetric and then thereâs public key which is also known as asymmetric. Letâs first talk with symmetric. With symmetric key encryption, you know a single key. Itâs the same key thatâs used to both encrypt and to decrypt the data which means that in order for secure communication to happen between two parties, both parties have to know that same key. Lots of different algorithms out there that use symmetric key encryption to things like AES, Triple DES, Blowfish, RC4.
Jon: Everything was symmetric. Everything that you could decrypt was symmetric key encryption before the invention of public key encryption like secret decoder rings, everything.
Chris: Going back in World War II, when the Germans are encoding their messages, they were creating a key. They rotated their key daily but itâs symmetric key. They have a way of all parties needing to know what that key was, and the [...] have that key, you couldnât decrypt the message and then they would rotate it everyday. Symmetric key was the way to go; was the only thing really up until the early 70s. Then came up with a more secure way when you have to, so that you donât have to share one single key which has its limitations and we can talk about that a little bit more.
Jon: Do you know anything that you can share? I donât want to get too mathy, you mentioned 3DES, AES, Blowfish. Those are the ones weâve heard of. Do you know anything about generally how high-level what the math is doing?
Chris: At the very highest level, itâs a function. You have an input, you have some algorithm that translates it to an output. Itâs very similar to what we talked about with hashing so you want to have the most entropy possible, so there are no patterns there. You refer to these algorithms as being spongy, its sponginess of basically how much information can you soak up in your algorithm and hide it from the output.Â
Jon: I guess the unique thing about them is youâve got two functions, one that can produce this output and another one that can take the output and regenerate the input from it.Â
Chris: Yeah, very low level math. Again, it really boils down to the harder the algorithm is to crack, the better the algorithm is written more complicated. You can have a really simple algorithm like the key and you shift the character by three or something like that, there are simple rotations there. Simple, not very complicated from a mass standpoint, but also really easy to break.
Thatâs where the complexity of these things come into play. Trying to increase that sponginess of it, theyâre increasing the entropy of it, they are also getting to key lengths. Obviously, the more bits that are there, the more possibilities there are which makes it much harder to do from a brute force attack. Thatâs why, the original DES was 56-bit encryption and then, Triple DES is three times that. AES was 128-bit and now the standard is 256-bit.
Jon: I know it has something to do with prime numbers and I know there is some intuitive way of understanding whatâs happening. We can come back to that on the next episode, just spend two or three minutes and the next episode explaining in a high level whatâs happening in some of these algorithms because it would be interesting for people without getting into the details of the math.
The other question I want to answer, I imagine we are not quite ready for is I have not fully understood how we do things like make sure that something that short is just as impenetrable as something that is longer. If you have a tweet and you encrypt it, thatâs only going to be 256 characters or 240 characters max. What we are doing is to make sure that it is really impenetrable because 240 doesnât seem to be that many to be guessing or even fewer sometimes. If you have a chat transcript, somebody might answer with one word. What are we doing to make sure that if somebody keeps answering ,âYep,â that we are not able to be like, âOh, now I can see what yep is.â A couple of those Iâm curious if we can have intuitive answers for in the next episode.Â
Chris: Yeah, a lot of that boils down to how you use encryption. This is more up to the application itself and whatâs important. In that particular case, you may decide that you do it in batches or something like that to add to some branding. The algorithm themselves, because youâre feeding them some input, are going to give you an output. If the input is always going to be, âYup,â thatâs all it is that you keep encrypting then that maybe information. Itâs just going to be the same cryptographic output with the hash function. Some of these encryption schemes may involve randomness in the form of time or something as that as well that would feed into it which might help there.
Jon: Yeah, letâs revisit.
Chris: Cool. So, thatâs symmetric key encryption. The important point there is that both parties have to have that key. The big limitation with symmetric key encryption is how you securely get that key to everyone that must be able to read it. Thatâs where it gets complicated with the management of it and then also worrying what happens when that get exposed.
Jon: Itâs safe to say that it requires trust. In order to truly have symmetric key encryption, at some point in the transaction of handing keys to each other involves a little bit of trust. You have to trust somebody like thereâs actual personal trust involved.
Chris: The probably good example is password. Itâs like sharing your password with someone like better trust them.
Jon: In order for us to have a conversation, say you and I want to have a symmetric key conversation with each other, we have to exchange this key to each other, we have to, at some point, figure out a way to trust. âYup, itâs really me, Iâm really giving you the key, and now we can talk over it.â Iâm bringing this up because itâs going to be our segue in the public key which gets rid of that requirement.
Chris: Yeah. Letâs talk about public key encryption, also known as asymmetric key encryption. In this particular schema is the common terms that people heard beforeâ . You have a public key and then you have the private key. The public key is published, anyone can see that and that is generally used to encrypt messages. The private key is only known to the receiving party. Basically, the owner of the key pair. Theyâre the only ones that have the private key.
Someone wants to send a message to you. They go first and find out, âHey, whatâs your public key?â They get that, they now use that to encrypt the message and the message is sent to the user. Basically, that part is not secure. Anyone can see that message and the message [...] be secure because itâs a public key used for encryption which is known to everyone, but what happens is only the person with the private key can actually read the message. The decryption can only happen with the private key. This is the public key, private key, the math behind it is based on prime numbers. Thatâs how those two things work together. Where the math is involved, is how does it deal with prime numbers.
Jon: Right. That just makes it possible for people to be able to communicate with me without me knowing who they are and without even trusting that they are who they say they are. It lets them get me a message that only I can read and thatâs so important. The best use case thatâs happening all around us today is a whistleblower giving information to a journalist. Who knows who the whistleblower might be and what theyâre working for, but they need to be protected and the journalists wants to tell that story. So the whistle blower will use that journalistâs public key to send a message that nobody else can read. Maybe they can tell that a message found sent, maybe they can see the gibberish, but nobody else can know that the whistleblower are saying, âThis important secret meeting took place between these public figures.â Only the journalist will be able to tell that thatâs what happened.Â
Chris: Exactly. You hit some of the other issues like trust, identity, and making sure that the public key that youâre using is indeed who you want the recipient to be. Thatâs important. So, examples of public key encryption implementations are SSL, TLS. The key fundamental encryption that is for the web is this public key, other ones like RSA. PGP is probably one of the first implementations of these which stands for Pretty Good Privacy. That was back in the early 70s. So again, public key encryption, big improvement where you donât want to share secrets amongst these parties, but you can still set up this guarantee that only the intended recipient can actually read the message.
Jon: Thereâs one even further thing that we donât have in our outline and I canât describe it very well but I can give basically the gist of it which is being able to assign something with public-private key cryptography. Essentially, if I wanted to talk to you and you donât know who I am, Iâm going to use your public key to encrypt some stuff and send it to you. But I also want to prove to you that I really am who I say I am or at least that I have the key that I said I do because somebody else could have got my key. I really do have that key and I can do that by signing the message that I sent to you with your public key.
I canât remember exactly how that works but essentially, what it boils down to is thereâs some way that I can use my private key and your public key in a way that only I could give. Itâs basically, encrypting my own public key with my private key or something like that but basically, nobody else can do that but me because Iâm the only one with my private key and on your side you can see, âOh yeah. It must have been Jon that did that because when I decrypt this with my own private key, I can see that it turns into his public key which only he could have done.â Itâs essentially giving you my public key in a way that only I can do. I donât know exactly how that works but thatâs the key to making sure that people cannot just have conversations without trusting each other but also identify themselves like I am who I say I am.
Chris: Yes. Signing of secure messages or plain messages basically is the reverse to that, what we just talked about. Thatâs a way to further check to say, this is coming from whoever it is that they expect generated this message did to it. What we just talk about with public key encryption where the sender uses the public key to use the encryption. When they sign it, they use their private key for the encryption. The recipient is using the public key to decrypt the signed portion of it and itâs using their own private key to decrypt, to get the actual message contents.Â
Jon: The key here isnât knowing exactly how the sausages made but knowing what the use cases are because obviously, listening to this you might be like, âChris and Jon are certainly are encryption experts.â No, we never claimed that we are encryption experts but we know enough to keep ourselves out of trouble.
As a developer, if youâre making decisions on how to do something, how to implement something, thereâs just an area where you need to know at least as much to make sure that things are safe and things are at the data, when you tell your clients, you tell your boss that this is safe, weâve done the best practices, you need to get yourself above that.
As in everything, thereâs diminishing returns so why havenât Chris and I gone, why arenât we able to tell you every detail about each algorithm is because it really isnât relevant to our day job. Itâs not something that we would make use of day-to-day. Weâd rather spend that same time learning about new features of AWS or learning different aspects of business or what have you. Itâs getting above that threshold and thatâs weâre hoping to do is get you sorted to our level of understanding cryptography with these three episodes and then each will be all good.
Chris: Absolutely. Itâs good stuff in point for this particular episode. Next time, something will be fun just to dive a little deeper into the practical implementations of encryption and just doing a walkthrough, like how do these things work. Things like TLS, SSL, whatâs really going on there, how does that actually work, and generate secure web traffic. Look at how do you secure point-to-point communications where only servers donât/canât see the actual message because it is encrypted, that the encryption-decryption is between the recipients only, and how do you handle the case where you have multiple recipients which is an interesting situation.
Weâll also get into the practicalities, like what happens in the real world. Itâs not symmetric key encryption versus public key encryption. Usually, you use both of these and thereâs reasons for doing that. One, the public key encryption is very computationally expensive. Symmetric key is much less, so how can we use these two together in concert to have a really secure but also performant way of communicating.
Jon: Very cool. Looking forward to it.
Chris: Alright, guys.
Jon: Thanks so much. Talk to you next week, Chris and Rich.
Rich: See ya.Â
Chris: Alright, see ya.Â
Rich: Well dear listener, you made it to the end. We appreciate your time and invite you to continue the conversation with us online. This episode, along with show notes and other valuable resources is available at mobycast.fm/73. If you have any questions or additional insights, we encourage you to leave us a comment there. Thank you and weâll see you again next week.