Jalz Posted June 10, 2009 Posted June 10, 2009 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
Ocean West Posted June 11, 2009 Posted June 11, 2009 I believe you could use ScriptMaster plugin http://www.360works.com/scriptmaster/
Jalz Posted June 11, 2009 Author Posted June 11, 2009 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.......
fseipel Posted July 7, 2009 Posted July 7, 2009 (edited) 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 July 7, 2009 by Guest
Jalz Posted July 7, 2009 Author Posted July 7, 2009 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.
fseipel Posted July 8, 2009 Posted July 8, 2009 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.
Will Loving Posted June 7, 2010 Posted June 7, 2010 Internally, I believe FM uses ASCII 11 as a CR rather than the standard ASCII 13
Recommended Posts
This topic is 5281 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now