title: What is the name of this cryptography algorithm?
body: <p>I found the cryptographic algorithm implemented in “the_cipher_decipher_func” below:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  
  std::string cipher_decipher(const std::string&amp; src, char mask, const char incr, const char mod)
  {
      const auto the_cipher_decipher_func = [&amp;](const char c)
      {
          mask = (mask + incr) % mod;
          return static_cast&lt;char&gt;(c ^ mask);
      };
  
      auto tgt = std::string{};
      std::transform(src.cbegin(), src.cend(), std::back_inserter(tgt), the_cipher_decipher_func);
      return tgt;
  }
  
  int main(int argc, char* argv[])
  {
      if (argc &lt; 2)
          return 1;
  
      auto source = std::string{argv[1]};
  
      const char incr = 12;   // arbitrary
      const char mod = 50;    // arbitrary
      const char initial_mask = mod / incr;   // arbitrary, but lower than "mod".
  
      auto mask_cipher = initial_mask;
      auto ciphered = cipher_decipher(source, mask_cipher, incr, mod);
  
      auto mask_decipher = initial_mask;
      auto deciphered = cipher_decipher(ciphered, mask_decipher, incr, mod);
  
      std::cout
          &lt;&lt; "source: " &lt;&lt; source &lt;&lt; std::endl
          &lt;&lt; "ciphered: " &lt;&lt; ciphered &lt;&lt; std::endl
          &lt;&lt; "deciphered: " &lt;&lt; deciphered &lt;&lt; std::endl
          ;
      return 0;
  }
  </code></pre>
  
  <p>It seems a mix of XOR and incremental key. However, does somebody may identify the precise origin of this cryptographic algorithm?</p>