Since data that is encrypted must be able to be decrypted, an encryption function must be invertible (one-to-one and entire) over the set of all possible input data. This means each step in the process must also be invertible. One way to accomplish encryption is to use a matrix (with a non-zero determinant). Split the text into several matrices (padding input as necessary). Then apply the transformation matrix to each input matrix and concatenate the result. However, most modern encryption schemes use a combination of transformation matrices and bit twiddling to accomplish encryption.
Encryption in Cryptography
The usefulness of encryption for cryptography is quite obvious. In fact, most of cryptography is centered around encryption and decryption.
AES-128 Encryption and Decryption Function (slightly modified)