Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto_pwhash (argon2) support #70

Closed
bufke opened this issue Jun 24, 2017 · 9 comments
Closed

crypto_pwhash (argon2) support #70

bufke opened this issue Jun 24, 2017 · 9 comments

Comments

@bufke
Copy link

bufke commented Jun 24, 2017

What kind of work would be involved to add crypto_pwhash to this? If I'm understanding right, git master is using a up to date version of libsodium but it doesn't have any references to crypto_pwhash_*. Is it just a matter of adding the bindings? If so, do you think it's something I could help on and would you be able to point me to something on getting started? I've never worked with Java bindings to C. I'd be happy to pay for any work done by someone else if that is of interest.

@joshjdevl
Copy link
Owner

Thank you, yes it would be updating sodium.i The format is C-style syntax. Most likely can borrow from the existing definitions.

The build scripts already in the repository will invoke SWIG to take care of generating the relevant code. Only thing needed is the function definition header to be added to sodium.i. Of course adding unit tests which invoke the new method would be helpful and useful as well. Those can be added to "/src/test/java/org/libsodium/jni"

@bufke
Copy link
Author

bufke commented Jun 27, 2017

Started work here #71

I'd like to get some tests in. Might take some time to familiarize myself with java workflows and the project itself. I got mvn test working.

@bufke
Copy link
Author

bufke commented Jun 28, 2017

I got some code to generate based on sodium.i and a far too simple java test to pass that calls sodium.crypto_pwhash_bytes_min();

Should I be concerned from this in the build script? It seems to function regardless.

gcc -I../libsodium/src/libsodium/include -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin sodium_wrap.c -shared -fPIC -L/usr/local/lib -L/usr/lib -lsodium -o $jnilib
sodium_wrap.c:781:20: fatal error: sodium.h: No such file or directory

I happens on ./build-kaliumjni.sh inside the docker image. Once I get a better test I'll push the code.

@joshjdevl
Copy link
Owner

Yes I think that is an error in the build step. Which commands were used to run?

You can find an example of the output here

As well as in the Dockerfile

Though you should be able to just pull the built container

@bufke
Copy link
Author

bufke commented Jun 29, 2017

Ok the pull request is ready. It successfully runs a test with a known password + salt and computes the same hash as libsodium in other languages does. Let me know if there should be any style changes or anything else.

@bufke bufke closed this as completed Jul 1, 2017
@pupeno
Copy link

pupeno commented Sep 1, 2017

Any ideas when this is going to be released?

@joshjdevl
Copy link
Owner

Please someone try the 1.0.7-SNAPSHOT and confirm that everything is ok?

@bufke
Copy link
Author

bufke commented Sep 4, 2017

1.0.7 snapshot has been working fine for me. Tested pw_hash and some cryptobox functions.

@joshjdevl
Copy link
Owner

Version 1.0.7 has been released.

@joshjdevl joshjdevl mentioned this issue May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants