Skip to content

Obfuscated 1.0.0

Choose a tag to compare

@tomisacat tomisacat released this 12 Jun 05:53
· 4 commits to main since this release

Obfuscated 1.0.0

Obfuscated is a compile-time Swift macro that obfuscates string literals at build time and returns ordinary String values at runtime.

Requirements

  • macOS 15+, iOS 14+, tvOS 14+, watchOS 7+, macCatalyst 14+
  • Swift 6.2+
  • Xcode 16+ (macro plugin support)

Installation

Add Obfuscated via Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/tomisacat/Obfuscated.git", from: "1.0.0"),
],
targets: [
    .target(
        name: "<YourAppTarget>",
        dependencies: ["Obfuscated"]
    ),
]

For an Xcode app target, use File → Add Package Dependencies and enter https://github.com/tomisacat/Obfuscated.git.

Highlights

#Obfuscated macro

Use #Obfuscated("secret", methods: [...]) to embed obfuscated bytes and crypto material in your binary. The macro expands to a hidden decode call; callers receive a normal String with no wrapper type or manual decryption.

Obfuscation pipeline

Chain lightweight transforms (XOR, bit shift, bit OR, Base64) with CryptoKit-backed methods (AES-GCM, ChaCha20-Poly1305, HMAC keystream, HKDF + AEAD, Curve25519/P-256 ECIES). Pass nil for crypto key material to generate random values at compile time, or supply explicit ObfuscatedKey, ObfuscatedNonce, ObfuscatedSalt, and ObfuscatedInfo for reproducible output.

Static string interpolation

String literals with static \("...") segments are folded at compile time and obfuscated as one value. Runtime variables inside \(...) are not supported.

Documentation

Testing

Unit tests cover encode/decode round-trips, crypto edge cases, macro parsing, and expansion. CI runs swift test and demo app builds on every push and pull request to main.

License

MIT License — see LICENSE.


Tag: v1.0.0