swift -> AES encryption and decryption

 

Modules  using  https://github.com/adow/SecrecySwift

 

First download it and put it in the root directory of the XCODE project, which is in the same folder as the XXX.xcodeproj file of the original project

 

Then drag secret's SecrecySwift.xcodeproj to the project root in XCODE tools 



 

Afterwards 

 

Under your project, select  Targets ,  General add  Embedded Binariesin, select  Secrecy.framework, make sure  Build Phases there is  Link Binary with Libraries in  Secrecy.framework;

 

and then where you want to use 

import Secrecy

 

If it prompts what SWIFT 3.0, 2.3 version is wrong, please refer to the following solution



 

 

Decryption of AES 

print("re:"+"im encode result".aesEBCDecryptFromBase64(key)!);

 

Can solve  AES encryption  in php and java general AES encryption and decryption algorithm

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326481797&siteId=291194637