<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/ChaChaPoly/open(inPlace:using:nonce:authenticating:tag:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit03ChaC4PolyO4open7inPlace5using5nonce14authenticating3tagys14MutableRawSpanVz_AA12SymmetricKeyVAC5NonceVs0mN0VSgAQtKFZ"
  },
  "title" : "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.

```
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

The call throws an error if decryption or authentication fail.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)