<doc>
  <legacy_id>1712</legacy_id>
  <name>password</name>
  <type>property</type>
  <syntax>
    <example>set the password of <i>stack </i>to {<i>passwordString </i>| empty}</example>
  </syntax>
  <library></library>
  <objects>
    <stack/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
  </classification>
  <references>
    <property tag="passKey">passKey Property</property>
    <function tag="mcEncrypt">mcEncrypt Function</function>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Specifies a <property tag="password">password</property> that the user must enter before making changes to the <object tag="stack">stack</object>.</summary>
  <examples>
    <example>set the password of stack "Secrets" to field "Password"</example>
    <example>set the password of this stack to empty <code><i>-- remove password</i></code></example>
  </examples>
  <description>
    <p>Use the <b>password</b> <glossary tag="property">property</glossary> to <glossary tag="encrypt">encrypt</glossary> a <glossary tag="stack">stack's</glossary> contents, allowing access only from within the application.</p>
<p>&nbsp;</p>
<p><b>Value:</b></p>
<p>The <b>password</b> of a <object tag="stack">stack</object> is a <keyword tag="string">string</keyword>.</p>
<p>&nbsp;</p>
<p>By default, the <b>password</b> <glossary tag="property">property</glossary> of newly created <function tag="stacks">stacks</function> is set to empty.</p>
<p>&nbsp;</p>
<p><b>Comments:</b></p>
<p>If the <b>password</b> <glossary tag="property">property</glossary> of a <object tag="stack">stack</object> is not empty, all the text in the <object tag="stack">stack</object> is <glossary tag="encrypt">encrypted</glossary> (so that it cannot be read in another program, such as a text editor). <glossary tag="script">Scripts</glossary>, <property tag="customProperties">custom properties</property>, text in <glossary tag="field">fields</glossary> or <glossary tag="button">buttons</glossary>, and <glossary tag="object">object</glossary> names in a password-protected <object tag="stack">stack</object> are all <glossary tag="encrypt">encrypted</glossary>. However, you can still open the <object tag="stack">stack</object>, see the contents, and get <glossary tag="object">object</glossary> <property tag="properties">properties</property>.</p>
<p>&nbsp;</p>
<p>The <b>password</b> <glossary tag="property">property</glossary> applies to a <object tag="stack">stack</object>, not to the entire <glossary tag="stack file">stack file</glossary>, so it is possible to have a <glossary tag="stack file">stack file</glossary> that contains both password-protected and unprotected <function tag="stacks">stacks</function>. After setting the password the password protection does not take effect until the stack has been removed from memory and reloaded.</p>
<p>&nbsp;</p>
<p>If the <b>password</b> is set, the <glossary tag="stack">stack's</glossary> <glossary tag="script">Scripts</glossary> cannot be modified, its <b>password</b> cannot be changed, and <glossary tag="object">objects</glossary> cannot be copied.</p>
<p>&nbsp;</p>
<p>These restrictions stop operating temporarily for the current session when the stack's <b>passKey</b> <glossary tag="property">property</glossary> is set to the correct <property tag="password">password</property> by a <glossary tag="handler">handler</glossary>.</p>
<p>&nbsp;</p>
<p>To permanently remove the password restrictions, set the stack's <b>password</b> to empty.</p>
<p>Setting the <b>password</b> to empty removes the <property tag="password">password</property> from the <object tag="stack">stack</object> and makes it fully accessible to any user.</p>
<p>&nbsp;</p>
<p><code><b>Note:</b><code> Since all the text in a password-protected <object tag="stack">stack</object> must be <glossary tag="decrypt">decrypted</glossary> when the <object tag="stack">stack</object> is opened, a password-protected <object tag="stack">stack</object> takes longer to open than an unencrypted one, especially if the <object tag="stack">stack</object> is large.</code></code></p>
<p>&nbsp;</p>
<p>The password is encrypted when stored in the stack to prevent cracking the password protection. If you get the <b>password</b> of a <object tag="stack">stack</object>, the <glossary tag="property">property</glossary> reports true if the stack has a password set and false otherwise.</p>
<p>&nbsp;</p>
<p><code><b>Important! </b><code><property tag="password">password</property>-protected <function tag="stacks">stacks</function> may cause some problems when opened in the LiveCode <glossary tag="development environment">development environment</glossary>. (For example, the <glossary tag="Application Browser">Application Browser</glossary> window cannot display properties of a <property tag="password">password</property>-protected <object tag="stack">stack</object>.) If you want to set a <property tag="password">password</property> for <function tag="stacks">stacks</function> before you release them, the recommended method is to set the <property tag="password">password</property> on the Stacks screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window.</code></code></p>
  </description>
</doc>