title: Base64 HMAC-SHA1 and MD5 encryption in Dart and Vuforia's VWS API
body: <p>To communicate with Vuforia through its VWS API I have to do some tricky stuff: first create this string</p>
  
  <pre><code>StringToSign = 
    HTTP-Verb + "\n" +
    Content-MD5 + "\n" +
    Content-Type + "\n" +
    Date + "\n" +
    Request-Path;
  </code></pre>
  
  <p>where <code>Content-MD5</code> is the encryption of the request's body...</p>
  
  <blockquote>
    <p>(from the first boundary to the last one, including the boundary
    itself). For request types without request body, include the MD5 hash
    of an empty string which is “d41d8cd98f00b204e9800998ecf8427e”.</p>
  </blockquote>
  
  <p>then with this string you have to perform the equivalent to this Java code</p>
  
  <pre><code>Signature = Base64 (HMAC-SHA1 (server_secret_key, StringToSign));
  </code></pre>
  
  <p>where <code>server_secret_key</code> is a constant. Finally you have to plug that into an authorization header of this form</p>
  
  <p><code>Authorization: VWS {provision_access_key}:{Signature}</code></p>
  
  <p>I've got no experience with encryption, can anybody tell me how to do this in Dart?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>More info about this on <a href="https://developer.vuforia.com/resources/dev-guide/setting-api" rel="nofollow">Setting Up the API</a></p>