This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let key = "1234567890123456" // key | |
let iv = "1234567890123456" // random | |
let message = textView.text | |
let aes = try! AES(key: key, iv: iv) | |
// encrypt | |
let encrypt = try! aes.encrypt(message.dataUsingEncoding(NSUTF8StringEncoding)!.arrayOfBytes(), padding: PKCS7()) | |
print(encrypt) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Playground - noun: a place where people can play | |
import UIKit | |
import XCPlayground | |
class Shape: UIView { | |
var color: UIColor | |
init(color: UIColor) { |