Secure communication
Encryption is a method in which data is rendered hard to read by an unauthorized party. Since encryption methods are created to extremely hard to break, many communication methods either use deliberately weaker encryption than possible, or have backdoors inserted to permit rapid decryption. In some cases government authorities have required backdoors be installed in secret. Many methods of encryption are also subject to "man in the middle" attack whereby a third party who can 'see' the establishment of the secure communication is made privy to the encryption method, this would apply for example to interception of computer use at an ISP. Provided it is correctly programmed, sufficiently powerful, and the keys not intercepted, encryption would usually be considered secure. The article on key size examines the key requirements for certain degrees of encryption security.
Affine cipher
In the affine cipher the letters of an alphabet of size are first mapped to the integers in the range . It then uses modular arithmetic to transform the integer that each plaintext letter corresponds to into another integer that correspond to a ciphertext letter.
The encryption function for a single letter is 
where modulus is the size of the alphabet and and are the key of the cipher. The value must be chosen such that and are coprime. The decryption function is 
where is the modular multiplicative inverse of modulo . I.e., it satisfies the equation 
The multiplicative inverse of only exists if and are coprime. Hence without the restriction on , decryption might not be possible.
It can be shown as follows that decryption function is the inverse of the encryption function,