Join Evan Johnson as he speaks with security professionals about recent security news!
All right, hello and welcome to Hacker Time. I'm Evan Johnson from Cloudflare's security team and today we are going to pick up where we left off last week and last week we were talking about chess and playing chess.
Maybe it was actually two weeks ago, but we were learning the rules of chess, doing some chess puzzles, and then we were, lastly, we were doing some harder puzzles and we got through the rules pretty well and we got the basic way that the pieces move and we got through the, what else did we get through, some basic puzzles, chess puzzles, and then we did look at a really tough one that we figured out and I want to show off, I want to kind of pick up where we left off and go one step deeper into the way the pieces move, look at some more nuanced ways that the pieces move since we got the basics, but there are some special cases in the game and I want to cover those.
Then we'll do some basic puzzles, some harder puzzles, and then I hope to play like a live game against somebody online and see how it goes and so with that I'm going to open up the practice, nope, wrong board.
I'm going to open up the analysis board here on LeeChess and start talking about chess.
So we covered a lot of these pieces.
We've covered the pawns, how they move, how they can move two spaces on the first move and one space after that.
We covered knights, how they move two forward and one to the side in any direction.
So knights are one of the, they hop around and they can be difficult to defend against because they're so mobile and can hop so much.
And then we covered bishops, how we have a dark square bishop and a light square bishop and how they're stuck on their respective squares or their respective color.
So they move diagonally in any direction and the bishop has to stay on the colored square that it starts on.
So my dark square bishop can never make it to the light squares and so if you have a, there's something known as an opposite colored bishop end game where I have my dark square bishop and you have your light square bishop and it's a draw because they, the game can't ever have a winner because the bishops just kind of move past each other and can never see each other.
We covered how the queen is the most powerful piece on the board and she can move in any direction as across the entire board.
She can move forward, backwards, diagonally, side to side.
She can't hop like the knight but she's the most, the strongest piece on the board.
And then we covered rooks, how they can move forward and backwards and side to side but only on their, either on the rank or on their file.
So this is what's known as a file. This is what's known as a rank and they can never move diagonally.
And then lastly, most importantly, your king. We covered how the king can only move one space in any direction and attack in one space, any direction.
However, the king is the most important piece on the board because even though it isn't the best for attacking, once your king is captured, the game is over.
And so if you move a piece into somewhere where, if you move a piece like my queen here, which is attacking the king, you'll notice this red stuff around the king.
That means the king is in check and in danger. And since it's the most important piece on the board, the rules say that black has to defend the king.
So some move to defend the king and prevent the queen from seeing it will have to be made.
And okay, so that's a great recap of like the way the pieces move. And, but there are some special cases to everything that I've said.
So I want to cover the first one, which is probably the one that you'd see most often playing chess, and that's what's known as castling.
And so it's really common to see E4 openings where white plays E4, black plays E5 here, and you have a very symmetric looking board.
And usually when you're playing chess, what you want to do is just get your pieces to reasonable squares.
You want to what's known as develop your pieces so that they're active and they're not sitting back here doing nothing.
Because notice these pieces aren't really doing anything.
You'd have a lot better ability to attack your opponent if they're in the game.
And so castling, let me show you what castling is here.
You'll see white can actually move his king two squares instead of the normal one.
Normally the king can only move one square in any direction.
So to any of these, but actually if you have not moved your king yet, your king can actually move two squares towards either rook.
There's a few other rules as well.
And the rook will swap sides with the king. So the rook will hop over the king.
And this is actually the only time the rook can hop over any pieces as well.
And this is probably something that you'll see every game of chess.
And it's a super important concept. The reason for that is because it makes your king so much safer to be tucked away into the corner, much more difficult to attack.
And it makes your rooks kind of work together. Like I may have pointed this out last time, but your bishops and your rooks work really well together.
And when all of these other pieces are moved, I'll just do what the computer tells me to do.
When all of these other pieces are moved, I'll make a bad move, bad move, bad move.
Your rooks work together very well because they protect each other and both forward and backwards.
If you have a rook back here and a rook up here, it can be difficult to deal with when you're playing against somebody who's done that.
And your rooks here protect one another so that your king will be safe as long as your rooks are there.
And so castling is probably the most important kind of special move you'll ever see in chess.
It's so, so common. You probably want to do it every game.
And this is what's known as a kingside castle here. You'll notice that there's a king side and a queen side, the king side being this half of the board, the queen side being this half of the board.
And you can castle in any direction.
The kingside castle that we just looked at being more common, but you can actually castle the other way here.
Let's look at a different opening. We opened with E4 last game.
I'm going to open with D4 here. And after some moves, I'm sure this is reasonable.
After you do a little moving around, you can actually do the same thing where the king jumps two squares instead of the normal one square and the rook hops over.
But notice what happened on the queenside castle. The king is a lot further away from the edge of the board.
On this side of the board, the king was here and the rook was here.
And the king could actually defend this pawn on H2.
This is on the coordinate plane of chess. This is the H2 square. And this is the A2 square.
And the king actually can't defend the A2 square. It's too far away. So this square is susceptible to attack.
If this knight is currently defending it. But one of the drawbacks of the queenside castle is one of the intricacies probably to say of the queenside castle is your rook here is on this D file instead of here.
And it can be very different and lead to some very different end games. And there's very different reasons for wanting to do it.
But the big thing to note is that you'll see the kingside castle a lot.
You'll see the queenside castle less regularly.
But they're both legal. There's both different reasons to do it. And it's a super important thing.
You'll see it every game. So that's one of the kind of special moves that you can do.
And I want to show you another one now, which is what's known as capturing en passant.
And so sometimes you'll see cases where pawns kind of jump past one another.
So I have my pawn way out here on C5. And just to show you an example of what en passant is, if black plays D5 here, white can actually capture.
And you'll remember that last time we talked, I said that white or that pawns can capture kind of diagonally.
They walk straight forward and they capture diagonally.
And so when you have a bunch of pawns together, they're much stronger and cover more squares.
And so you'll see, even though this pawn is gone, all my squares are still covered.
And so they normally capture diagonally in both directions.
But an en passant capture means you actually capture something to the side of you.
But it's only when you're on the fifth or the fourth rank and the opponent jumps past you.
One moment, please.
Sorry about that.
My cat loves to meow while I'm on Cloudflare TV. And so I let her out of the room.
Okay. Back to chess. You'll see this in games pretty common. It is a common thing to be aware of.
Maybe it doesn't happen every game, but it is something to be aware of because it's very unique to see it.
Normally this pawn is attacking this square and this square, but the rules are if this thing jumps past it two squares and you're on the fifth or the fourth.
So if I'm white on the fifth or black on the fourth rank, this being the fourth rank, this being the fifth rank, so I'm white.
So any of my pieces, any of my pawns that are on this rank, if a pawn jumps two squares past it, I can capture what's known en passant, which means in passing, and I believe it means in passing, and capture this pawn.
And it is a very interesting move, and that's the main reason I call it out.
And so that leads me to the most important part, the most important special move in chess, and that would be the whole point of chess, and that is I'm just going to move pieces around to get to where I want them to be, just to show a very contrived example of what I'm trying to show.
Okay, so we have a path here now.
So one of the most powerful moves, and the thing that can really swing the game the most in chess is getting your pawn to the other side of the board, and checkers has this concept too.
When you get to the other side of the board in checkers, you can begin moving backwards, I believe.
I haven't played too much checkers, but in chess, the intricacy is that when you get your pawn all the way to the other side of the board, you can choose which piece you would like it to become, a queen, a knight, a rook, or bishop.
And you usually want to choose a queen, because a queen is the most powerful piece, why wouldn't you?
But there are some cases where you wouldn't want to choose a queen, and those are very specific, and I'm not really going to go into them.
The main thing being, you normally want a queen, and now you'll see I've got two queens on the board, and I'm going to lose this queen instantly, because this example is just an example.
However, it is probably the scariest thing for an opponent to see your pawn getting up on the 7th, 6th rank, and having a path to queen by getting it to the opposite side of the board.
And that is above all the thing that can turn around the game the most, is if you have a passed pawn, or it's a huge danger for your opponent, and it can be hard to stop sometimes if you have a pawn that's isolated or has a clear path to the other end of the board.
So yeah, that's the basics, and we've gone over the basic moves briefly.
We looked at a lot of special moves, and I'm going to work on some puzzles here.
We'll do three kind of basic puzzles, and then we'll do a few harder puzzles, and then we'll maybe play a blitz game.
So this is an easier, lower-rated puzzle, and the first thing you want to do is count the material.
You'll notice one, two, three pieces, four pieces, and my queen.
One, two, three, four pieces, and a queen. I've got one, two, three, four, five, six pawns.
One, two, three, four, five pawns. So it seems I'm up a pawn, and my queen is attacked from two different directions.
This knight is under attack, and I believe a checkmate may be on the board for white, and so these two pieces are working together.
You'll notice that my rook is protecting my queen, my queen is protecting my rook, and it's happy days for these two pieces.
But how can we, the whole point of a puzzle is to convert it into some advantage usually, or stay alive if you're in a really precarious situation.
How can we actually, how can we actually do one of those things? And you usually want to look for the most forcing aggressive moves in a puzzle, because there's only one, there's supposed to only be one solution, and being forcing in your moves will kind of make sure that that's the case, that there's only one outcome.
And so the most forcing move I see is moving my queen to e1, which puts check on the king.
What would happen is black has to protect the, black would have to protect his king, and would probably take back here.
Another legal move would be here to block, but I'm not sure why they would do that.
And then rook would take my queen after I moved it there, and then I would take here, I believe the only move would be to block with his bishop, and then I could move my bishop here, and it's checkmate in one move when I go here.
I believe that is the case. So let's give it a try.
I might be wrong though. No, it looks like that worked out. And then last, you want to move your bishop to attack, and this is checkmate.
So that one was kind of tricky, because I wasn't sure if the bishop could block here on the first move, and then I just wouldn't be able to do anything.
And so that one was a little tricky for me, but usually this being the most forcing move kind of helped me out to understand what to do.
Okay, we'll do one more and then move on to the harder ones, because I would do think it'd be interesting to play a blitz game.
So count the material, I have two pieces and a rook, two pieces and a rook, and the most forcing moves, you want to make the most forcing moves, and this one is a very interesting puzzle.
So I could do this, but I just lose my rook, and I don't really have any follow-up for it.
There's no other move that I can do.
And what else am I attacking though? I'm attacking this pawn, but the pawn is defended by this, and that's no good, but I'm also attacking this.
And so the three things I'm attacking, this bishop, this knight, and this pawn.
And this is one of those, this is a puzzle where ordering of your moves really matters, because one really neat thing about attacking this pawn, even though it's just a pawn, once I have my bishop on the c4 square, the rook can't move.
The rook is stuck here, because moving it would move, would put his king into check.
So it's not a legal move. And so if I can, if I can get rid of this knight, then I can for sure take this, take this rook by moving my bishop to c4, because the rook can't move, and there's no way, there's no other piece available to defend this rook.
And so the correct answer to this puzzle will be rook takes on b6, pawn takes on b6, bishop takes on c4, the black pieces will make any move available, doesn't matter what, and then bishop takes on d5.
The puzzle will probably stop when I take this though.
And so let's see it. Yep, that's great. It worked. That was, that was a really interesting one.
So that, that was a pinned, that was a pinned rook right here, where it wasn't able to move, and so it's just free.
So actually the important thing to do is, I took three material, I, they took five material, so I'm down two, which is known as the exchange, when I took a piece worth three for a piece worth five.
Then, so I'm down the exchange, but then I get interest, and I make this, I get to capture this rook, which is great.
And I have, I'm up a whole piece against this person, and these doubled pawns won't, this pawn's going down for sure on the next move, and this is a great position for white.
All right, last one. What can we do?
So, oh, hmm, what do we do here? This one, a little tricky. I can do this, and that's probably the most forcing move, is a queen trade, but is that good?
In this case, it very much is good. So if we, if I do this, this is what's known as an overworked piece.
So I'm attacking this, and I'm attacking this, and so the king is defending both of those pieces, which means that this king is overworked.
The king can't defend both of those pieces, because if he goes over here, he's no longer defending this one.
If he goes over there, he's no longer defending this one.
And so the big question I have is should I take with the queen or take with the rook?
And if I take with the rook, what would happen?
If I take with the queen, for sure what's going to happen is I win this bishop, because when I take with this queen, it comes with check.
The king has to respond, and unless you want to be down an entire queen, the king would take back here, and then I would take this rook.
But if I take with the rook, is there any other kind of unexpected moves that white could make?
And I believe the answer, I believe no matter what, the white pieces could just ignore that I've taken this bishop and move the king somewhere, attack something.
So maybe I'll just take the queen. And the reason I did that, it's kind of confusing, but would you rather just take the bishop or and have three pieces against two pieces, or would you rather have two pieces against one piece?
And I'd rather take two pieces against one piece because it's just simpler.
And so I took the queen, but the concept here is that this king is overworked.
Okay, I don't think we're going to have time for a blitz game, unfortunately, but I will do a few more puzzles that hopefully are interesting.
We're going to do some harder ones.
So ones that are actually, that I could very easily get wrong. So counting the material, one, two, three, with a queen, one, two, three, things are even.
We both have our dark square bishops available.
And what can we do? This is under attack, which is, I don't know if that's bad or not, because this is a pretty complicated for me.
And then I don't really have anything else that I'm attacking.
I'm attacking this pawn, which is defended twice. I'm attacking this pawn, which is defended.
I don't have any interesting checks to give with my queen. So not really sure what to do here.
This is kind of hard. Unless I'm just not seeing it, because I haven't drank my coffee or anything this morning.
So my brain isn't yet working as well as it could be.
I kind of like this move or any bishop move that protects my rook, but I guess that's the only one.
And the reason is, if I play on the next move, check, there's no way for that bishop to stop me.
The bishop could go here, I suppose. But if I play check, if I can get this rook onto e8, then the game will be over, because he'll have to take back here.
And this will just be checkmate, because the king can't escape here.
So that's kind of what I want to do. So I'm going to do it. We'll see. We'll see if I'm wrong or right.
I'm wrong. No. Okay. What is the answer? It is a bishop move to open this, but the bishop could be on a better square.
If I go here, that's a much better move.
That is a much better move. d4, I believe, is the correct move. And let's talk about why, because that's great.
That's very interesting. So the other thing, the thing that this move does that this move doesn't, this move threatens checkmate here.
So not only am I threatening checkmate here with the sequence you saw, but I also threatened checkmate here.
Let me pull up the analysis board.
So it puts the black pieces in a very bad spot, where if I go here, I suppose the bishop can go here, and I don't really have anything.
It's not, it's not, nobody's really winning anymore, because I can't bust through here and get checkmate on the king on the back rank.
But if I go here, first of all, it blocks the bishop from sitting here.
Second of all, it threatens checkmate here, because if I get my queen onto g7 here, it's checkmate.
So if they take with the bishop, then this will be checkmate, the sequence that you saw.
However, if they take the rook, the next move will still be checkmate.
So that is a great, great tactic.
A great puzzle. I really enjoyed that. I don't know if we have time for one more.
I think it looks like we have 45 seconds left. And so I guess I'll just sign out.
These happen hours always go so fast. I always enjoy playing with everybody watching and hearing from folks afterwards.
I know I heard from a few folks last week, from Scott Pifer, for example.
And so I really appreciate you all watching.
And I'll be back next Friday at 8.30am Pacific Time for Hacker Time. And I don't think I'll do this next week.
I think I'll have real security content. But above all, I'm hoping you learn something because that in its core is what security and being a security person is all about.