Skip to content

feat: AES-128 support for FairPlay Streaming compatibility#33

Merged
arkavo-com merged 4 commits intomainfrom
feature/fairplay
Dec 27, 2025
Merged

feat: AES-128 support for FairPlay Streaming compatibility#33
arkavo-com merged 4 commits intomainfrom
feature/fairplay

Conversation

@arkavo-com
Copy link
Contributor

Summary

Adds configurable AES key size support to TDF Archive encryption, enabling AES-128-GCM for FairPlay Streaming DRM compatibility.

Closes #32

Changes

  • New TDFKeySize enum (.bits128, .bits256) with algorithm string property
  • TDFEncryptionConfiguration now accepts optional keySize parameter (defaults to .bits256)
  • TDFManifestBuilder supports configurable algorithm parameter
  • CLI supports TDF_KEY_SIZE environment variable (128 or 256)
  • 12 new tests for AES-128 encryption/decryption

API Usage

let config = TDFEncryptionConfiguration(
    kas: kasInfo,
    policy: policy,
    keySize: .bits128  // For FairPlay compatibility
)

Backward Compatibility

  • Default remains AES-256-GCM
  • NanoTDF unchanged (requires AES-256 per spec)
  • All existing code works unchanged

Test plan

  • testTDFKeySizeEnum - enum properties correct
  • testAES128KeyGeneration - generates 16-byte keys
  • testAES128EncryptionDecryption - round-trip works
  • testAES128EndToEndEncryption - full TDF workflow
  • testAES128RSAKeyWrapping - key wrapping/unwrapping
  • testManifestBuilderWithAES128 - manifest algorithm string
  • All 32 StandardTDFTests passing

🤖 Generated with Claude Code

arkavo-com and others added 4 commits December 27, 2025 12:35
Add configurable key size support to TDF Archive encryption:
- New TDFKeySize enum (.bits128, .bits256) with algorithm string
- TDFEncryptionConfiguration now accepts keySize parameter
- TDFManifestBuilder supports algorithm parameter
- CLI supports TDF_KEY_SIZE environment variable
- 12 new tests for AES-128 encryption/decryption

Default remains AES-256-GCM for backward compatibility.
NanoTDF unchanged (requires AES-256 per spec).

Closes #32

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Include KAS public key in collection header for KeyStore lookup
- Update KeyStore.derivePayloadSymmetricKey to use v12 salt
- Update tests to match v12 salt derivation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sonarqubecloud
Copy link

@arkavo-com arkavo-com merged commit 64df974 into main Dec 27, 2025
7 checks passed
@arkavo-com arkavo-com deleted the feature/fairplay branch December 27, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: AES-128 Support for FairPlay Streaming Compatibility

1 participant