Name: password

Type: property

Syntax: set the password of <stack> to {<passwordString> | empty}

Summary: Specifies a <password> that the user must enter before making changes to the <stack>.

Associations: stack

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
set the password of stack "Secrets" to field "Password"

Example:
set the password of this stack to empty -- remove password

Value: The <password> of a <stack> is a <string>.

Description:
Use the <password> <property> to <encrypt> a <stack|stack's> contents, allowing access only from within the application.

By default, the password property of newly created stacks is set to empty.

If the <password> <property> of a <stack> is not empty, all the text in the <stack> is <encrypt|encrypted> (so that it cannot be read in another program, such as a text editor). <script|Scripts>, <custom property|custom properties>, text in <field|fields> or <button|buttons>, and <object> names in a password-protected <stack> are all <encrypt|encrypted>. However, you can still open the <stack>, see the contents, and get <object> <property|properties>.

The <password> <property> applies to a <stack>, not to the entire <stack file>, so it is possible to have a <stack file> that contains both password-protected and unprotected <stacks>. After setting the password the password protection does not take effect until the stack has been removed from memory and reloaded.

If the <password> is set, the <stack|stack's> <script|Scripts> cannot be modified, its <password> cannot be changed, and <object|objects> cannot be copied.

These restrictions stop operating temporarily for the current session when the stack's <passKey> <property> is set to the correct <password> by a <handler>.

To permanently remove the password restrictions, set the stack's <password> to empty.

Setting the <password> to empty removes the <password> from the <stack> and makes it fully accessible to any user.

>*Note:* Since all the text in a password-protected <stack> must be <decrypt|decrypted> when the <stack> is opened, a password-protected <stack> takes longer to open than an unencrypted one, especially if the <stack> is large.

The password is encrypted when stored in the stack to prevent cracking the password protection. If you get the <password> of a <stack>, the <property> reports true if the stack has a password set and false otherwise.


>*Important:* <password> -protected <stacks> may cause some problems when opened in the LiveCode <development environment>. (For example, the <Application Browser> window cannot display properties of a <password> -protected <stack>.) If you want to set a <password> for <stacks> before you release them, the recommended method is to set the <password> on the Stacks screen of the <Standalone Application Settings> window.

References: password (property), passKey (property), string (keyword), stacks (function), mcEncrypt (function), button (object), field (object), object (object), stack (object), property (glossary), stack file (glossary), password (glossary), development environment (glossary), custom property (glossary), decrypt (glossary), Application Browser (glossary), Standalone Application Settings (glossary), script (glossary), encrypt (glossary), handler (glossary)
