FR - Secure Hash/Compare Util Functions

Would it be possible to get a function to securely hash some string and/or object using a users password (or new hidden/auto generated user metadata) as the salt and a compare function that takes a string and a hash?

or is this just really unlikely and I should just use configuration variables, an RPC call or Retool DB and make a hashing table? now I feel lazy :joy: but since Retool is able to manage passwords and current_user already I figured I might as well ask

Hi @bobthebear,

At the moment Retool doesn’t provide built-in crypto utilities like hash or compare functions tied to current_user or user metadata. Retool’s auth layer manages passwords, but it doesn’t expose them (or any derived secrets) for security reasons.

If you need secure hashing/compare right now, the usual patterns are:

  • Use a backend API / RPC call that implements hashing with a library like bcrypt/argon2, and call that from Retool.
  • Store and compare hashes in Retool DB or your own DB, but do the actual hashing logic server-side.
  • If it’s just lightweight (non-security-critical), you could also do SHA hashing in a JS transformer, though for real authentication/authorization logic I’d strongly recommend a backend.

I’d say this is a valid feature request for a small util library inside Retool (especially for non-security use cases), but for password/identity management it’s unlikely Retool will expose user secrets directly.

Hope that helps clarify!
Best,
David

1 Like

Hi @bobthebear,

I echo @DavidTech's well written comment. I can make a feature request to have this functionality native to Retool as for example a util method.

For short term implementation you would either need to build out this logic or import a JS library to accomplish this :sweat_smile:

1 Like