<div dir="ltr">Hello,<div><br></div><div>You can try something like <a href="http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange</a> to exchange keys.</div><div><br></div><div>Regards.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-05 19:45 GMT+01:00 Antonis Kouzoupis <span dir="ltr"><<a href="mailto:kouzan@riseup.net" target="_blank">kouzan@riseup.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm trying to build a system where mobile devices (Android) will communicate<br>
each other encrypted TCP messages and the symmetric key distribution will<br>
be handled by a server in Erlang. As an Erlang *newbie*, I've been confused with<br>
the key derivation and encryption/decryption.<br>
<br>
What I want is to produce the same key both in mobile (java) and in server (erlang),<br>
Supposedly that the salt is the same. I use the erlang-pbkdf2 [0] module to generate<br>
the key in server and bouncy castle in java. Also I use AES in CTR mode in both<br>
sides to encrypt/decrypt, again the IV is known to both sides. So far the<br>
decrypted ciphertext on server is not the same as the cleartext on mobile.<br>
Can you give me any hint on how to correctly produce the same key (password<br>
based) both in Erland and in Java?<br>
<br>
[0] <a href="https://github.com/whitelynx/erlang-pbkdf2" target="_blank">https://github.com/whitelynx/erlang-pbkdf2</a><br>
<br>
Thank you for your time,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Αντώνης Κουζούπης<br>
Antonis Kouzoupis<br>
</font></span><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>