title: Decrypt a text with OpenSSL using key and salt only
body: <p>I would like to decrypt a text using a 32 characters key and a salt from command line in my MacOS. I have encrypted it in Windows using a program. But, whenever I try to decrypt it from command line I couldn't and get an error. </p>
  
  <pre><code>echo -n PuYNZO+SLqFo6g97gxKr2uAPRUph/sZgaJ3T5YIBPIc= | openssl enc -d -a -aes-256-cbc -K TheTestKeyUsedIs32CharactersLong -S 53616c7455736564 -iv 0 -p
  hex string is too short, padding with zero bytes to length
  hex string is too short, padding with zero bytes to length
  non-hex digit
  invalid hex key value
  </code></pre>
  
  <p>When I try to encrypt </p>
  
  <blockquote>
    <p>100836</p>
  </blockquote>
  
  <p>in MacOS it gives me completely different string. </p>
  
  <blockquote>
    <p>U2FsdGVkX19TYWx0VXNlZA4AWDWo5nzi8p5pYyAeUMg=</p>
  </blockquote>
  
  <p>using following command:</p>
  
  <pre><code>openssl enc -aes-256-cbc -a -S 53616c7455736564 -iter 5 -k TheTestKeyUsedIs32CharactersLong -in input.txt -out openssl_output.txt
  </code></pre>
  
  <p>From the application I am using in Windows </p>
  
  <blockquote>
    <p>100836
    is converting into 
    PuYNZO+SLqFo6g97gxKr2uAPRUph/sZgaJ3T5YIBPIc=</p>
  </blockquote>
  
  <ul>
  <li>My salt text is <strong>SaltUsed</strong></li>
  <li>My 32 bit character key is <strong>TheTestKeyUsedIs32CharactersLong</strong></li>
  <li>Input is <strong>PuYNZO+SLqFo6g97gxKr2uAPRUph/sZgaJ3T5YIBPIc=</strong></li>
  <li>Should be decrypted in <strong>100836</strong></li>
  </ul>
  
  <p>But, result is completely unexpected.</p>
  
  <p>I have also tried a java program to decrypt it but there I was getting other strings so thought to correct it with command line first and then will jump into the code.</p>
  
  <p>I also tried the key in hex digits but still the response was incorrect and was not as expected.</p>