Swiftpack.co - backslash-f/aescryptable as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by backslash-f.
backslash-f/aescryptable v2.0.0
AES encryption/decryption with random iv 🔒
⭐️ 30
🕓 1 week ago
.package(url: "https://github.com/backslash-f/aescryptable.git", from: "v2.0.0")

swift-version swift-package-manager platform ci-status license

AESCryptable 🔒

Provides Advanced Encryption Standard (AES) capabilities.

Integration

Xcode 11+

AESCryptable Xcode 11 SPM

(More on the topic from WWDC 2019: Adopting Swift Packages in Xcode and Creating Swift Packages.)

Via Package.swift

In your Package.swift, add AESCryptable as a dependency:

dependencies: [
  // 🔐 AES encryption/decryption with random iv. Swift 5 and up.
  .package(url: "https://github.com/backslash-f/aescryptable", from: "1.0.0")
],

Associate the dependency with your target:

targets: [
  .target(name: "App", dependencies: ["AESCryptable"])
]

Run: swift build

Usage

import AESCryptable

do {
  // encrypt
  let aes = try AES(keyString: "01234567890123456789012345678901")
  let encryptedData = try aes.encrypt("The black knight always triumphs!")

  // decrypt
  let decryptedString = try aes.decrypt(encryptedData)
  print(decryptedString) // The black knight always triumphs!

} catch {
  print(error)
}

(Refer to the test class for a high-level overview.)

Demo

Clone the repo and use AESCryptable.playground to see the code in action:

AESCryptable Demo

GitHub

link
Stars: 30
Last commit: 1 week ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Swift 5.1 + Xcode 11
4 years ago

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