Reed–Solomon error correction is one of these things that still feels like black magic to me.
Then blow your mind even further by looking up the principles of the McEliece cryptosystem (but don't use it as originally specified - modern developments have weakened and refined it a lot).
I warn you: this is one of those down-the-rabbit-hole subjects that has a deliciously large amount of literature to soak up, you could find yourselves with bookshelves full of it. (An alarming number of patents, too, for the unwary.)