Security - Generate password

Declaration

<AMSECURITY UPPERCASE="YES/NO" LOWERCASE="YES/NO" DIGITS="YES/NO" MINUS="YES/NO" UNDERLINE="YES/NO" SPACE="YES/NO" SPECIAL="YES/NO" BRACKETS="YES/NO" HIGHANSI="YES/NO" INCLUDE="text" LENGTH="number" GENERATEUSING="text (options)" PATTERN="text" PERMUTE="YES/NO" RESULTVARIABLE="text" EXCLUDELOOKALIKE="YES/NO" NOREPEATINGCHARS="YES/NO" EXCLUDE="text" />

Related Topics   

Description

Generates a random string password using any possible printable character between the specified minimum and maximum sizes and stores it as an Automate variable. This string conforms to the standard for strong passwords.

Practical Usage

Used to build a strong password.

Parameters

Password

Property Type Required Default Markup Description
Generate password using Text (options) Yes Character set GENERATEUSING="pattern" Specifies the password generation method. Different parameters apply depending on which method is selected. The available options are:
  • Character Sets - Allows you to select which characters to use (for example, upper-case letters, digits, special characters, etc.) and Automate will randomly pick characters out of the set. To define a character set, select any of the commonly used ranges of characters. This method is the recommended way to generate random passwords.
  • Pattern - Generates pattern-based passwords. A pattern is a string defining the layout of the new password. More details on pattern-based password generation can be found below under Additional Notes.
Upper case (A, B, C, ...) Yes/No No Yes UPPERCASE="NO" If selected, upper case characters (for example, A, B, C, D, E, F, G, etc.) are included during password generation. If disabled, upper case characters are not included (selected by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Lower case (a, b, c, ...) Yes/No No Yes LOWERCASE="NO" If selected, lower case characters (for example, t, u, v, w, x, y, z, etc.) are included during password generation. If disabled, lower case characters are not included (selected by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Digits (0, 1, 2, ...) Yes/No No Yes DIGITS="NO" If selected, digits (1, 2, 3, 4, 5, 6, 7, 8, 9, 0) are included during password generation. If disabled, digits are not included (selected by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Hyphen (-) Yes/No No No MINUS="YES" If selected, a hyphen (-) is included during password generation. If disabled, a hyphen is not included (disabled by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Underscore (_) Yes/No No No UNDERLINE="YES" If selected, an underscore (_) character is included during password generation. If disabled, an underline is not included (disabled by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Space ( ) Yes/No No No SPACE="YES" If selected, a space ( ) character is included during password generation. If disabled, a space is not included (disabled by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Special (!, $, %, ...) Yes/No No No SPECIAL="YES" If selected, special characters (for example, !, ", #, $, %, &, *, etc.) are included during password generation. If disabled, special characters are not included (disabled by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Brackets ([, ], {, }, (, ), <, >, ...) Yes/No No No BRACKETS="YES" If selected, brackets (that is, [, ], {, }, (, ), <, >) are included during password generation. If disabled, brackets are not included (disabled by default). This parameter is available only if the Generate password using parameter is set to Character sets.
High ANSI characters Yes/No No No HIGHANSI="YES" If selected, high ANSI characters from ~ to U255 (excluding U255) are included during password generation. If disabled, high ANSI characters are not included (disabled by default). This parameter is available only if the Generate password using parameter is set to Character sets.
Also include the following characters Text No (Empty) INCLUDE="ste" Specifies characters you wish to add manually in addition to the predefined character ranges. All characters that you enter in this edit box are directly added to the character set. Automate will optimizes character set by removing all duplicate characters. For example, if you enter AAAAB into this edit box, it will be changed to AB.
Length of generated password Number Yes 8 LENGTH="10" The length (in characters) of the password to generate.
Pattern Text Yes, if Generate password using is set to Pattern (Empty) PATTERN="ABCdefg$%()" The character patterns to include in the password generation. This parameter is available only if the Generate password using parameter is set to Pattern. More details on pattern-based password generation can be found below under Additional Notes.
Randomly permute characters of password Yes/No No No PERMUTE="YES" If selected, sets a random permutation on the characters to use to generate the password. This uses a pattern generation feature that can be used to generate passwords that follow certain rules (disabled by default). This parameter is available only if the Generate password using parameter is set to Pattern.
Populate variable with the password Text Yes (Empty) RESULTVARIABLE="thepass" The name of an existing variable to populate with the newly generated password.

Advanced

Property Type Required Default Markup Description
Exclude look alike characters (|1, O0) Yes/No No No EXCLUDELOOKALIKE="YES" If selected, look alike characters (for example, 1l, 0O) are excluded during password generation. Disabled by default.
Do not use same character twice Yes/No No No NOREPEATINGCHARS="YES" If selected, characters do not repeat during password generation. Disabled by default.
Exclude the following characters Text No (Empty) EXCLUDE="qp@$z" Specifies the characters to exclude from password generation.

Description

Error Causes

On Error

Additional Notes

Password Generation Based on Patterns

Automate can create passwords using patterns. A pattern is a string defining the layout of the new password. The following placeholders are supported:

Placeholder Type Character Set
a Lower-Case Alphanumeric abcdefghijklmnopqrstuvwxyz 0123456789
A Mixed-Case Alphanumeric ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
U Upper-Case Alphanumeric ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
c Lower-Case Consonant bcdfghjklmnpqrstvwxyz
C Mixed-Case Consonant BCDFGHJKLMNPQRSTVWXYZ
z Upper-Case Consonant BCDFGHJKLMNPQRSTVWXYZ
d Digit 0123456789
h Lower-Case Hex Character 0123456789 abcdef
H Upper-Case Hex Character 0123456789 ABCDEF
l Lower-Case Letter abcdefghijklmnopqrstuvwxyz
L Mixed-Case Letter ABCDEFGHIJKLMNOPQRSTUVWXYZ
u Upper-Case Letter ABCDEFGHIJKLMNOPQRSTUVWXYZ
p Punctuation ,.;:
b Bracket ()[]{}<>
s Printable 7-Bit Special Character !"#$%&'()*+,-./:;<=>?[\]^_{|}~
S Printable 7-Bit ASCII A-Z, a-z, 0-9, !"#$%&'()*+,-./:;<=>?[\]^_{|}~
v Lower-Case Vowel aeiou
V Mixed-Case Vowel AEIOU
Z Upper-Case Vowel AEIOU
x High ANSI From ~ to U255 (excluding U255)
\ Escape (Fixed Char) Use following character as is
{n} Escape (Repeat) Repeat the previous character n times
[...] Custom Char Set Define a custom character set

The \ placeholder is special: it is an escape character. The next character that follows the \ is written directly into the generated password. If you want a \ in your password at a specific place, you must to enter \\.

Using the {n} code, you can define how many times the previous placeholder should occur. The { } operator duplicates placeholders, not generated characters. Examples:

  • d{4} is equivalent to dddd,

  • dH{4}a is equivalent to dHHHHa

  • Hda{1}dH is equivalent to HdadH

The [...] notation can be used to define a custom character set, from which the password generator will pick one character randomly. All characters between the [ and ] brackets follow the same rules as the placeholders above. Examples:

  • [dp] generates exactly 1 random character out of the set digits + punctuation
  • [d\m\@]{5} generates 5 characters out of the set "0123456789m@"
  • [u\_][u\_] generates 2 characters out of the set upper case + '_'

ddddd generates for example: 41922, 12733, 43960, 07660, 12390, 74680, ...

\H\e\x\:\ HHHHHH generates for example: 'Hex: 13567A', 'Hex: A6B99D', 'Hex: 02243C', ...

Common Password Patterns

Below are a few examples how the pattern generation feature can be used to generate passwords that follow certain rules.

NOTE: For the examples below, you must enable the Randomly permute characters of password parameter.

Name Pattern
WEP Hex Key - 40 Bit h{10}
WEP Hex Key - 128 Bit h{32}
WEP Hex Key - 256 Bit h{64}
Random MAC Address HH\-HH\-HH\-HH\-HH\-HH

Below are a few examples how the pattern generation feature can be used to generate passwords that follow certain rules.

Rule Pattern
Must consist of 2 upper case, 2 lower case characters and 2 digits uulldd
Must consist of 9 digits and 1 letter d{9}L
Must consist of 10 alphanumeric characters, where at least 1 is a letter and at least 1 is a digit LdA{8}
Must consist of 10 alphanumeric characters, where at least 2 are upper case and at least are 2 lower case characters uullA{6}
Must consist of 9 characters out of the set "ABCDEF" and an '@' symbol somewhere in it \@[\A\B\C\D\E\F]{9}

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This sample task generates a random 12-character password and stores it in variable theNewPassword.

Copy
<AMSECURITY LENGTH="12" RESULTVARIABLE="theNewPassword" />