liveBook · Manning

Linear algebra

As explained in Hacking Cryptography

The branch of mathematics concerning vectors, matrices, and linear equations and transformations.

Uses matrices to recover the taps of a linear-feedback shift register from observed output bits. Because LFSR output is a linear combination, the attacker models Boolean multiplication as AND and addition as XOR, then solves for the coefficients. section 4.2.2

The recovery procedure is:

  • Collect enough observed bits to form a square state matrix and a vector of subsequent output bits. section 4.2.2
  • Try candidate register lengths when the length is unknown, then clone the LFSR and predict or decrypt later output. section 4.2.2

Known-plaintext recovery

A known ciphertext prefix is XORed with the known plaintext prefix to obtain keystream bits. Recovering the LFSR from those bits allows the remaining ciphertext to be decrypted; the test recovers a timestamped message.

How Hacking Cryptography covers it

How deep it goes
Works through Boolean matrix construction, inversion, coefficient recovery, and unknown-length search, but stays focused on LFSRs.
Examples
Demonstrates three-bit LFSR equations, matrix recovery code, candidate-length search, and timestamp decryption.
What it assumes
Assumes familiarity with LFSR state, taps, observed bits, XOR, and AND while deriving the matrix formulation explicitly.
What you can do after
Diagnose and recover an LFSR's taps and clone its output generator from sufficient observed or known-plaintext bits.
How it connects
Connects matrices with LFSRs, stream ciphers, known-plaintext attacks, Boolean algebra, and keystream prediction.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.