The classical Gram–Schmidt algorithm takes a basis ( \mathbfv_1, \dots, \mathbfv_n ) and outputs orthogonal vectors ( \mathbfv_1^ , \dots, \mathbfv_n^ ), where each ( \mathbfv_i^* ) is the component of ( \mathbfv_i ) orthogonal to the span of previous vectors. In exact arithmetic, this is deterministic and useful for computing volumes or QR decompositions.

While standard linear algebra courses teach this to solve for orthonormal bases, cryptographers are interested in a specific geometric property:

: The challenge asks for a specific component of one of these vectors (usually the 2nd2 raised to the n d power component of Key Resources

from fractions import Fraction

: Set the first orthogonal vector equal to the first input vector: u1=v1u sub 1 equals v sub 1 Iterate : For each subsequent vector Calculate the projection coefficients μijmu sub i j end-sub

At its core, the Gram-Schmidt process is a method for transforming a set of linearly independent vectors into an . In a 2D or 3D space, "orthogonal" simply means the vectors are at right angles to one another.

( u_1 = v_1 = (1, 2) )

In the CryptoHack “Gram Schmidt” essay challenge, the key lesson is this: Mastering it unlocks the ability to understand LLL, BKZ, and why certain lattice attacks work. It’s a perfect example of how a pure-math technique becomes a practical cryptanalytic weapon — by measuring orthogonality, we gain power over the geometry of the lattice, and thus over the security of cryptosystems built upon it.

: CryptoBook - Gram-Schmidt Orthogonalization provides the mathematical foundations used within the CryptoHack curriculum.