title: C++ encryption and decryption
body: <pre><code>void encrypt_chars(int length)
  {
      char temp_char;                 
  
      for (int i = 0; i &lt; length; i++)    
      {
          temp_char = OChars[i];          
  
          __asm {                         
              push   eax                  
              push   ecx                  
  
              movzx  ecx, temp_char       
              call   encrypt_nn           
              mov    temp_char, al        
  
              pop    ecx                  
              pop    eax                  
          }
          EChars[i] = temp_char;          
      }
      return;
  
  
      __asm {
  
      encrypt_nn:
          mov eax, ecx        
              inc eax 
              ret
      }
  </code></pre>
  
  <p>The encryption part is fine, but I thought I would copy and paste the code to the decryption and instead of incrementing I would decrement the values, so that it would go back and decrypt the data </p>
  
  <hr>
  
  <pre><code>//---------------------------------------------------------------------------------------------------------------
  //----------------- DECRYPTION ROUTINES -------------------------------------------------------------------------
  //
  void decrypt_chars(int length)
  {
      char temp_char;                     
  
      for (int i = 0; i &lt; length; i--)
      {
          temp_char = OChars[i];
  
          __asm {                     
              push   eax                  
              push   ecx                  
  
              movzx  ecx, temp_char       
              call   encrypt_nn           
              mov    temp_char, al        
  
              pop    ecx                   
              pop    eax              
          }
          EChars[i] = temp_char;      
      }
      return;
  }
  </code></pre>