<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorConfiguration/controlPassword",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A13ConfigurationV15controlPasswordSSSgvp"
  },
  "title" : "controlPassword"
}
-->

# controlPassword

Optional password used when `HashedControlPassword` is configured.

```
var controlPassword: String?
```

## Discussion

Maps to torrc `HashedControlPassword` (tor.1.txt). The supplied
value **must already be hashed** (use `tor --hash-password <pw>`
to produce the `16:<hex>` form). Used only when
[`cookieAuthentication`](/documentation/Tor/TorConfiguration/cookieAuthentication) is `false` AND a caller is dialling an
external control port; the embedded pre-authenticated socket
ignores this field.

> Important: Do not commit this value to source control. Inject
> from Keychain (Apple) or environment variables (Linux).