title: Custom string to 128-bit string
body: <p>I am trying to force a custom string with a length between 0 and 15 to a 128-bit string, so I can use it as a <code>AesCryptoServiceProvider</code> key.</p>
  
  <p>I have tried fiddling around with multiple strategies, and have ended up with the following: </p>
  
  <pre><code>        if (stringToConvert.Length &gt; 16)
          {
              StringBuilder sB = new StringBuilder();
              char[] chA = stringToConvert.ToCharArray();
              int chAMaxLength = chA.Length;
  
              for (int i = 0; i &lt; 16; i++)
              {
                  if (i &lt;= chAMaxLength)
                  {
                      sB.Append(chA[i]);
                  }
              }
          }
  </code></pre>
  
  <p>I need a string exactly 16 characters long (16*8 = 128).</p>
  
  <p>I am now stuck with it, and just need a helping hand to go through this obsticle.<br>
  I apologize in advance if this may seem simple.</p>
  
  <p>Example:<br>
  <code>asd</code> would become<br>
  <code>asdasdasdasdasda</code></p>