title: Powershell base64 vs regular base64
body: <p>I use powershell to convert string </p>
  
  <pre><code>$Text = 'ouser:v3$34@#85b&amp;g%fD79a3nf'
  $Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text)
  $EncodedText =[Convert]::ToBase64String($Bytes)
  $EncodedText 
  </code></pre>
  
  <p>However when using <a href="https://www.base64decode.org/" rel="noreferrer">https://www.base64decode.org/</a>, or some java libraries for base64 encoding I get a different, shorter version.</p>
  
  <p>Sample string:</p>
  
  <blockquote>
    <p>This is a secret and should be hiden</p>
  </blockquote>
  
  <p>powershell result:</p>
  
  <blockquote>
    <p>VABoAGkAcwAgAGkAcwAgAGEAIABzAGUAYwByAGUAdAAgAGEAbgBkACAAcwBoAG8AdQBsAGQAIABiAGUAIABoAGkAZABlAG4A</p>
  </blockquote>
  
  <p>normal base64 result: </p>
  
  <blockquote>
    <p>VGhpcyBpcyBhIHNlY3JldCBhbmQgc2hvdWxkIGJlIGhpZGVu</p>
  </blockquote>
  
  <p>While using the website I am able to decode both versions, however using my java code I am only able to decode the latter. Why is that? Is there more than one version of base64? Where those differences come from?</p>