<div dir="ltr">Thanks, you are rigth. I did a test with <div><br></div><div>echo -n <span style="font-size:12.8px">005863330</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">and </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">echo 005863330</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">and the last one adds the new line character.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I also checked that openssl is not adding this new line character. Now with this command:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">echo -n 005863330 | openssl enc -e -des-ede3-cbc -K 'b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b' -iv 00000000 -nosalt | openssl enc -base64</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I get:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">H6cr2yN8oWV6AUY/JlknQw==</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">but is not exactly the same result I get for the same input in my Java and PHP examples. In those ones I get:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">H6cr2yN8oWUVY3a6/Vaaow==</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">In the Java and PHP examples the input data is hardcoded in text:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">text "005863330"</span></div><div><span style="font-size:12.8px">key "b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b"</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Regards.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-24 18:19 GMT+01:00 Jay Foster <span dir="ltr"><<a href="mailto:jayf0ster@roadrunner.com" target="_blank">jayf0ster@roadrunner.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>It is very likely that your text file
      also contains a newline at the end, so getting the same result as
      with the echo command would be expected.  If it is indeed the
      newline that is making the difference, you could try using the
      echo command with the '-n' option to suppress it.<span class="HOEnZb"><font color="#888888"><br>
      <br>
      Jay</font></span><div><div class="h5"><br>
      <br>
      On 11/24/2015 9:12 AM, David García wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">Sorry, still not getting the same result, now with
        the command:
        <div><br>
        </div>
        <div>echo 005863330 | openssl enc -e -des-ede3-cbc -K
          'b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b' -iv
          00000000 -nosalt | openssl enc -base64<br>
        </div>
        <div><br>
        </div>
        <div>I get:<br>
        </div>
        <div><br>
        </div>
        <div>H6cr2yN8oWXn2RxiDqnXLg==<br>
        </div>
        <div><br>
        </div>
        <div>but I should get:</div>
        <div><br>
        </div>
        <div>H6cr2yN8oWUVY3a6/Vaaow==<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>BTW I get the same result if the text in the echo is
          between '' or is read from a text file.</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2015-11-24 18:07 GMT+01:00 David García
          <span dir="ltr"><<a href="mailto:garcia.narbona@gmail.com" target="_blank">garcia.narbona@gmail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">You are right Viktor, that was my problem.
              <div><br>
              </div>
              <div>Thank you very much for your help Viktor and Michael.</div>
            </div>
            <div class="gmail_extra">
              <div>
                <div><br>
                  <div class="gmail_quote">2015-11-24 18:00 GMT+01:00
                    Viktor Dukhovni <span dir="ltr"><<a href="mailto:openssl-users@dukhovni.org" target="_blank"></a><a href="mailto:openssl-users@dukhovni.org" target="_blank">openssl-users@dukhovni.org</a>></span>:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On
                        Tue, Nov 24, 2015 at 05:55:42PM +0100, David
                        García wrote:<br>
                        <br>
                        > openssl enc -e -des-ede3-cbc -in myfile.txt
                        -k<br>
                        >
                        'b2aec78eb50e05f2a60b9efa20b82c903e6cad4f3bd2027b'
                        -iv 00000000 -nosalt |<br>
                        > openssl enc -base64<br>
                        <br>
                      </span>Please read Michael's message carefully. 
                      Note the comment about<br>
                      "-k" vs. "-K" (upper-case).<br>
                      <span><font color="#888888"><br>
                          --<br>
                                  Viktor.<br>
                        </font></span>
                      <div>
                        <div>_______________________________________________<br>
                          openssl-users mailing list<br>
                          To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <div><br>
                  </div>
                </div>
              </div>
              <span><font color="#888888">-- <br>
                  <div>David</div>
                </font></span></div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div>David</div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
openssl-users mailing list
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">David</div>
</div>