The Hill cipher is a polygraphic substitution cipher that uses linear algebra. It operates on blocks of letters that are treated as vectors, and encrypts each block by multiplying it by a random invertible matrix based on the cipher key. To decrypt, the ciphertext vectors are multiplied by the inverse of the encryption matrix. The key is an n×n matrix of numbers representing the letters, and encryption/decryption involve matrix multiplication modulo 26.