title: How to split 3DES key and calculate KCV in C#?
body: <p>I have a 128 bit 3DES key 1915372928A30803A25B0659A4DD6525, how could I split the key into 3 components and calculate the KCV for each component? I'd like to do similarly to the online tool below</p>
  
  <p><a href="https://www.emvlab.org/keyshares/?combined=1915372928A30803A25B0659A4DD6525&amp;combined_kcv=2082A4&amp;one=B9FFAF926385DBED0FBC087F5DC674C3&amp;one_kcv=C69561&amp;two=EA3CD5B063E0BF73F6C5ECB5F7D32080&amp;two_kcv=33D908&amp;three=4AD64D0B28C66C9D5B22E2930EC83166&amp;three_kcv=03DCA8&amp;numcomp=three&amp;parity=ignore&amp;action=Generate+128+bit" rel="nofollow noreferrer">https://www.emvlab.org/keyshares/?combined=1915372928A30803A25B0659A4DD6525&amp;combined_kcv=2082A4&amp;one=B9FFAF926385DBED0FBC087F5DC674C3&amp;one_kcv=C69561&amp;two=EA3CD5B063E0BF73F6C5ECB5F7D32080&amp;two_kcv=33D908&amp;three=4AD64D0B28C66C9D5B22E2930EC83166&amp;three_kcv=03DCA8&amp;numcomp=three&amp;parity=ignore&amp;action=Generate+128+bit</a></p>
  
  <p>The code i used to generate 3DES key</p>
  
  <pre><code>public byte[] GenerateThreeDesKey()
  {
      RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
      byte[] tripleDesKey = new byte[16];
      rng.GetBytes(tripleDesKey);
      for (var i = 0; i &lt; tripleDesKey.Length; ++i)
      { 
          int keyByte = tripleDesKey[i] &amp; 0xFE; 
          var parity = 0; 
          for (int b = keyByte; b != 0; b &gt;&gt;= 1) 
              parity ^= b &amp; 1;
          tripleDesKey[i] = (byte)(keyByte | (parity == 0 ? 1 : 0)); 
      }
      return tripleDesKey;
  }
  </code></pre>
  
  <p>After getting the key, how to split the key into 3 components and calculate the KCV?</p>