Uploaded December 2021 | Updated November 2026, 6 hours ago
00:00 - Intro
00:45 - High-level overview of solution algorithm
01:30 - Talking about Hamming distance and Hamming weight
03:10 - Implementing Hamming weight (first method: converting to string, counting "1"s)
03:57 - Implementing Hamming weight (second method: checking lowest bit and shifting)
05:38 - Implementing Hamming weight (third method: fancy in-place digit sum)
12:10 - Implementing Hamming weight (fourth method: using subtraction to zero each 1 bit)
15:17 - Implementing Hamming weight (fifth method: lookup table)
16:02 - Implementing Hamming distance in terms of XOR and Hamming weight
16:38 - Benchmarking Hamming weight functions
18:40 - Starting the solution script, copying in Hamming distance and weight functions
20:30 - Moving on to guessing key size
21:10 - Explaining why this method for guessing key size works (Kasiski examination)
22:35 - "That's enough talking, let's get to actually writing this thing"
24:35 - Cutting a corner by generating transpositions of blocks using slice syntax
26:00 - Cracking each transposed cipher and combining the results
27:00 - Writing the main block
29:30 - Testing the solution
Further reading:
en.wikipedia.org/wiki/Hamming_weight
en.wikipedia.org/wiki/Hamming_distance
en.wikipedia.org/wiki/Hacker%27s_Delight
en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
en.wikipedia.org/wiki/Vigen%C3%A8re_cipher#Kasiski_examination
00:00 - Intro
00:45 - High-level overview of solution algorithm
01:30 - Talking about Hamming distance and Hamming weight
03:10 - Implementing Hamming weight (first method: converting to string, counting "1"s)
03:57 - Implementing Hamming weight (second method: checking lowest bit and shifting)
05:38 - Implementing Hamming weight (third method: fancy in-place digit sum)
12:10 - Implementing Hamming weight (fourth method: using subtraction to zero each 1 bit)
15:17 - Implementing Hamming weight (fifth method: lookup table)
16:02 - Implementing Hamming distance in terms of XOR and Hamming weight
16:38 - Benchmarking Hamming weight functions
18:40 - Starting the solution script, copying in Hamming distance and weight functions
20:30 - Moving on to guessing key size
21:10 - Explaining why this method for guessing key size works (Kasiski examination)
22:35 - "That's enough talking, let's get to actually writing this thing"
24:35 - Cutting a corner by generating transpositions of blocks using slice syntax
26:00 - Cracking each transposed cipher and combining the results
27:00 - Writing the main block
29:30 - Testing the solution
Further reading:
en.wikipedia.org/wiki/Hamming_weight
en.wikipedia.org/wiki/Hamming_distance
en.wikipedia.org/wiki/Hacker%27s_Delight
en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
en.wikipedia.org/wiki/Vigen%C3%A8re_cipher#Kasiski_examination










