Security - Generate password

Declaration

<AMGENERATEPASSWORD MINLENGTH="number" MAXLENGTH="number" RESULTVARIABLE="text" />

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

Practical Usage

Used to build a strong password.

Password Parameters

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 can be used (e.g., upper-case letters, digits, special characters...) and randomly pick characters out of the set. To define a character set, simply tick the appropriate check box of commonly used ranges of characters (shown below). This method is the recommended way to generate random passwords.

  • Pattern - Password generation is based on patterns. A pattern is a string defining the layout of the new password. More details on pattern-based password generation can be found below.

Upper case (A,B,C,...)

Yes/No

No

Yes

UPPDERCASE="no"

If set to YES, upper case characters (e.g., A,B,C,D,E,F,G,...) will be included during password generation. If set to NO, upper case characters will not be included (set to YES 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 set to YES, lower case characters (e.g., t,u,v,w,x,y,z,....) will be included during password generation. If set to NO, lower case characters will not be included (set to YES by default). This parameter is available only if the Generate password using parameter is set to Character sets.

Digits (1,2,3,...)

Yes/No

No

Yes

DIGITS="no"

If set to YES, digits (e.g., 1,2,3,4,5,6,7,8,9,0) will be included during password generation. If set to NO, digits will not be included (set to YES by default). This parameter is available only if the Generate password using parameter is set to Character sets.

Minus (-)

Yes/No

No

No

MINUS="yes"

If set to YES, a minus (-) sign will be included during password generation. If set to NO, a minus sign will not be included (set to NO by default). This parameter is available only if the Generate password using parameter is set to Character sets.

Underline (_)

Yes/No

No

No

UNDERLINE="yes"

If set to YES, an underline (_) will be included during password generation. If set to NO, an underline will not be included (set to NO 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 set to YES, a space ( ) will be included during password generation. If set to NO, a space will not be included (set to NO 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 set to YES, special characters (e.g., !,",#,$,%,&,*,...) will be included during password generation. If set to NO, special characters will not be included (set to NO 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 set to YES, brackets (e.g., (,),[,],{,},<,>) will be included during password generation. If set to NO, brackets will not be included (set to NO 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 set to YES, high ANSI characters from '~' to U255 (excluding U255) will be included during password generation. If set to NO, high ANSI characters will not be included (set to NO 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="assas"

Specifies characters you wish to add manually in addition to the predefined character ranges. All characters that you enter in this edit box will be directly added to the character set.  Advanced Workflows will 'optimize' your character set by removing all duplicate characters. For example, if you enter 'AAAAB'  into this edit box, this results as 'AB'.

Length of generated password

Number

Yes

8

LENGTH="10"

The length (in characters) of the password to generate.

Max length

Number

Yes

(Empty)

MAXLENGTH="11"

Specifies the maximum length of characters that will be used to generate the password.

Pattern (text box)

Text

Yes

(Empty)

PATTERN="ABCdefg$%()"

The character pattern(s) in which 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 set to YES, sets a random permutation on the characters used to generate the password. This uses a pattern generation feature that can be used to generate passwords that follow certain rules (set to NO 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 in which to populate with the newly generated password.

Advanced Parameters

Property

Type

Required

Default

Markup

Description

Each character must occur at most once

Yes/No

No

No

NOREPEATINGCHARS="yes"

If set to YES, characters should not be repeated during password generation. Set to NO by default.

Exclude look alike characters

Yes/No

No

No

EXCLUDELOOKALIKE="yes"

If set to YES, look alike characters (e.g., 1l,0O) should be excluded during password generation. Set to NO by default.

Exclude the following characters

Text

No

(Empty)

EXCLUDE="qp@$z"

Specifies the characters to exclude from password generation.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Password Generation Based on Patterns

Advanced Workflows 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's 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

    and

  • 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.

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}

NOTE: For the above examples, you must enable the Randomly permute characters of password option.

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: Generate a random password and store it in variable "theNewPassword". Minimum password length is 6. Maximum password length is 12.

<AMGENERATEPASSWORD MINLENGTH="6" MAXLENGTH="12" 
RESULTVARIABLE="theNewPassword" />