# Understanding the linear cipher decryption process

Being new to Cryptography, I'm having a hard time understanding the basic concepts.

I understand all parts except why 4 power -1 has become to 7.

Can anyone explain why this is?

• Lookup modular multiplicative inverse. Its basically what division becomes on modular rings. – Ninja_Coder Aug 7 '17 at 6:32

First note the $\pmod{27}$ at the end, which tells us that all these equations are to be taken modulo $27$.
Also note that $4^{-1}$ literally means "the number $x$ such that $x\cdot4=1\pmod{27}$" (much like with the real numbers where $4^{-1}=\frac14$ with $4^{-1}\cdot 4=\frac14\cdot 4=1$).
Finally observe that $7\cdot 4=28\bmod 27=1$ and it follows that $7=4^{-1}\pmod{27}$.