Fork me on GitHub
#babashka
<
2024-01-22
>
iarenaza15:01:42

I'm writing a Babashka script that needs to "hash" some string using the bcrypt algorithm. Unfortunately, there is a hard requirement. The script needs to be self-contained, it needs to run without a JRE/JVM being available. I work around this by creating an uberjar, and then an executable with it, as documented. This part works just fine. But not having a JVM available means that I can't use pods like pod-babashka-buddy (not that this pod provides a naked bcrypt, which is what I need, but that's another issue). What are my options here, if any? Thanks a lot in advance 😊

borkdude15:01:41

> But not having a JVM available means that I can't use pods like pod-babashka-buddy pods do NOT require a JVM

borkdude15:01:00

can you give the full interop of what you want to do, with a minimal example

iarenaza09:01:00

This is what I'd like to achive with Babashka. The minimal example runs fine with clj. https://gist.github.com/iarenaza/d7e22484f825f188e4fc393918a1ae7e

borkdude09:01:59

yeah, this at.favre.lib.crypto.bcrypt isn't going to work, since it's not part of the JDK

borkdude09:01:22

if you want a fast starting script with bcrypt, you could try #C029PTWD3HR (Node.js) as well, but that's a different platform

iarenaza14:01:39

Thanks a lot Michiel! I'll see what I can do. At least now I know that is a dead end 😊

🎉 1
borkdude14:01:43

it's a dead end unless you can provide an example using standard JDK classes ;)

iarenaza18:01:56

In that case, I'd say it's a final dead end 😁. As far as I know, no standard JDK classes implements the bcrypt algorithm (and I think bcrypt is not implemented using other "more fundamental" crypto algorithms present in the JDK).