title: Different encrypted outputs in AES implementations?
body: <p>I'm testing some <strong>AES</strong> implementation in C, got it from <a href="http://www.efgh.com/software/rijndael.htm" rel="nofollow noreferrer">here</a>, compiled it and tested it, encrypting and decrypting works fine for each other.</p>
  
  <p>At <a href="http://www.efgh.com/software/rijndael.htm" rel="nofollow noreferrer">site</a> it says: </p>
  
  <blockquote>
    <p><strong><em>This implementation encrypts 128-bit blocks.</em></strong>    </p>
  </blockquote>
  
  <p>And also</p>
  
  <blockquote>
    <p><strong><em>These programs should be used only for demonstration purposes, because the use of a password as a key gives an effective key length much shorter than the 256-bit key passed to the Rijndael encryption package.</em></strong></p>
  </blockquote>
  
  <p>So, I'm trying to test them and interact with the <strong>openssl</strong>, so if I encrypt anything with the compiled code I got, it can be decrypted with open-ssl or viceversa.</p>
  
  <p>I've tried with <code>openssl aes-128-cbc -in attack-plan.txt -out message.enc</code> for encrypting and <code>openssl aes-128-cbc -d -in message.enc -out plain-text.txt</code> for decrypting, methods which I actually got from <a href="https://askubuntu.com/questions/60712/how-do-i-quickly-encrypt-a-file-with-aes">here</a>. Also tried with <em><code>128-ecb</code></em> but not getting results.</p>
  
  <p>When I try to decrypt with openssl a file encrypted with the compiled code, and I input the password, it gives me the <em>bad magic number</em> error. When I try to decrypt an openssl encrypted file with my compiled code I'm not getting a right decrypted output.</p>
  
  <p>I really need to get <em>any</em> implementation of AES in C, and proove it against openssl and getting it working good together.</p>