Skip to main content

Encr_GeneratePassword (function reference)

By April 20, 2023April 25th, 2023Online Help, Troi Encryptor Plug-in
Troi Encryptor Plug-in > Functions reference > Encr_GeneratePassword
Troi Encryptor Plug-in for FileMaker Pro


Generates a random password with the specified length.

SyntaxFunction badge

Encr_GeneratePassword( switches ; passwordLength )


switches modifies the behavior of the function
passwordLength the wanted length of the new password


Switches can be empty or one or more of the following:

-AddSymbols also use these symbol characters: "!@#$%^&*?+"
-ExcludeSimilarChars don’t use these similar characters: "il1oO0"

You can also add one of these 2 switches:

-NoDashes don’t add dashes to the password
-DashesEvery=x every x character of the password is a dash character, "-"

Returned Result

Data type returned



The generated password or an error code.

Returned error codes can be:

$$-50 Parameter error

Originated in

Troi Encryptor Plug-in 5.0


FileMaker Pro 16 to FileMaker Pro 2023


If you supply a password length of zero a password with the default length is returned. As default the plug-in will create a password of 20 characters with dashes every 7 characters, for example “rHm8xr-jWkn6x-KXITLp”

It is advised to use a long length password, a password length of 9 characters for example is no longer considered safe. See also on Wikipedia here.


Set Variable [ $Password ; Encr_GeneratePassword ( "-Unused" ; 20 ) ]

This will generate a random password, for example “H9u4pj-oTLTbq-AQyLOS”.

Example 2

Set Variable [ $Password ; Encr_GeneratePassword ( "-AddSymbols -DashesEvery=5" ; 15 ) ]

This will generate a random password with symbols and a dash every five characters, for example “9bSK-C!md-Azcf#”.

Used in example file


Related functionsFunction badge


Related script stepScript step badge

Save Password to Keychain

Related topics

Troi Encryptor Plug-in online help (overview)

Online Help Page for Troi Encryptor Plug-in for 16 to 2023 –> Encr_GeneratePassword (encrp4326) 2023-0425 15:55:08