[erlang-questions] Erlang - Java symmetric encryption

Antonis Kouzoupis kouzan@REDACTED
Thu Mar 5 19:45:45 CET 2015


Hi,

I'm trying to build a system where mobile devices (Android) will communicate
each other encrypted TCP messages and the symmetric key distribution will
be handled by a server in Erlang. As an Erlang *newbie*, I've been confused with
the key derivation and encryption/decryption.

What I want is to produce the same key both in mobile (java) and in server (erlang),
Supposedly that the salt is the same. I use the erlang-pbkdf2 [0] module to generate
the key in server and bouncy castle in java. Also I use AES in CTR mode in both
sides to encrypt/decrypt, again the IV is known to both sides. So far the
decrypted ciphertext on server is not the same as the cleartext on mobile.
Can you give me any hint on how to correctly produce the same key (password
based) both in Erland and in Java?

[0] https://github.com/whitelynx/erlang-pbkdf2

Thank you for your time,
-- 
Αντώνης Κουζούπης
Antonis Kouzoupis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150305/5b67fa04/attachment.bin>


More information about the erlang-questions mailing list