Swiftpack.co - nicholasspencer/obvue as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nicholasspencer.
nicholasspencer/obvue 0.0.0
CLI for generating obfuscated keys
⭐️ 0
🕓 4 years ago
.package(url: "https://github.com/nicholasspencer/obvue.git", from: "0.0.0")

obvue

CLI for generating obfuscated keys based on http://www.splinter.com.au/2019/05/05/obfuscating-keys/

Installation

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"]),
    ]
)

Usage

Generate obfuscated data

> swift run obvue "xyz"
[77, 45, 171, 53, 84, 209]

Deobfuscate

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)
    }()
}

GitHub

link
Stars: 0
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics