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

Encr_GeneratePassword

Generates a random password with the specified length.

SyntaxFunction badge

Encr_GeneratePassword( switches ; passwordLength )

Parameters

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

Switches

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

Text

Result

The generated password or an error code.

Returned error codes can be:

$$-50 Parameter error

Originated in

Troi Encryptor Plug-in 5.0

Compatibility

FileMaker Pro 16 to FileMaker Pro 2023

Considerations

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.

Example

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

GeneratePassword.fmp12

Related functionsFunction badge

Encr_DecryptAES
Encr_EncryptAES
Encr_GetPasswordStrength
Encr_SavePasswordToKeychain

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

troi.com
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping us to understand which sections of the website you find most interesting and useful.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.