Latest 0.1.3
Homepage https://github.com/superk589/RijndaelSwift
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0
Frameworks Foundation
Authors

This is an implementation of Rijndael algorithm.

Supports 128/192/256 bit key/block, and ECB, CBC modes.

Requirements

  • Xcode 9.0+
  • Swift 4.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate RijndaelSwift into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '8.0'
use_frameworks!
target 'YourApp' do
    pod 'RijndaelSwift'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate RijndaelSwift into your Xcode project using Carthage, specify it in your Cartfile:

github "superk589/RijndaelSwift"

Run carthage update to build the framework and drag the built RijndaelSwift.framework into your Xcode project.

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate RijndaelSwift into your project manually.

Usage

Encrypt

let key = yourKey
let iv = yourIV
let r = Rijndael(key: key, mode: .cbc)!
let plainData = yourPlainData
let cipherData = r.encrypt(data: plainData, blockSize: 32, iv: iv)

Decrypt

let key = yourKey
let iv = yourIV
let r = Rijndael(key: key, mode: .cbc)!
let cipherData = yourCipherData
let plainData = r.decrypt(data: cipherData, blockSize: 32, iv: iv)

Utility for String and Data conversion


// convert hexadecimal string to data
let data = "000000".hexadecimal()!

// convert data to hexadecimal string
let string = data.hexadecimal()

Acknowledgement

rijndael-js by Snack-X

Latest podspec

{
    "name": "RijndaelSwift",
    "version": "0.1.3",
    "summary": "Simple Rijndael implementation in Swift",
    "description": "Simple Rijndael implementation in Swift, support key size in [128, 192, 256], block size in [128, 192, 256].",
    "homepage": "https://github.com/superk589/RijndaelSwift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "superk": "[email protected]"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/superk589/RijndaelSwift.git",
        "tag": "0.1.3"
    },
    "source_files": "Sources/**/*",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This