Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

md5 custom function

Featured Replies

Hi guys,

Is there a MD5 custom function available for FileMaker 10 as I would like to store usernames and passwords in a filemaker table, but hash the password. The solution will be using a php web front end and the md5 hashing function is built in, however I will want the FileMaker app to also include a portal into the application - so in other words I need a custom function md5 hash that is compatible with the php md5 hash.

Many Thanks

I believe you could use ScriptMaster plugin

http://www.360works.com/scriptmaster/

  • Author

Thanks Ocean West, does seem an interesting plugin, my only reservation was its Java based which is an additional procedure for my clients to install - found a custom function http://www.unwwwired.net/projects/md5 but I dont think the hashes are exactly the same as the php md5 function. Secondly I dont think you can add salt....so the search continues.......

  • 4 weeks later...

The MD5 functions in the example you provided a link for can be changed; however, they are in custom functions, not scripts. From your post it looks like you have Developer edition of Filemaker, so go to File|Manage|Custom Functions, the scripts are even commented. Can you give an example of how the hash doesn't match? Are you sure you're not comparing the calculated hash (MD5) to an HMAC-MD5 HASH? Those would disagree. Or are there non-printing characters in what you are trying to hash? If so, there may be an encoding issue.

It is also possible to calculate any sort of hash in javascript, in a webviewer window, however this isn't the most elegant way to add functionality to Filemaker. e.g., generate a javascript inside a field, save the field to a file, load the page into a webviewer, and then return the results into Filemaker. If the webviewer is 1 pixel x 1 pixel, it won't be visible. I've been experimenting with this methodology over the last few days as a means of extending Filemaker's calculation engine. http://phpjs.org/functions/md5:469

I have also experimented with x-fer of calculated data back to Filemaker (from a webviewer); I was able to achieve it, but only by using clipboard, which is not very elegant. x-fer of HTML source is trivial of course.

Edited by Guest

  • Author

Hi fseipel,

I haven't take this any further yet, as Im working on the php side of things developing a web frontend to the database.

The custom function I found does look like it will do what I want, and I've been in contact with the developer who says its md5 so hopefully that'll be good enough for my purpose. Unfortunately, there are quite a lot of functions to copy over and I wish we could easily import custom functions from one file to another, but I guess that's a feature request to FM for v11?.

Your idea of using the webviewer is very neat and wouldn't mind you keeping me informed if you choose to go this route with performance and reliability of the method.

Out of curiosity, does the string you are attempting to get an MD5 hash of, have carriage returns in it? The reason I ask is, I think Filemaker represents a carriage return as character code 13; on *NIX, I think it uses 10. That might explain, this discrepancy in the calculated hashes, which you describe (between PHP and this FM function). I have done other hashes with Filemaker, and I recommend, before doing the hash, substitute CHAR(10) for any returns in the Filemaker field. Do this, and the hashes ought to agree (PHP and Filemaker). I did not write the hash algorithm referred to earlier in this thread, but I compared it to others, and it gives identical results.

If you want to confirm an MD5 hash is correct, there are test vectors for this. Or, use an online calculator where you just enter a string and they display the hash on a web page.

  • 10 months later...

Internally, I believe FM uses ASCII 11 as a CR rather than the standard ASCII 13

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.