<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 5, 2015 at 7:45 PM, Antonis Kouzoupis <span dir="ltr"><<a href="mailto:kouzan@riseup.net" target="_blank">kouzan@riseup.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":oi" class="a3s" style="overflow:hidden">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?</div></blockquote></div><br></div><div class="gmail_extra">I'm not really sure what your goal is cryptographically in this scheme. Clearly, one of the steps doesn't agree and this is why it fails, but what are you trying to achieve in the first place? Having a "naked" symmetric key with no way to replace it per session will make you quite susceptible to a global passive adversary since the scheme has no forward secrecy.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Alternatively, look for a SRP implementation since it has provable zero-information loss once the key is initially set up on the server. But this depends on what your goals are.</div><div class="gmail_extra"><br clear="all"><div><br></div>-- <br><div class="gmail_signature">J.</div>
</div></div>