---
title: "setPassword(_:)"
framework: applearchive
role: symbol
role_heading: Instance Method
path: "applearchive/archiveencryptioncontext/setpassword(_:)"
---

# setPassword(_:)

Sets the password from the supplied string.

## Declaration

```swift
func setPassword(_ password: String) throws
```

## Parameters

- `password`: The password.

## Discussion

Discussion Use this function to encrypt or decrypt an archive with the scrypt encryption mode.

## See Also

### Setting a password

- [password](applearchive/archiveencryptioncontext/password.md)
- [generatePassword()](applearchive/archiveencryptioncontext/generatepassword().md)
