title: OpenSSL Encrypt/Decrypt a string
body: <p>Im trying to encrypt/decrypt aes a string and I keep getting an error when i decrypt it.</p>
  
  <pre><code>set OPENSSL=C:\Projects\WinTools\Tools\OpenSSL\x86\bin
  set Key=748FBA160C30A2624859A44A1830C061434C76E3278AFB75330C8CA2CF1F5184
  set IV=84DB32005B226D7F9964B758C9157538
  set Salt=96F697CA35CED67A
  </code></pre>
  
  <p>I encrypt as follows:</p>
  
  <pre><code>echo "Test is test" | %OPENSSL%\openssl enc -base64 -e -aes-256-cbc -S %Salt% -K %Key% -iv %IV%
  </code></pre>
  
  <p>Decrypting it:</p>
  
  <pre><code>echo "7nO8yVKleLvbSneIi7qr82oSuiwRtnt5Iqqoynidl90=" | %OPENSSL%\openssl enc -base64 -d -aes-256-cbc -S %Salt% -K %Key% -iv %IV%
  </code></pre>
  
  <p>The error i get when decrypting is:</p>
  
  <p>WARNING: can't open config file: /usr/local/ssl/openssl.cnf
  bad decrypt
  4124:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:.\crypto\evp\evp_enc.c:532:</p>