title: Decrypt Card Number
body: <p>I'm helping some students do some programming work and would like to know how to decrypt a credit card number after it has been encrypted. Here is the encrypt property:</p>
  
  <pre><code>public string Encrypt(string ccNum)
  {
      ccNum = Convert.ToString((Convert.ToInt64(ccNum) * 13) + 43);
      return ccNum;
  }
  </code></pre>
  
  <p>I figured the decrypt property would be the reverse of the encrypt, but it doesn't work.  Here is my code for the decrypt property:</p>
  
  <pre><code>public string Decrypt(string ccNum) //DOESN'T DECRYPT
  {
      string decCCNum = Convert.ToString((Convert.ToInt64(ccNum) - 43) / 13);
      MessageBox.Show("Customer Name: " + FirstName + " " + LastName + "\n" + 
             "Encypted Card #: " + Encrypt(ccNum) + "\n" + 
             "Decrypted Card #: " + decCCNum , "Customer Info", 
             MessageBoxButtons.OK, MessageBoxIcon.Information);
      return ccNum;
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>