In its purest form, AES is a block cipher of 128 bits, but most current applications convert it into a stream cipher mode, where we just need to use an XOR with the plaintext stream to create our ciphertext. Two of the most popular stream modes for AES are GCM and CTR.
It was in 1995 that Diffie and Hellman created the CTR mode [here]:
Basically it converts the block cipher into a stream by creating a keystream using counter. This keystream should not repeat for a long time, as if it does, the ciphertext stream can be cracked. We can use any method to create the counter, but we mostly just increment it by one each time:
In the above, we can see we use a simple XOR operation between the plaintext and the block cipher. This makes the cipher fast, and easy to implement in hardware. Overall, though, we need to add a MAC (Message Authentication Code) to the ciphertext, as Eve can flip bits in the cipher:
