Latest 1.0.0
Homepage https://github.com/RedMadRobot/golden-key
License MIT
Platforms ios 10.0, tvos 10.0, osx 10.10, watchos 4.0
Authors ,

Swift wrapper around CommonCrypto and Security frameworks

Common Digest

Supported algorithms: MD2, MD4, MD5, SHA1, SHA224, SHA256, SHA384, SHA512.

Stream hasher.

let sha = SHA256()
sha.combine(Data("12".utf8))
sha.combine(Data("3".utf8))

let hash = sha.finalize()

One shot.

let hash2 = SHA256.hash(Data("123".utf8))

HMAC

hash-based message authentication code

Stream hasher.

let key = Data("secret_key".utf8)
let hmac = HMAC(algorithm: .md5, key: key)

hmac.combine(Data("ab".utf8))
hmac.combine(Data("cd".utf8))
let hash = hmac.finalize()

One shot.

let key = Data("secret_key".utf8)
let data = Data("abcd".utf8)

let hash = HMAC.hash(algorithm: .sha224, data: data, key: key)

Setup for development

$ mkdir gyb
$ cd gyb
$ wget https://github.com/apple/swift/raw/master/utils/gyb
$ wget https://github.com/apple/swift/raw/master/utils/gyb.py
$ chmod +x gyb

Latest podspec

{
    "name": "GoldenKey",
    "version": "1.0.0",
    "summary": "CommonCrypto and Security wrapper for iOS",
    "description": "Swift wrapper around CommonCrypto and Security frameworks.",
    "homepage": "https://github.com/RedMadRobot/golden-key",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Alexander Ignatiev": "[email protected]",
        "Anton Glezman": "[email protected]"
    },
    "source": {
        "git": "https://github.com/RedMadRobot/golden-key.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "10.0",
        "tvos": "10.0",
        "osx": "10.10",
        "watchos": "4.0"
    },
    "swift_version": "5.0",
    "source_files": "GoldenKey/**/*.swift"
}

Pin It on Pinterest

Share This