title: how to make a decode key from an encode key (substitution cipher) C
body: <p>the key for encoding is <code>"qwertyuiopasdfghjklzxcvbnm"</code> which is the code you get when you enter <code>"abcdefghijklmnopqrstuvwxyz"</code> in the program. how do i make a decode key out of it.  this is a substitution cipher. if you have a suggestion please keep it simple and make use of the variables you have. no complicated or any library functions</p>
  
  <pre><code>    char * decodeSubstitution(char * lcEncodingKey, char * src, char * dest)
  {
      char      lcDecodingKey[26];
      char      ucDecodingKey[26];
  
  
  
  
  
      char* deststart=dest;
  
  
      int i ;
  
  
      int offset1;
      int offset2;
  
      // Create the lower case decoding key from the lower case encoding key
      // (WRITE CODE HERE)
       for (i=0; i&lt;26 ; i++){
       //    lcDecodingKey[i]=lcEncodingKey[i];
            lcDecodingKey[i]=
  
           ucDecodingKey[i]= toupper(lcDecodingKey[i]);
       }
  
  
      // Create the uppercase decoding
      // (WRITE CODE HERE)
  
  
      // Implementation of the generalized substitution decoder.
      // (WRITE CODE HERE)
      for (; *src; ++src, ++dest)
      {
        if (isupper(*src))
          {
              offset2=*src-'A';
              *dest=ucDecodingKey[offset2];
  
           }
  
  
  
           else if (islower(*src)){
                offset1 = *src - 'a';
  
         *dest = lcDecodingKey[offset1];
           } else{
  
               *dest=*src;
           }
      }
           *dest = '\0';
  
           return deststart;
  
  
  }
  </code></pre>
  
  <p>thats the function for decoding.</p>