rg3 / libbcrypt Goto Github PK
View Code? Open in Web Editor NEWbcrypt password hash C library
License: Creative Commons Zero v1.0 Universal
bcrypt password hash C library
License: Creative Commons Zero v1.0 Universal
Please recommend which branch do you recommend for production, any performance difference? thank you, master works as expected BTW.
E:\download\bcrypt_ndk-master\bcrypt_ndk-master\app\src\main\cpp\bcrypt/bcrypt.c:119: undefined reference to crypt_gensalt_rn' CMakeFiles/bcrypt.dir/src/main/cpp/bcrypt/bcrypt.c.o: In function
bcrypt_hashpw':
E:\download\bcrypt_ndk-master\bcrypt_ndk-master\app\src\main\cpp\bcrypt/bcrypt.c:127: undefined reference to `crypt_rn'
clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Getting the following during compile-time:
gcc bcrypt.c -o speed
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
/usr/bin/ld: /tmp/ccmyfr34.o: in function `bcrypt_gensalt':
bcrypt.c:(.text+0x230): undefined reference to `crypt_gensalt_rn'
/usr/bin/ld: /tmp/ccmyfr34.o: in function `bcrypt_hashpw':
bcrypt.c:(.text+0x28a): undefined reference to `crypt_rn'
collect2: error: ld returned 1 exit status```
The crypt_blowfish directory exists.
Running Ubuntu 'Disco' (19.04)
Any help?
Without any practical consequences on any systems I'm aware of, the current code wrongly returns 0 (success) from try_read when getting an EOF from /dev/urandom, which shouldn't happen but doesn't make the code any less weak. Also related to this, try_read doesn't really handle a requested read size of zero bytes properly.
Using gcc in netbeans on windows 10 to make the .a file,
I then link the .a file to a test project, and include the header file in it,
It compiles well, and executes but when calling
ret = bcrypt_gensalt(12, salt);
assert(ret == 0);
I get ret "Assertion failed: ret == 0, file main.c, line 20"
is this a bug or has it to do with the linking process
The line
if (try_read(fd, salt, RANDBYTES) != 0)
in bcrypt_gensalt actually puts the random bytes into the salt, not the input array. This means that the input array has whatever is left on the stack and so doesn't contain any randomness.
Is it possible to cross -compile bcrypt library for ARM?
I have tried compiling but in bcrypt/crypt_blowfish/Makefile i see we are including x86.o?
To use bcrypt.a, it has a dependency on crypt_blowfish.a (so you need to build with both.)
I'm rather inexperienced with building static libs with ar, but couldn't we do (to build with only bcrypt.a)
bcrypt.a: bcrypt.o crypt_blowfish/crypt_blowfish.a
ar r bcrypt.a bcrypt.o crypt_blowfish/*.o
instead of
bcrypt.a: bcrypt.o crypt_blowfish/crypt_blowfish.a
ar r bcrypt.a bcrypt.o crypt_blowfish/crypt_blowfish.a
or is this type of coupling a bad idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.