소스 정보
- 저장소
- tomevault-io/skills-registry
- 최근 소스 활동
- 2026년 7월 3일 19:45
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill swift-post-quantum-security-ios26명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
| name | swift-post-quantum-security-ios26 |
| description | >- Use when this capability is needed. |
iOS 26 ships post-quantum cryptography in two layers. Transport is handled for you: quantum-secure
TLS 1.3 key exchange (hybrid X25519 + ML-KEM-768) is enabled by default for URLSession and the
Network framework — there is no per-request opt-in. Application-layer encryption is available
through CryptoKit's HPKE with the new XWingMLKEM768X25519 ciphersuite, plus first-class MLKEM768,
MLKEM1024, MLDSA65, and MLDSA87 types (with SecureEnclave-backed variants). This skill applies
those primitives correctly — and corrects the single most common myth: CryptoKit.timingSafeEqual
does not exist.
XWingMLKEM768X25519_SHA256_AES_GCM_256.state, CSRF tokens, MACs, capability strings) and need a
constant-time comparison.== on Data/String for a secret, a hand-rolled RSA box,
or a reference to a timingSafeEqual symbol that doesn't compile.Announce on invoke: "Using swift-post-quantum-security-ios26 to apply iOS 26 PQ-CryptoKit and constant-time comparison per Apple's CryptoKit/Security docs."
Do not add an HPKE layer "to get post-quantum" on data that only travels over URLSession —
TLS 1.3 already gives you PQC in transit on iOS 26. Use HPKE for data at rest or end-to-end
payloads the server can't read, where defense-in-depth beyond transit actually buys something.
| API | Signature / form (verified) | Use |
|---|---|---|
| PQ-TLS 1.3 | (none — automatic) | Using URLSession/Network gives hybrid X25519+ML-KEM-768 key exchange by default on iOS 26. Legacy Secure Transport is excluded. |
HPKE.Ciphersuite.XWingMLKEM768X25519_SHA256_AES_GCM_256 | static let … : HPKE.Ciphersuite | The post-quantum HPKE ciphersuite (iOS 26.0+). |
HPKE.Sender | init(recipientKey:ciphersuite:info:) then seal(_:) / seal(_:authenticating:); .encapsulatedKey | Encrypt one or more messages to a recipient public key (iOS 17.0+; PQ via the XWing ciphersuite). |
MLKEM768 / MLKEM1024 | MLKEM768.PrivateKey.generate() throws -> MLKEM768.PrivateKey; .publicKey | Module-lattice KEM (NIST FIPS 203). SecureEnclave.MLKEM768 keeps the key in the SE. |
MLDSA65 / MLDSA87 | MLDSA65.PrivateKey / .PublicKey | Module-lattice digital signatures (NIST FIPS 204). SecureEnclave.MLDSA65 variant exists. |
HMAC.isValidAuthenticationCode(_:authenticating:using:) | static func isValidAuthenticationCode<D>(_ authenticationCode: HMAC<H>.MAC, authenticating authenticatedData: D, using key: SymmetricKey) -> Bool where D: DataProtocol | Constant-time MAC verification. The canonical secret-equality primitive. |
NSPinnedDomains (Info.plist) | dict of domain → NSPinnedCAIdentities / NSPinnedLeafIdentities (+ NSIncludesSubdomains) | Declarative cert pinning for URLSession (iOS 14+). |
SecTrustEvaluateWithError(_:_:) | func SecTrustEvaluateWithError(_ trust: SecTrust, _ error: …) -> Bool | Validate the server trust before SPKI pinning in a URLSessionDelegate. |
XWingMLKEM768X25519.PrivateKeyand itsPublicKeyare real iOS 26.0+ types, but the concrete type's no-argumentinit()/generate()are not documented at a stable URL — create the key via the initializer your CryptoKit version exposes (e.g. the documentedinit(seedRepresentation:publicKey:)) and treat the ciphersuite constant as the load-bearing public API to verify.MLKEM768.PrivateKey.generate()is documented and is the safe example.
CryptoKit.timingSafeEqual — never compare secrets with ==== on String/Data short-circuits on the first differing byte, leaking timing. CryptoKit ships
no timingSafeEqual symbol (a persistent myth). The canonical constant-time tools are:
HMAC<SHA256>.isValidAuthenticationCode(mac, authenticating: data, using: key).Data.elementsEqual(_:) / HashedAuthenticationCode.elementsEqual(_:).On iOS 26, URLSession and Network negotiate hybrid X25519 + ML-KEM-768 automatically and fall
back gracefully when the peer lacks PQC. There is no opt-in flag and no support in the legacy
Secure Transport API. Just use URLSession. Reserve HPKE for app-layer/at-rest payloads.
For quantum-resistant app-layer encryption, use HPKE.Sender/HPKE.Recipient with
.XWingMLKEM768X25519_SHA256_AES_GCM_256. Send the encapsulatedKey alongside the ciphertext; the
recipient reconstructs the same key schedule with its private key. Do not pin app-layer crypto to
RSA-2048 or bare ECDH for new code.
NSPinnedDomains in Info.plist covers URLSession from iOS 14+ (it does not cover
SFSafariViewController, and only covers WKWebView from iOS 16+). For SPKI pinning, rotation, or
backup-pin logic, implement urlSession(_:didReceive:completionHandler:), call
SecTrustEvaluateWithError first, then hash the leaf's public key with SHA-256 and compare against
your pin set. SecTrustCopyCertificateChain requires iOS 15+.
For ML-KEM / ML-DSA keys that never need to leave the device, prefer SecureEnclave.MLKEM768 /
SecureEnclave.MLDSA65 so the private key material is generated and held in the SE; the Keychain
stores only a reference. Gate every PQ API behind #available(iOS 26, *).
Constant-time comparison plus an HPKE seal, using only verified APIs:
import CryptoKit
import Foundation
extension Data {
/// Constant-time equality. Safe ONLY for equal-length secrets.
/// There is no `CryptoKit.timingSafeEqual` — this is the fallback idiom.
func constantTimeEquals(_ other: Data) -> Bool {
guard count == other.count else { return false }
var diff: UInt8 = 0
for i in indices { diff |= self[i] ^ other[i] }
return diff == 0
}
}
/// Verify an OAuth `state` / CSRF token in constant time via HMAC (no `==` on secrets).
func stateMatches(received: Data, expected: Data, key: SymmetricKey) -> Bool {
let expectedMAC = HMAC<SHA256>.authenticationCode(for: expected, using: key)
return HMAC<SHA256>.isValidAuthenticationCode(expectedMAC, authenticating: received, using: key)
}
@available(iOS 26.0, macOS , )
{
suite: . .
( : ,
: .,
: ) -> (encapsulated: , ciphertext: ) {
sender .(recipientKey: recipient, ciphersuite: suite, info: info)
ciphertext sender.seal(payload)
(sender.encapsulatedKey, ciphertext)
}
}
SPKI pinning in a delegate (the control path):
final class PinningDelegate: NSObject, URLSessionDelegate {
let pinnedSPKISHA256: Set<Data>
init(pinnedSPKISHA256: Set<Data>) { self.pinnedSPKISHA256 = pinnedSPKISHA256 }
func urlSession(_ session: URLSession,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
guard challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust,
let trust = challenge.protectionSpace.serverTrust,
SecTrustEvaluateWithError(trust, nil), // validate first
let chain = SecTrustCopyCertificateChain(trust) as? [SecCertificate], // iOS 15+
let leaf = chain.first,
let key = SecCertificateCopyKey(leaf),
let spki (key, ) ?
{ completionHandler(.cancelAuthenticationChallenge, ) }
digest (.hash(data: spki))
completionHandler(pinnedSPKISHA256.contains(digest) .useCredential : .cancelAuthenticationChallenge,
pinnedSPKISHA256.contains(digest) (trust: trust) : )
}
}
URLSession on iOS 26 is already post-quantum.XWingMLKEM768X25519_SHA256_AES_GCM_256.HMAC.isValidAuthenticationCode (or XOR-accumulate on equal length). Never ==.SecureEnclave.MLDSA65.NSPinnedDomains. Rotation / SPKI / backup pins? delegate + SecTrustEvaluateWithError.global-skills/apple-auth/swift-auth-security-checklist/SKILL.md — where these primitives slot into
the full storage/transport/lifecycle defense-in-depth checklist.global-skills/apple-auth/swift-auth-security-audit-suite/SKILL.md — the tests that assert the
state comparison is constant-time and ATS has no arbitrary loads.global-skills/apple/apple-anti-patterns/SKILL.md — registers "compare secrets with ==" and
"invent a timingSafeEqual" as anti-patterns this skill avoids.Last verified: 2026-06-03 against CryptoKit + Security (Apple Developer docs, live) — HPKE XWing
ciphersuite, MLKEM768/MLDSA65, and HMAC.isValidAuthenticationCode signatures confirmed iOS 26.0/13.0+.
CryptoKit.timingSafeEqual was checked and does NOT exist — use HMAC.isValidAuthenticationCode
or equal-length XOR-accumulate. XWingMLKEM768X25519.PrivateKey() / .generate() are not documented
at a stable URL; the ciphersuite constant and MLKEM768.PrivateKey.generate() are the verified anchors.
Re-check after: WWDC26 + any CryptoKit/Security release, or by 2026-12-01. Decay risk: medium.
Found a drift? Run /skill-pattern-freshness-audit apple-auth.
Source: esaldgut/ai-native-engineering-workspace — distributed by TomeVault.