why this strange output

60 views
Skip to first unread message

agente_mor

unread,
Feb 14, 2013, 6:58:45 PM2/14/13
to xmlse...@googlegroups.com

   Hi!

   I have a key file called: "instancia_ope.key"
   I transformed it to .pem file with:

   openssl pkcs8 -inform DER -in instancia_ope.key -out i.pem

   in order to use it in the openssl functions in php:
   I encrypt the string: f2e140eb-2b09-44ab-8504-87b25d81914c, like the following

   $fp=fopen("i.pem","r");
   $priv_key=fread ($fp,8192);
   fclose($fp);
   openssl_get_privatekey ($priv_key);
   $source = "f2e140eb-2b09-44ab-8504-87b25d81914c";
   openssl_private_encrypt($source,$finaltext,$priv_key);
   echo "String crypted: $finaltext";
 
   But the String crypted $finaltext, looks like:

   Any hint of why it is sending this strange stream will be really apreciated.
   There should be output only ascii characters, shouldnt it???
   mario

Rob Richards

unread,
Feb 19, 2013, 11:05:02 AM2/19/13
to xmlse...@googlegroups.com, agente_mor
That is the raw encrypted output, which is binary. You need to encode it, typically base64, to get it into an ascii format.

Rob
--
You received this message because you are subscribed to the Google Groups "xmlseclibs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmlseclibs+...@googlegroups.com.
To post to this group, send email to xmlse...@googlegroups.com.
Visit this group at http://groups.google.com/group/xmlseclibs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages