CLI for generating obfuscated keys based on http://www.splinter.com.au/2019/05/05/obfuscating-keys/
Add obvue to your package description
let package = Package(
name: "AppDependencies",
products: [
.library(name: "Dependencies", targets: ["Dependencies"]),
],
dependencies: [
.package(url: "https://github.com/nicholasspencer/obvue.git", from: "0.0.0"),
],
targets: [
.target(name: "Dependencies", dependencies: ["ObvueCore"]),
]
)
> swift run obvue "xyz"
[77, 45, 171, 53, 84, 209]
import Foundation
import ObvueCore
class Application: NSApplication {
let secret: [UInt8] = [77, 45, 171, 53, 84, 209]
lazy var authenticator: Authenticator? = {
guard let secret: String = Obfuscator.deobfuscate(obfuscated: secret) else {
return nil
}
return Authenticator(secret: secret)
}()
}