---
title: "open(_:using:)"
framework: cryptokit
role: symbol
role_heading: Type Method
path: "cryptokit/chachapoly/open(_:using:)"
---

# open(_:using:)

Decrypts the message and verifies its authenticity.

## Declaration

```swift
static func open(_ sealedBox: ChaChaPoly.SealedBox, using key: SymmetricKey) throws -> Data
```

## Parameters

- `sealedBox`: The sealed box to open.
- `key`: The cryptographic key that was used to seal the message.

## Return Value

Return Value The original plaintext message that was sealed in the box, as long as the correct key is used and authentication succeeds. The call throws an error if decryption or authentication fail.

## See Also

### Decrypting and verifying the message

- [open(_:using:authenticating:)](cryptokit/chachapoly/open(_:using:authenticating:).md)
