/CryptoKit

Pure Swift implementations of cryptographic functions

Primary LanguageSwiftMIT LicenseMIT

CryptoKit 🔑

Build Status Swift Version Carthage compatible spm compatible CocoaPods compatible Platform

A Swift framework containing implementations of cryptographic functions.

Features

Hashing Algorithms

  • MD5
  • SHA-1
  • SHA-224
  • SHA-256
  • SHA-384
  • SHA-512

HMAC (Hash-based Message Authentication Code)

  • HMAC (using any of the implemented hash functions)

Usage

Try CryptoKit API right now in IBM Swift Sandbox.

Hash / Digest

let message = "The quick brown fox jumps over the lazy dog".data(using: .utf8)!

let hash = message.digest(using: .sha256) // Supports MD5, SHA-1 and SHA-2 variants

HMAC

let hmac = HMAC(key: secret, message: message, hashFunction: .sha1)

License

Copyright (c) 2016 Joe Christopher Paul Amanse

This software is distributed under the MIT License.