title: RSA public key encrypts ASCII value to 0, how to decrypt?
body: <p>I've decided to learn about RSA encryption since learning about the vernal cipher in a comp sci lecture.
  I grasp the idea behind RSA (it's very clever), however while trying to write my own C program to encrypt and decrypt a string of characters I have run into a few problems.</p>
  
  <p>I am encrypting each character's ASCII value using the public key then decrypting the cipher text. However, I have found that sometimes the public key I have created will encrypt an ASCII value to 0, then there is no way to decrypt it as 0^anything = 0. 
  I surely must be wrong here as binary can be encrypted/decrypted using RSA.</p>
  
  <p>E.g.</p>
  
  <ul>
  <li>p = 3</li>
  <li>q = 5</li>
  <li>N = 15 (p*q)</li>
  <li>m = (p-1)(q-1) = 8</li>
  <li>e = 7 (coprime to m)</li>
  <li>d = 7 (7d(mod8) = 1 ... Before people have a go, I am only using 7 because it's convenient for this example (not for a secure encryption)</li>
  </ul>
  
  <p>Now take the char "T" (ASCII value 84)</p>
  
  <p>Run the encryption, the cipher text is = 0</p>
  
  <p>0^7 (mod 8) = 0 ... not 84!</p>
  
  <p>Can someone point me in the right direction please.</p>
  
  <p>Thanks in advance</p>