Last active
January 6, 2020 15:45
-
-
Save SunXiaoShan/3b4255a51debb6e138d2041ab19560ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
inputkey.text = "keykeykeykeykeyk" | |
inputIv.text = "drowssapdrowssap" | |
orgiTextView.text = "helloworld" | |
if | |
// 先做 AES-128 encode | |
let aes = try? AES(key: inputkey.text!, iv: inputIv.text!) , | |
let encrypted = try? aes.encrypt(orgiTextView.text!.bytes) , | |
// 再把結果用 base64 成文字顯示出來 | |
let EncData = encrypted.toBase64() | |
{ | |
crypTextView.text = EncData | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment