I am using javaloader 1.0 on a local xp box with coldfusion 9.0. I
have been using it to load Bcrypt (
http://www.mindrot.org/projects/
jBCrypt/) and it works fine with the code at:
http://blog.mxunit.org/2011/02/hashing-passwords-with-bcrypt-in.html:
============================
pw = "happy1.!gIlm0re";
jbClass = expandPath("jBCrypt-0.3");
javaloader = createObject('component', 'javaloader.javaloader');
javaloader.init([jbClass]);
bcrypt = javaloader.create("BCrypt");
hashed = bcrypt.hashpw(pw, bcrypt.gensalt());
===================================
I have now installed it on a shared server at our coldfusion host
(Newtek, formerly Crystaltech) with Windows and Coldfusion 9. Again it
works fine until I do not use the default salt work factor, i.e.,
Works with:
hashed = bcrypt.hashpw(pw, bcrypt.gensalt());
but not with
hashed = bcrypt.hashpw(pw, bcrypt.gensalt(10));
I get a coldfusion error from javaloader when the non-default argument
is used:
Could not find the designated method
Could not find the method 'gensalt' in the class BCrypt The error
occurred in
D:\Inetpub\................SupportFiles\javaloader\JavaProxy.cfc: line
351
Called from D:\Inetpub\..............SupportFiles\javaloader
\JavaProxy.cfc: line 253
Called from D:\Inetpub\..............SupportFiles\javaloader
\JavaProxy.cfc: line 158
Called from D:\Inetpub\..............\SupportFiles\javaloader
\JavaProxy.cfc: line 80
Called from D:\Inetpub\..............\SupportFiles\test_bcryptJL.cfm:
line 34
349 : <cfargument name="message" hint="The message to accompany the
exception" type="string" required="Yes">
350 : <cfargument name="detail" type="string" hint="The detail
message for the exception" required="No" default="">
351 : <cfthrow type="#arguments.type#" message="#arguments.message#"
detail="#arguments.detail#">
352 : </cffunction>
353 :
It may be why it is recommended to test in a shared hosting
environment when admins can turn things off! Anyway I'd appreciate any
insight -- I have the stack traceI could email to anyone.
Thanks.