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

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

Secures the given plaintext message in place with encryption and an authentication tag.

## Declaration

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

## Parameters

- `message`: The plaintext data to seal.
- `key`: A cryptographic key used to seal the message.
- `nonce`: The nonce the sealing process requires.
- `authenticatedData`: Additional data to be authenticated.
- `tag`: Will be updated with the 16-byte authentication tag.
