djmdjm / jbcrypt Goto Github PK
View Code? Open in Web Editor NEWbcrypt for Java
License: Other
bcrypt for Java
License: Other
Hi @djmdjm, checking your site it seems the last release is 0.4 but the version in the java file says 0.2.
% ant
Buildfile: /Users/markbucciarelli/src/github/jBCrypt/build.xml
init:
build:
[javac] build.xml:20: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 1 source file to /Users/markbucciarelli/src/github/jBCrypt/build
[javac]
[javac] WARNING
[javac]
[javac] The -source switch defaults to 9 in JDK 9.
[javac] If you specify -target 1.6 you now must also specify -source 1.6.
[javac] Ant will implicitly add -source 1.6 for you. Please change your build file.
[javac] warning: [options] bootstrap class path not set in conjunction with -source 6
[javac] error: Source option 6 is no longer supported. Use 7 or later.
[javac] error: Target option 6 is no longer supported. Use 7 or later.
BUILD FAILED
build.xml:20: Compile failed; see the compiler error output for details.
Total time: 0 seconds
% ant -version
Apache Ant(TM) version 1.10.12 compiled on October 13 2021
% java -version
java version "17.0.5" 2022-10-18 LTS
Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)
%
Gradle file looks like this:
dependencies {
compile group: 'org.mindrot', name: 'jbcrypt', version: '0.4'
...
}
Kotlin file where import error occurs looks like this:
...
import org.mindrot.jbcrypt.BCrypt
...
fun ...() {
// Hash a password for the first time
val hashed = BCrypt.hashpw(password, BCrypt.gensalt())
// gensalt's log_rounds parameter determines the complexity
// the work factor is 2**log_rounds, and the default is 10
val hashed = BCrypt.hashpw(password, BCrypt.gensalt(12))
// Check that an unencrypted password matches one that has
// previously been hashed
if (BCrypt.checkpw(candidate, hashed))
System.out.println("It matches")
else
System.out.println("It does not match")
}
...
jBCrypt is not compatible with bCrypt hashes generated by other implementations, e.g. PHP or https://bcrypt-generator.com/
Caused by: java.lang.IllegalArgumentException: Invalid salt revision
at org.mindrot.jbcrypt.BCrypt.hashpw(BCrypt.java:665)
at org.mindrot.jbcrypt.BCrypt.checkpw(BCrypt.java:764)
e.g. "test" might be hashed as "$2y$10$h5jWvguJlBPJ8/1KkOBRGeApm9dj0430qnHK5iRp4lb2dBL4DhfnK"
jBcrypt expects a hash to start with $2a ..
General question: are you still supporting this library? The repository looks very outdated (last commits years ago..).
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.