<div dir="ltr"><div><div>Thank you Matt!,</div><div>yes it odd, the component in C# is from a third an we don't know C#, we think that for a moment we could replace that using openssl command line.</div></div><div><br></div><div>Could show me how pass a key to the openssl?</div><div><br></div><div>Thank you!</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">El vie., 15 de jun. de 2018 a la(s) 10:53, Matt Caswell (<a href="mailto:matt@openssl.org">matt@openssl.org</a>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 15/06/18 14:34, Fernando A wrote:<br>
> Hi all,<br>
> <br>
> I am not an expert with openssl and I need replace a component in c#<br>
> that run algorithm Triple DES.<br>
> I tried in the command line something like this <br>
> "openssl enc -des-ede3 -k 1234567890123456ABCDEFGH -in test.txt -out<br>
> test.enc"<br>
> <br>
> but the result that I obtain is diferent of result launched by the c#<br>
> component.<br>
> Of course the passphrase is the same, and always file test.enc contain a<br>
> phrase<br>
> that start with "Salted__..." indifferent of the contain of file test.txt.<br>
> some idea?<br>
> thanks in advance!<br>
<br>
Is your c# component using a passphrase or a key? If a passphrase, how<br>
does it generate the key from that passphrase?<br>
<br>
By default the OpenSSL enc command uses its own key derivation function<br>
(KDF) to generate a key from a passphrase. That KDF uses a random salt<br>
value which it prepends to the beginning of the file. If the KDF in C#<br>
is different (which it almost certainly is), and it doesn't use the same<br>
file format as OpenSSL uses (which it almost certainly doesn't) then<br>
you're going to get different results.<br>
<br>
You can alternatively pass a key rather than a passphrase to the OpenSSL<br>
command line.<br>
<br>
It seems odd that you are using the command line to replace a c#<br>
component, rather than using the OpenSSL APIs.<br>
<br>
Matt<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>
</blockquote></div>