Skip to content

Instantly share code, notes, and snippets.

@chriswill0w
chriswill0w / Obfuscator.swift
Last active February 17, 2021 07:49 — forked from DejanEnspyra/Obfuscator.swift
Obfuscation of hard-coded security-sensitive strings.
protocol ObfuscatorProtocol {
#if DEBUG
func bytesByObfuscatingString(_ string: String) -> [UInt8]
#endif
func reveal(_ key: [UInt8]) -> String
}
class Obfuscator: ObfuscatorProtocol {
// MARK: - Variables
import simd
extension float4x4 {
init(scaleBy s: Float) {
self.init(SIMD4<Float>(s, 0, 0, 0),
SIMD4<Float>(0, s, 0, 0),
SIMD4<Float>(0, 0, s, 0),
SIMD4<Float>(0, 0, 0, 1))
}