---
title: "open(inPlace:using:nonce:authenticating:tag:)"
framework: cryptokit
role: symbol
role_heading: Type Method
path: "cryptokit/chachapoly/open(inplace:using:nonce:authenticating:tag:)"
---

# open(inPlace:using:nonce:authenticating:tag:)

Decrypts the message and verifies the authenticity of both the encrypted message and additional data.

## Declaration

```swift
static func open(inPlace message: inout MutableRawSpan, using key: SymmetricKey, nonce: ChaChaPoly.Nonce, authenticating authenticatedData: RawSpan? = nil, tag: RawSpan) throws
```

## Parameters

- `message`: The message, which will be decrypted in place.
- `key`: The cryptographic key that was used to seal the message.
- `nonce`: The nonce used to encrypt the message.
- `authenticatedData`: Additional data that was authenticated.

## Discussion

Discussion The call throws an error if decryption or authentication fail.
