Brian Dunning's FileMaker Custom Functions

OK_Decrypt ( Text ; Key )

Decrypt data encrypted with OK_Encrypt CF

  Average rating: 4.6 (32 votes) Log in to vote

Peter Vinogradov   Peter Vinogradov - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
OK_Decrypt ( "ÔÛÐÑ" ; "Goodbye")
  Sample output:
"Hello"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Decrypts text encrypted with the "OK_Encrypt" CF

 

Comments

Charles   Charles, Elberton
Aug 23, 2014
Strange... the Encrypt half of the function seems identical to this even to having the Decrypt comments... Does that mean we only need one function to do both, encrypt and decrypt?
 
Peter Vinogradov   Peter Vinogradov
Aug 25, 2014
Yep, they've essentially the same function, except in the Decrypt version you subtract the key letter from the ciphertext, and in the Encrypt version you add the keyletter to the ciphertext.

It's
v = Char ( Code ( Left ( text ; 1 ) ) - Code (Middle (key ; i;1) ) );
versus
v = Char ( Code ( Left ( text ; 1 ) ) + Code (Middle (key ; i;1) ) );

But you're right, I didn't change it in the comment text - sloppy of me. I've fixed it now.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: