Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative For Swift #15

Open
Kofil opened this issue Jul 21, 2016 · 1 comment
Open

Alternative For Swift #15

Kofil opened this issue Jul 21, 2016 · 1 comment

Comments

@Kofil
Copy link

Kofil commented Jul 21, 2016

Is their any alternative solution for Swift?

@kiishhan
Copy link

Is their any alternative solution for Swift?

Use this pod: -
https://github.com/krzyzanowskim/CryptoSwift/tree/swift32

extension String {
func aes_Encrypt() -> String {
let key = "0123456789abcdef"
let iv = "fedcba9876543210"
var result = ""
do {
let aes = try! AES(key: key, iv: iv, padding: Padding.zeroPadding)
let encrypted = try aes.encrypt(Array(self.utf8))
result = encrypted.toHexString()
} catch {
print(error)
}
return result
}
}

// Use:-

let str = // YOUR STRING

let result = str.aes_Encrypt() // "result" is your encrypted string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants