<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SymmetricKeySize",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit16SymmetricKeySizeV"
  },
  "title" : "SymmetricKeySize"
}
-->

# SymmetricKeySize

The sizes that a symmetric cryptographic key can take.

```
struct SymmetricKeySize
```

## Overview

When creating a new [`SymmetricKey`](/documentation/CryptoKit/SymmetricKey) instance with a call to its
[`init(size:)`](/documentation/CryptoKit/SymmetricKey/init(size:)) initializer, you typically use one of the
standard key sizes, like [`bits128`](/documentation/CryptoKit/SymmetricKeySize/bits128), [`bits192`](/documentation/CryptoKit/SymmetricKeySize/bits192), or [`bits256`](/documentation/CryptoKit/SymmetricKeySize/bits256). When you
need a key with a non-standard length, use the [`init(bitCount:)`](/documentation/CryptoKit/SymmetricKeySize/init(bitCount:))
initializer to create a `SymmetricKeySize` instance with a custom bit count.

## Topics

### Using standard key lengths

[`static var bits128: SymmetricKeySize`](/documentation/CryptoKit/SymmetricKeySize/bits128)

A size of 128 bits.

[`static var bits192: SymmetricKeySize`](/documentation/CryptoKit/SymmetricKeySize/bits192)

A size of 192 bits.

[`static var bits256: SymmetricKeySize`](/documentation/CryptoKit/SymmetricKeySize/bits256)

A size of 256 bits.

### Creating a nonstandard key length

[`init(bitCount: Int)`](/documentation/CryptoKit/SymmetricKeySize/init(bitCount:))

Creates a new key size of the given length.

### Getting the length

[`let bitCount: Int`](/documentation/CryptoKit/SymmetricKeySize/bitCount)

The number of bits in the key.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)