title: rare characters at the beginning openssl_private_encrypt
body: <p>I have a tester page from my Broker, in the first section I include a certificate (.crt) file</p>
  
  <blockquote>
    <p><code>MIIFETCCA/mgAwIBAgIUMDAwMDAwMDAwMDAwM...</code></p>
  </blockquote>
  
  <p>and a second section with an encrypted string with my private key, the original string is "<code>f2e140eb-2b09-44ab-8504-87b25d81914c</code>", and the resulting encrypted string with my priv key is:</p>
  
  <blockquote>
    <p><code>ugSMAsCQlIKIlQ17exIvSEqkA60eWcnF4AAEVJG3BP4hYcCc+DCKeeHur6X2ShbjYWoeugPJe7AecPO0JY9jG75R67jS1OLUeUkB7HZqXCSzPANKWjQ/vx+0O0PlHHcWI24aUFCSiA2iuNXcssIbt2uJAChegXa7XKgNXxDJm+o=</code></p>
  </blockquote>
  
  <p>there is a button with label "Decipher", when a press it, I obtain:</p>
  
  <blockquote>
    <p><code>�����������������������������������������������������������������������������������������f2e140eb-2b09-44ab-8504-87b25d81914c</code></p>
  </blockquote>
  
  <p>As you can see, I obtained the original string, but a lot of strange characters at the beginning, with this, I can not continue with the signature process.</p>
  
  <p>Technical notes (maybe I am doing something wrong):
  The first part (certificate:MIIFETC.....) is obtained with:</p>
  
  <pre><code>$filename="instancia_ope.cer";
  $imgbinary = fread(fopen($filename, "r"), filesize($filename));
  $certificadoInstancia64 = base64_encode($imgbinary);
  </code></pre>
  
  <p>and the string encrypted with my priv key (ugSMAsCQlIKI......) with:</p>
  
  <pre><code>$llave_priv = file_get_contents("i.pem");  //i.pem is my private key file
  $plaintext = "f2e140eb-2b09-44ab-8504-87b25d81914c";
  openssl_private_encrypt($plaintext, $encrypted, $llave_priv);
  $reto = base64_encode($encrypted);
  </code></pre>
  
  <p>I obtained the i.pem file from the .key file with</p>
  
  <pre><code>openssl pkcs8 -inform DER -in instancia_ope.key -out i.pem
  </code></pre>
  
  <p>Is there any error in my procedure? I asked my Broker what the decipher button does, but I have not received answer.</p>