Source-available post-quantum messenger – crypto core on GitHub

Free

About

Source-available post-quantum messenger – crypto core on GitHub

Details

PhantomChatCrypto is the cryptographic core of the Phantom Chat messenger (by Veilus Digital), extracted verbatim from the iOS app and made source-available for public review. It implements post-quantum key encapsulation (ML-KEM-768 / FIPS 203), hash functions (SHA3-256/512, SHAKE128/256 / FIPS 202), a hybrid key exchange combining classical X3DH with Kyber (PQXDH), and the Signal Double Ratchet for forward secrecy. All code is written in pure Swift and includes a comprehensive test suite with known-answer tests, correctness checks, and interoperability tests against Apple's CryptoKit (macOS 26+). The authors explicitly state the implementation has not yet undergone a paid third-party audit and invite scrutiny. The repository is provided under a source-available license that permits review and compilation but prohibits reuse in other products.

Key Features

  • ML-KEM-768 (FIPS 203) post-quantum key encapsulation in pure Swift
  • Keccak-f[1600] with SHA3-256/512 and SHAKE128/256 (FIPS 202)
  • Hybrid PQXDH combiner: X3DH + Kyber secret to root key
  • Signal Double Ratchet for per-message keys and forward secrecy
  • Byte-for-byte identical to code used in the Phantom Chat iOS app
  • FIPS 203 interop tests with Apple's CryptoKit (macOS 26+)
  • Known-answer tests for NIST references, NTT correctness, Barrett reduction, and ML-KEM round-trips

Use Cases

  • Verifying post-quantum security claims of the Phantom Chat messenger
  • Security research and auditing of modern cryptographic implementations
  • Learning or teaching post-quantum cryptography and Signal protocol
  • Reference implementation for ML-KEM-768 and Double Ratchet in Swift

Pros & Cons

Pros

  • Source-available for public review and verification
  • Implements standard, published algorithms (FIPS 202, FIPS 203, Signal Double Ratchet/X3DH)
  • Clean-room implementation, not a fork of libsignal or liboqs
  • Comprehensive test suite with NIST known-answer tests and interop tests
  • Honest about the lack of a paid third-party audit, encouraging community scrutiny
  • Free and open to compile and run for reviewers

Cons

  • Has not undergone a paid third-party security audit
  • Interop tests require macOS 26 or later (older OS versions skip them)
  • License restricts reuse in other products (source-available, not fully open source)
  • Only the cryptographic core is open; the app backend and full app remain closed-source

Frequently Asked Questions

What algorithms are implemented?

ML-KEM-768 (FIPS 203), Keccak-f[1600] with SHA3-256/512 and SHAKE128/256 (FIPS 202), a hybrid PQXDH combiner (X3DH + Kyber), and the Signal Double Ratchet.

How can I verify the implementation?

Run `swift test` to execute the test suite, which includes known-answer tests, NTT correctness, reduction checks, and round-trip tests. The interop tests against Apple CryptoKit require macOS 26+.

Has this been audited?

No paid third-party audit has been performed yet. The authors have stated it's on the roadmap and are publishing the code precisely to invite review.

Can I reuse this code in my own product?

No. The license permits reading, building, and running the code for verification but prohibits reuse in another product.

How does this relate to the Phantom Chat app?

This repository contains the cryptographic core extracted verbatim from the iOS app (only import lines differ). The rest of the app and backend remain closed-source.

Reviews