<!--
{
  "documentType" : "article",
  "framework" : "Security",
  "identifier" : "/documentation/Security/transform-attributes",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Transform Attributes"
}
-->

# Transform Attributes

Specify the attributes of a transform.

## Discussion

Use these keys and values when accessing transform attributes by name, such as with the [`SecTransformSetAttribute(_:_:_:_:)`](/documentation/Security/SecTransformSetAttribute(_:_:_:_:)) and [`SecTransformGetAttribute(_:_:)`](/documentation/Security/SecTransformGetAttribute(_:_:)) functions. You can also use some of the values directly in certain function calls, such as when you create a encode transform with the [`SecEncodeTransformCreate(_:_:)`](/documentation/Security/SecEncodeTransformCreate(_:_:)) function and give it an `encodeType` parameter to seed the [`kSecEncodeTypeAttribute`](/documentation/Security/kSecEncodeTypeAttribute) attribute.

## Topics

### Encode and Decode Keys

[`kSecEncodeLineLengthAttribute`](/documentation/Security/kSecEncodeLineLengthAttribute)

The length of encoded Base32 or Base64 lines.

[`kSecEncodeTypeAttribute`](/documentation/Security/kSecEncodeTypeAttribute)

The encoding used by an encode transform.

[`kSecDecodeTypeAttribute`](/documentation/Security/kSecDecodeTypeAttribute)

The encoding used by a decode transform.

[`kSecCompressionRatio`](/documentation/Security/kSecCompressionRatio)

The compression ratio.

### Digest and Encryption Keys

[`kSecDigestTypeAttribute`](/documentation/Security/kSecDigestTypeAttribute)

The digest algorithm.

[`kSecDigestLengthAttribute`](/documentation/Security/kSecDigestLengthAttribute)

The digest length.

[`kSecDigestHMACKeyAttribute`](/documentation/Security/kSecDigestHMACKeyAttribute)

The key for HMAC operation.

[`kSecInputIsAttributeName`](/documentation/Security/kSecInputIsAttributeName)

The type of input to the transform.

[`kSecEncryptionMode`](/documentation/Security/kSecEncryptionMode)

The encryption mode.

[`kSecEncryptKey`](/documentation/Security/kSecEncryptKey)

The encryption key for the transform.

[`kSecIVKey`](/documentation/Security/kSecIVKey)

The setting for an initialization vector.

[`kSecPaddingKey`](/documentation/Security/kSecPaddingKey)

The kind of padding to use.

[`kSecOAEPEncodingParametersAttributeName`](/documentation/Security/kSecOAEPEncodingParametersAttributeName)

The OAEP encoding parameters.

[`kSecOAEPMGF1DigestAlgorithmAttributeName`](/documentation/Security/kSecOAEPMGF1DigestAlgorithmAttributeName)

The OAEP MGF1 digest algorithm.

[`kSecOAEPMessageLengthAttributeName`](/documentation/Security/kSecOAEPMessageLengthAttributeName)

The OAEP message length.

### Transform Keys

[`kSecTransformInputAttributeName`](/documentation/Security/kSecTransformInputAttributeName)

The input to a transform.

[`kSecTransformOutputAttributeName`](/documentation/Security/kSecTransformOutputAttributeName)

The output of a transform.

[`kSecTransformDebugAttributeName`](/documentation/Security/kSecTransformDebugAttributeName)

A write stream that should receive debug data.

[`kSecKeyAttributeName`](/documentation/Security/kSecKeyAttributeName)

The cryptographic key associated with a transform.

[`kSecSignatureAttributeName`](/documentation/Security/kSecSignatureAttributeName)

The cryptographic signature associated with a transform.

[`kSecTransformAbortAttributeName`](/documentation/Security/kSecTransformAbortAttributeName)

The reason for an abort.

[`kSecTransformTransformName`](/documentation/Security/kSecTransformTransformName)

The name of a transform.

### Encode Types

Values you use with the [`kSecEncodeTypeAttribute`](/documentation/Security/kSecEncodeTypeAttribute)

The encoding used by an encode transform. and [`kSecDecodeTypeAttribute`](/documentation/Security/kSecDecodeTypeAttribute)

The encoding used by a decode transform. keys.

[`kSecBase32Encoding`](/documentation/Security/kSecBase32Encoding)

A base 32 encoding.

[`kSecBase64Encoding`](/documentation/Security/kSecBase64Encoding)

A base 64 encoding.

[`kSecZLibEncoding`](/documentation/Security/kSecZLibEncoding)

A compressed encoding.

### Digest Types

Values you use with the [`kSecDigestTypeAttribute`](/documentation/Security/kSecDigestTypeAttribute)

The digest algorithm. key.

[`kSecDigestMD2`](/documentation/Security/kSecDigestMD2)

An MD2 digest.

[`kSecDigestMD4`](/documentation/Security/kSecDigestMD4)

An MD4 digest.

[`kSecDigestMD5`](/documentation/Security/kSecDigestMD5)

An MD5 digest.

[`kSecDigestSHA1`](/documentation/Security/kSecDigestSHA1)

An SHA1 digest.

[`kSecDigestSHA2`](/documentation/Security/kSecDigestSHA2)

An SHA2 digest.

[`kSecDigestHMACMD5`](/documentation/Security/kSecDigestHMACMD5)

An HMAC using the MD5 digest algorithm.

[`kSecDigestHMACSHA1`](/documentation/Security/kSecDigestHMACSHA1)

An HMAC using the SHA1 digest algorithm.

[`kSecDigestHMACSHA2`](/documentation/Security/kSecDigestHMACSHA2)

An HMAC using one of the SHA2 digest algorithms.

### Line Lengths

Values you use with the [`kSecEncodeLineLengthAttribute`](/documentation/Security/kSecEncodeLineLengthAttribute)

The length of encoded Base32 or Base64 lines. key.

[`kSecLineLength64`](/documentation/Security/kSecLineLength64)

A line length of 64 bytes.

[`kSecLineLength76`](/documentation/Security/kSecLineLength76)

A line length of 76 bytes.

### Input Types

Values you use with the [`kSecInputIsAttributeName`](/documentation/Security/kSecInputIsAttributeName)

The type of input to the transform. key.

[`kSecInputIsDigest`](/documentation/Security/kSecInputIsDigest)

The input is a digest of the original data.

[`kSecInputIsPlainText`](/documentation/Security/kSecInputIsPlainText)

The input is plain text.

[`kSecInputIsRaw`](/documentation/Security/kSecInputIsRaw)

The input is raw.

### Padding Types

Values you use with the [`kSecPaddingKey`](/documentation/Security/kSecPaddingKey)

The kind of padding to use. key.

[`kSecPaddingNoneKey`](/documentation/Security/kSecPaddingNoneKey)

No padding will be used when encrypting or decrypting.

[`kSecPaddingOAEPKey`](/documentation/Security/kSecPaddingOAEPKey)

PKCS7 padding will be used when encrypting or decrypting.

[`kSecPaddingPKCS1Key`](/documentation/Security/kSecPaddingPKCS1Key)

PKCS1 padding will be used when encrypting or decrypting.

[`kSecPaddingPKCS5Key`](/documentation/Security/kSecPaddingPKCS5Key)

PKCS5 padding will be used when encrypting or decrypting.

[`kSecPaddingPKCS7Key`](/documentation/Security/kSecPaddingPKCS7Key)

PKCS7 padding will be used when encrypting or decrypting.

### Encryption Modes

Values you use with the [`kSecEncryptionMode`](/documentation/Security/kSecEncryptionMode)

The encryption mode. key.

[`kSecModeNoneKey`](/documentation/Security/kSecModeNoneKey)

No mode will be used when encrypting or decrypting.

[`kSecModeCBCKey`](/documentation/Security/kSecModeCBCKey)

CBC mode will be used when encrypting or decrypting.

[`kSecModeCFBKey`](/documentation/Security/kSecModeCFBKey)

CFB mode will be used when encrypting or decrypting.

[`kSecModeECBKey`](/documentation/Security/kSecModeECBKey)

ECB mode will be used when encrypting or decrypting.

[`kSecModeOFBKey`](/documentation/Security/kSecModeOFBKey)

OFB mode will be used when encrypting or decrypting.



---

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)