title: Encrypt/Decrypt binary mp3 with mcrypt, missing mimetype
body: <p>I have a script that read a mp3 file and encrypt it, I want to be able to decrypt this file and convert it to base64 so it can play in html5.</p>
  
  <p>Key 1 will be stored on the page and static, key2 will be unique for each file, for testing I used:</p>
  
  <pre><code>$key1 = md5(time());
  $key2 = md5($key1.time());
  </code></pre>
  
  <p>Here is my encode php code :</p>
  
  <pre><code>//Get file content
  $file = file_get_contents('test.mp3');
  //Encrypt file
  $Encrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key1, $file, MCRYPT_MODE_CBC, $key2);
  $Encrypt = trim(base64_encode($Encrypt));
  //Create new file
  $fileE = "test.mp3e"; $fileE = fopen($file64, 'w') or die("can't open file");
  //Put crypted content
  fwrite($fileE, $Encrypt);
  //Close file
  fclose($fileE);
  </code></pre>
  
  <p>Here is the code that doesnt work (decoded file is same size, but no mimetype):</p>
  
  <pre><code>//Get file content
  $fileE = file_get_contents('test.mp3e');
  //Decode
  $fileDecoded = base64_decode($fileE);
  //Decrypt file
  $Decrypt = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key1, $fileDecoded, MCRYPT_MODE_CBC, $key2);
  $Decrypt = trim($Decrypt);
  //Create new file
  $file = "test.mp3"; $file = fopen($file, 'w') or die("can't open file");
  //Put crypted content
  fwrite($file, $Decrypt);
  //Close file
  fclose($file);
  </code></pre>