# If PRF is non invertible, why does Ctr-mode work?

I am currently taking Dan Boneh's Cryptography I course online. I have just finished the segment discussing the Cipher Block Chaining and Counter-Mode. I am having difficulty understanding why Ctr-Mode works as an encryption algorithm as PRFs are fundamentally non invertible, as per my understanding. Any clarification on this would be highly appreciated!

• For any length, $\: \langle$ binary_strings_of_that_length , xor $\rangle \:$ is an abelian group. $\hspace{1.92 in}$ For any length, each element of that group is its own inverse. $\;\;\;$ – user991 Nov 12 '15 at 23:51
• @RickyDemer I've generated an answer without (too much) math in it, but I would happily vote up an answer that explains the mathematics behind it. – Maarten Bodewes Nov 13 '15 at 0:55