Cryptopals Guided Tour - 03 - Single-byte XOR cipher @nccgroup
Cryptopals Guided Tour - 03 - Single-byte XOR cipher  @nccgroup
Uploaded December 2021 | Updated November 2026, 1 hour ago
00:00 - Intro
00:35 - Describing frequency analysis
01:10 - Downloading a book from Project Gutenberg and counting character frequencies
03:20 - Looking at frequency counts by character set
04:10 - Starting the solution script, talking about Black ("The uncompromising Python code formatter")
04:45 - Writing a function to score a plaintext's plausibility by its frequency counts
06:58 - Writing the XOR cipher cracking function (first version)
07:55 - How (and why) to use infinity in Python
10:30 - Writing crack_xor_cipher_worse so we can view top 5 candidate plaintexts
11:20 - Testing the cracking function
12:05 - Talking about ASCII table layout
13:37 - Talking about sample sizes, swapping out frequency count dictionary
15:20 - Modifying "score_text" to only count lowercase frequencies
15:45 - Solving the challenge, starting to refactor
16:20 - Introducing dataclasses and creating ScoredGuess dataclass
20:30 - Rewriting crack_xor_cipher to use ScoredGuess
23:12 - Optimizing the scoring algorithm
27:30 - Testing and benchmarking the optimized algorithm (it works really well!)

Further reading:
en.wikipedia.org/wiki/Substitution_cipher
en.wikipedia.org/wiki/Frequency_analysis
python.org/dev/peps/pep-0008
github.com/psf/black
en.wikipedia.org/wiki/Etaoin_shrdlu
en.wikipedia.org/wiki/ASCII#Design_considerations
docs.python.org/3/library/dataclasses.html
ipython.readthedocs.io/en/stable/interactive/magics.html#magic-timeit
Cryptopals Guided Tour - 03 - Single-byte XOR cipherThe Five Pillars of Cyber SecurityThe AppSec Reality Check: From Point in Time to Continuous SecurityLive from RSAC: AI Security Lessons from the FieldDiversity and its importance in the Cyber Mission | Cyber UK 2021Cyber Threat Intelligence Webinar Series - OctoberCompromise Assessments from NCC GroupNCC CON Europe 2017View Portal - A secure online deposit management portalWeb Assured from NCC Group
NCC Group Global |

Cryptopals Guided Tour - 03 - Single-byte XOR cipher

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER