Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

OK_Encrypt (Text ; Key )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.5  (32 votes)
  Discuss this Custom Function

Peter Vinogradov, Peter Vinogradov Consulting
http://petervinogradov.com

Gently encrypt text with key

Sample Input:
OK_Encrypt ("Hello" ; "Goodbye" )
Sample Output:
ÔÛÐÑ


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

I'm using this to create encrypted QR codes, so it only needs to operate on small amounts of text, and it doesn't need to be totally uncrackable, just difficult.

Note: The function keeps track of its position in the text by enclosing a counter in two sets of pipes ("||"). This isn't the most elegant solution, but it fits my purposes. If you need to use pipes in your text, revise to use a different bracket, or add a counter parameter to the function.

Update: To avoid the pipes issue, please see the much better version offered in the comments below.

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

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 8 comments

Here is another way - this one uses a "caterpillar track" to serve up the key:

http://fmforums.com/forum/topic/68542-custom-functions-to-encrypte- export-files/page__p__325022#entry325022

comment, VR
December 30, 2010 12:53pm

OK, I see what you did. I was stuck mentally on trying to match the key against the text from beginning to end. Your way effectively lays it against the text from back to front, with the advantage that we don't need to know how many letters came before the current letter. Thanks for the improvements! And the article you linked to in your fmforums post was helpful in letting me know that (a) this basically a Vigenere cypher, and (b) cracking a Vigenere cipher is annoying enough that the encryption will meet my needs :)

Peter Vinogradov, Hyde Park, NY
December 30, 2010 1:25pm

Yes, it is basically a Vernam or a Vigenere - except that technically you are supposed to do:

C = Char ( Mod ( Code ( P ) + Code ( K ) ; n )

where n is the length of the allowable alphabet.


As for strength: if you were to use random keys of at least the message length, and use each key only once, then this would be unbreakable (as long as the key remains secret).

comment, VR
December 30, 2010 1:48pm

Very nice code I love it! congratulations, but I have some comments:


For long text (20 words or more) its very slow

if the encryption key has the next shift_alt values it will not work ˜ˆ ...you can add some code to not allow this, but I thing this should be fixed in the formula!

if the key is “r” or “rr” or “rrrrrrrrrrrrrr” the encryption is the same! actually lots of combinations can be the same key

You can know if the encrypted text was encrypted with only numbers just by looking at it ...if you have some knowledge of this formula.


for some reason I don't know the formula stops working I had to close and open the file again (FileMaker 11).


Hope this helps! I still think this is the best encryption formula in this site! :)



Brian

Brian Donovan, Mexico
February 21, 2015 11:57am

Forgot one comment:

The text to encrypt defenetly can't have any shift_alt values!


Brian

Brian Donovan, Mexico
February 21, 2015 12:00pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 3 + 7 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
2. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
3. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
4. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
5. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)
6. ParseWebValueList( text )
  (Thu, Nov 02, 9:52am)
7. SVG_HTML_to_Text ( _svg_text ; _orig_text ;
  (Wed, Oct 25, 4:17am)
8. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)

RSS Feed of Custom Functions