An obfuscation library for protecting your literal strings.
import Obfuscation
let salt = String(describing: Int.self)
let obfuscator = Obfuscator(salt: salt)
let string = "your literal string"
// or avoid using literal string
let string = "".y.o.u.r.space.l.i.t.e.r.a.l.space.s.t.r.i.n.g
let bytes = obfuscator.bytes(of: string)
let runtimeString = obfuscator.string(of: bytes)
To use the Obfuscation
library in a SwiftPM project, add the following line to the dependencies in your Package.swift file:
.package(url: "https://github.com/L1MeN9Yu/Obfuscation.git", from: "1.4.0")
Finally, include "Obfuscation" as a dependency for your executable target:
let package = Package(
// name, platforms, products, etc.
dependencies: [
.package(url: "https://github.com/L1MeN9Yu/Obfuscation.git", from: "1.0.0"),
// other dependencies
],
targets: [
.target(name: "<target>", dependencies: [
.product(name: "Obfuscation", package: "Obfuscation"),
]),
// other targets
]
)