Cloudflare TV

Hacker Time

Presented by Evan Johnson
Originally aired on 

Join Evan Johnson as he speaks with security professionals about recent security news!

English
Security
News

Transcript (Beta)

All right, and I think we are live. Welcome to my show. That's every Friday at 8.30am Pacific Time, Hacker Time.

It's a time for us to talk about security issues and what's happening in the world of security, talk to different security professionals, and learn something new.

And today we're doing the very last one of those.

We're learning something new. We're going to be doing something completely different than what we normally do on the show and talking about chess.

The great game of chess, which what you're looking at right now is a chessboard.

And I think it's super actually relevant to what's happening in today's world with coronavirus.

Since coronavirus started, chess has, the popularity of chess has exploded.

Online chess websites have seen a massive uptick in popularity. And, and it's really interesting how it's kind of a game that's over 1000 years old, and it's just become amazingly popular now.

And the other interesting thing about it is it's a great game to just learn something new in the world of security.

It's not about what you know, it's how fast you learn, because there's so much to secure out there.

You can never do, you can never know everything about everything.

And you can never know about the security of everything.

And so most of the job that you have as a security professional is learning something new, learning it quickly, and not being afraid to, to dive in and get somewhat proficient at something that you've never seen before, or that might be brand new.

And so today, I'm hoping you can practice that muscle of learning something new and getting proficient at it quickly, as we talk about chess.

And so my plan here is, we're, I'm going to go over the basic rules of chess.

So how pieces move, what's the point on this on this analysis board.

And then from there, we'll look at some easier puzzles, easy chess puzzles, talk about puzzles and why why you might do them.

And then we'll look at some harder ones for at the last couple minutes of the show.

But it should be about should run right on right on target of 30 minutes.

And feel free to write into the Cloudflare TV team.

I think there's a button on the bottom of your screen to ask a question to me.

And those folks will relay it to me. So feel free to ask a question, feel free to load up on leachess or chess.com and play along with me.

And so without further ado, thanks for joining me and let's get started. So in the game of chess, you'll notice that the you have all of these lights pieces against the dark pieces.

And the goal of chess, the most important piece on the board, pieces on the board are these two, this is the king.

And the entire goal of chess is to get the king into what's known as checkmate.

The game ends when the king is in checkmate, or in or when there's no way to checkmate the king anymore.

And that's pretty, the second one of no way to checkmate the king anymore is more nuanced.

And we'll cover that in just a moment. But the goal is to make it so that anywhere the king moves, he will be captured.

And there's check, which means that the king is under attack.

And then there's checkmate, which is the king has nowhere to move without being captured.

And it's really important to always be looking out for your king and understand just how important your king is to, I mean, the game ends when you lose your king, so you have to protect your king at all costs.

Next, I'll go over these, these folks, because there's a heck of a lot of them on the board.

And these are pawns, these are kind of the piece that you have the most of on both sides.

And you have eight of them on each, on each file. This is called a file.

And these are ranks. And so you have eight on eight, and the pawns work best together.

And so here I just started a game, I made the first move of a chess game, I moved from d2 to d3 with my d file pawn.

And the pawns attack and can capture other pieces if they're diagonally in front of it.

So you'll notice that when the pawn is here, it's actually attacking, actually, let me go back.

You'll notice that if black plays to c5 with his c pawn, then it can be captured.

And that's very important to understand that pawns attack diagonally in front of it, and they cannot move backwards pawns can move two moves on the first move, you'll see here that I can do one move, or two moves.

But then after that, you can't do two anymore, only on the first only on the first time you move the pawn.

So this can move to and not anymore.

So you'll notice also that like I said, pawns work best together. So this, this pawn covers these two squares, and this pawn covers these two squares.

And together, they're covering a heck of a lot more than and have a there's no weaknesses in in this pawn line because they're working together.

And so you can see that if you play something like this, then you can you can capture back and you're still in good shape as the as white.

Alright, so that's pawns and the king, I didn't mention how the king moves, the king can actually move one square in any direction and capture one square in any direction.

So the king can actually go one square, one at a time, and slow and steady, but also the most important piece on the board.

So so he's more about, you should defend the king, and the king can be used to strengthen your defenses, but usually not a good attacking piece because it's dangerous to lose him.

And it's, it's also, it's also not kind of slow, it only moves one square at a time.

So not a great attacking piece. These are, you'll notice that the other pieces on the board, you have two of them on each side.

So you have two knights on each side to these are bishops and two rooks.

These are your pieces that are, that are, that each function very differently.

So you'll first notice, let's talk about the bishop first, because one very interesting thing about the bishop is you have one on the dark squares, one on the light squares, and bishops stay only on the square, those, the square they begin on.

So the dark square bishop can travel diagonally in any direction on the dark squares, and the light square bishop can do the same.

So the dark square bishop can travel in a straight line to any of these squares from this position.

And likewise, this light square bishop on the other side can do the same.

And bishops work also very well together because you'll notice that this, let me get a nice example here.

You'll notice that together, these two bishops are covering a lot of squares.

They are, there's not many places to run when you have, and hide when you have two bishops who are covering all of the light and dark squares in a row like this.

And so they work very well together.

The bishop pair is fierce when you still have the bishop pair on the board, and it's very important to know that they travel in one direction diagonally and can capture like that too.

The knights are the coolest piece in my opinion, because they jump, they hop around, and from knights move in two squares, and then one square in a different direction.

So that's the only way they move to one.

It looks like an L to me when I was a kid learning how to play chess.

I always thought of it as the shape of the letter L, capital letter L, and that's how they capture too.

And so let me show you this. I got my knight to c3 here, and then you can capture this pawn with the knight.

They are the only piece that can jump over other pieces.

That's what makes knights very cool. You'll notice that without even thinking, I just jumped over this pawn line while the bishop had to work its way through this diagonal and can't really get out here unless I move this pawn.

So knights are very cool in that regard, and they can do all sorts of really interesting moves when you have a knight still on the board, because they can hop into places, they can do really unsuspecting things.

These are the rooks, and they are, they're kind of like bishops, except different.

Instead of moving diagonally, they move straight forward and backwards and side to side.

So they can move any way on this direction.

They can move forward, backward, side to side, as far as they'd like, but without going through pieces.

So maybe this wasn't the best example, but should I do something like this?

I can move my rook. We can both move our rooks forward on h -file, and then they can move within any direction in the straight line, and they can go as far as they'd like.

And they are a very powerful piece.

So the pieces on the board have a point value, and it's a good, I think knowing the point values is a good thing to mentally keep in mind, because it's a way to say, well, what if I want to capture this rook with my bishop?

Is that good?

Or what if I want to capture this bishop with my rook? And you'll actually, and actually rooks are worth five, which is quite a lot of points.

And bishops are worth three, pawns are worth one, knights are also worth three, and then rooks being five.

And then last is the queen. Very important piece, the best, most powerful piece on the board.

The queen can move diagonally, like a bishop, and forward and backwards, and side to side like a rook in any direction.

And so the queen is the by far most powerful piece, and that leads us to our very first thing that I'll cover today, which I learned growing up as the four-move mate.

There's a real name for it, and I can't remember that offhand, but the queen being a powerful piece can move quickly to this square.

The point of the four-move mate is that you are, it's possible to mate your opponent and win the game in as few moves as possible, and the least that's possible to do that in is four moves.

And so it's a famous sequence of moves that I've lost to in the past, and it's always kind of not fun to lose to it because you're like, geez, I can't believe I did that.

But it's a real way to lose the game, and it involves your powerful queen and the bishop working together.

So first thing that happens is your queen goes here. Well, first thing that happens is you move your pawn to e4.

Your queen goes here, your bishop goes here, and then working together, your queen and bishop can checkmate the king here on f7.

And so what that looks like is like this, and this would be the quickest way a chess game can end, where the king, there's nowhere for the king to run, there's nowhere to, there's no way to capture this piece to save the king, and the queen is supported by this bishop, the light square bishop, and the queen got to flex her power and go diagonally and straight.

You could do it doing only diagonally by going all the way out here and then here, but going all the way out here and then here, but that is the way that you can end the game the quickest.

I have lost to this more than I've won with this, so it's something that's important to know about, and it's a good trick to play on people that you want to be mean to, who you want to play chess against.

But besides that, it's not really a real strategy that people use because it can be dangerous to get your queen out so early because it's so powerful.

Okay, with that, that's the bare basics of the game that you need to know to start working through puzzles and start playing, is like how the pieces actually move.

It's also nice that when you're on a lot of these chess websites, a great way to learn because there are so many weird rules about where pieces can move.

If you actually click on the piece, you'll notice that all of these squares that the bishop can move to are highlighted.

So most chess websites will help you and at least tell you what the legal moves are, and that can be helpful when you're in check and say you don't know it.

So if your king is under attack and you don't actually know that the king is under attack here, say we did something like this, the knight goes here, we attack the knight, and here the king is under attack.

I only have so many legal moves. I'm actually not allowed to move my queen all of these places because I have to defend my king.

And so the only legal moves will be to take this or with the bishop, it'll highlight that the square is one of the only legal moves.

With this pawn, it'll highlight the square.

With this queen, it'll highlight the square. And then also with this king, it'll show you that I can move to one of these squares to survive.

And so you don't have to memorize all of the rules.

To first start, the websites will help you because they don't want people, well, there's rules and the websites have to enforce them.

Okay, so let's take a look at some basic chess puzzles. And I've got this one ready.

We're on leechess.org, which is a great website, highly recommend it.

It's a free open source website. And then this is chess.com, another super popular website with a lot of great paid features.

And let's talk about this position.

So what we have is the white pieces are going to move. And you'll notice my rook and my queen here are working together and attacking this rook.

But also the thing to note here is that this queen is being looked at by the bishop here.

And so the actual correct move here is going to be rook to e8. And and at the end of the sequence, you'll notice that I have taken one piece.

Oh boy.

At the end of the sequence here, you'll notice that I've taken one piece, I've lost a piece, I've taken a second piece, I've lost a second piece, and I've taken a third piece.

So I have won that sequence by taking more material than my opponent.

And the reason that works, it's very important to realize that after I take this rook in this position, the king is in check.

And black has to respond by capturing my rook or moving his king to protect the rook, to protect his king.

And so even though this is a devastating attack here on the queen, this is called a discovered attack when this thing is actually attacking this bishop here on the dark square bishop for the white pieces.

Once I move the rook, that's called the discovered attack where suddenly the black has two problems to deal with.

One, he's in check.

One, his queen is under attack and there's nothing that the black pieces can do to not lose this exchange.

And that's why this is a good puzzle to, or that's kind of the point of puzzles, to win.

You're in a winning position or you're in a very losing position, potentially losing position, and you have to make either the move to win, find the move that wins the position, or find the move that saves the position should you be in a lot of trouble.

And there's only one best move in all of these positions and that's one thing to note.

So in this sequence, check, the king has to respond, takes back with the rook.

I take the rook with the queen, I lose the queen, but at the end of it, I get his queen and I'm up a full piece.

You'll see I have my dark square bishop against the light square bishop, but I also have a rook and six pawns to five pawns, and so I'm in great shape as white.

And that was a great puzzle. Let's do another. All right, so this is a pretty interesting one.

The first thing to do when you see a puzzle is probably to count what you have on the board.

There's no point in, if you're down 10 pieces and you see a puzzle, then you're gonna have to either win or survive somehow in one move, and that really should change the way you think about the puzzle.

Because just winning one piece when you're down 10, you're not in any better shape than you are 10 pieces.

So let us start here. This is an interesting one.

So you'll notice that I have a dark square bishop, and he kind of has a way to see the king here.

And also, if this rook wasn't protecting this back rank, this whole line with the king, I could just move my queen to, let me get rid of these arrows, I could just move my queen to e8, and the game would be over if the rook wasn't there.

So that's a pretty good hint. It's also worth noting that if I, well, I'll show you the solution and then we can talk about why it's the solution.

So I believe, let's see if I'm right, this is the solution followed by this followed by this.

That's a pretty long sequence. And so let's go over why that is the way it is.

So you'll see, this is actually a pretty hard puzzle for something that I put at a lower rating.

So the whole point of this puzzle is that if we can get our queen to this square, we can make the king move this way.

And then we can force this rook off of this back rank by taking my queen and losing it to the rook, which would be checkmate.

This is called a back rank mate. And back rank mate is when, you'll commonly see it when the king is kind of behind these pawns, and there's actually nowhere for the king to run.

And so despite being very well protected, like you can't really just barge into one of these pawns with your queen.

If you take this pawn, the king will just take back.

And so it's very well protected. However, back rank mate, when you have these pawns and the king tucked in here, it's super dangerous.

And even the best players in the world get into issues on their back rank, because you can feel really well protected with your king at one moment, and then something happens in the game, and suddenly you have an issue.

And so the whole point is that if you can get your queen to this square, you can get the king to move here.

However, you need this knight to move, because the knight is actually protecting this square, because it moves to one.

And so it doesn't work like this, because the knight is still protecting the king.

So the whole puzzle falls apart without this move, without this move, because it removes the, since this is a move that came with check, the dark pieces have to respond and protect the king.

And the only way to do that is to go here, which is met with mate by forcing the rook to get captured.

Or you can take with bishop and prolong the attack.

So it's not that different either way. It's still forced mate. But it is something that is kind of difficult to see, actually.

I'm surprised that this one is, chess.com put this in the lower rated ones.

But what this is all about is removing an attacker, and then removing this attacker, and then attacking the king on the back rank.

Super interesting. Let's do one more. All right. So this is a position you actually see in games a lot.

There's a lot going on here. And so the first thing to do is count what is on the board.

And we have one, two knights, one bishop, two rooks, and a queen.

The black has two knights, one bishop, two rooks, and a queen.

And so we have the same number of pieces. And then one, two, three, four, five, six, seven pawns.

One, two, three, four, five, six, seven. So it is dead even.

And you'll notice that the queen is tucked way in over here. And it could be a dangerous attack is about to be had on the king, on this black king.

Because the queen is over here, and you have a lot of weaknesses on these dark squares.

And the only thing that's a little worrying is this, this queen being down here, you're also seem to be in a little bit of trouble.

And so, and so what we want to do is attack this king.

And the best way to do that will probably be with this knight moving into g5.

And you'll see this is kind of dangerous looking. I'm under attack by this queen.

And I don't really like that. But you'll actually see that after this move, the queen gives itself up.

This is something that you'll see computers do a lot.

Because it makes you waste an extra move. And actually, there's checkmate on that.

They didn't let you finish the puzzle and get the satisfaction.

However, after any move that black makes, it's checkmate here on h7. Because black is under attack from the queen and has nowhere to run.

And this is a super common pattern.

You'll see where a knight protects a queen on attacking a king at the edge of a board, where the king has nowhere to run.

And actually, if you get a queen and a king touching each other, like this knight and the king are, the if this knight was a was a queen and the queen was protected, then that would also be checkmate.

So those are three really kind of lower level puzzles. I'm a little surprised because they were actually pretty tough.

And then I want to show one last puzzle before we leave for the day.

And I would like to do a much more difficult one.

And so this is my puzzle rating.

These are puzzles that are hard for me. And so I wonder if I can work through one live on stream.

And what you'll see here is the first thing to do is count the material.

One, two, three, four were the black pieces.

I've got four pieces to one, two, three, four, five. So not good. I either have to win the game, win a piece, do something.

And how do we do this? So there's a lot of different things that I'm seeing here.

Moving your rook to h3 sacrifices it, however, and opens up this attack.

However, that doesn't really get you anything because after you take back, you've just sacrificed the rook to lose for the opportunity of trading queens.

And that doesn't seem like you're actually winning.

However, if you take on h3 coming with check, then the only move that makes sense would be to take back with the pawn.

Taking back on h3 again comes with check. And the only move, also, you have this rook on the g file protecting you.

And so the only move that makes sense would be to move the queen to h2, which after f8, then the king will be checkmated.

And let's see if it actually works out the way I thought it would.

So check, check, queen moves. After I move here, the queen will move here and checkmate the king on g2.

So yep. And that puzzle was rated about 1600 and actually very complicated.

You had to sacrifice a rook. You had to see that this was supporting your rook and pretty difficult.

And with that, we're actually out of time.

It went really fast. And I hope you learned something. I really think that security, tying it into security, I really think security is all about learning something, learning it quickly and being willing to dive into different problems and learn from them.

And chess has been a great way to do that for me and practice doing that because there's always something new to learn on the chessboard.

There's always something new to learn in security or about computers.

And it's a game that you can't master in a year, let alone five.

You can't master it ever. And so it's a lot of fun and you won't ever run out of chess to play.

So I hope you enjoyed it.

Thanks for watching me today on Hacker Time. It was a lot of fun for me.

It's hard to articulate a lot of these rules and things about a game that you like.

So that was good practice for me. And so thanks for watching. Cheers.

Thumbnail image for video "Hacker Time"

Hacker Time
Join Evan Johnson each week for the latest security news, programming tutorials, and more!
Watch more episodes