IOS AES encrypted third-party libraries

Source: Internet
Author: User

Data encryption plays an important role in the software development process, and some companies may have their own internal design algorithms when encrypting, and in this regard do not want to waste too much effort to consider using third-party provided encryption algorithm, such as AES encryption algorithm, This article describes the open source Chinese iOS client using the ASE algorithm encryption password;


AES GitHub Https://github.com/Gurpartap/AESCrypt-ObjC


For a larger project we may not know where a class library or method is used, but the smart Xcode provides us with a global search function that we can search for in the whole project. For example, I don't know where AES is used, but if you use this class library It will definitely refer to its header file, we search for Aescrypt


Then, in addition to the class library itself, only the Config class contains AESCrpt.h, only two methods are used.

The use of AES is very simple, first to add a header file #import "AESCrypt.h", using the example

-(void) test{

   NSString *pwdKey = @ "新风作浪"    NSString *password = @ "duxinfeng123456"    NSString *encryptedPWD = [AESCrypt encrypt:password password:pwdKey];     NSString *decryptedPWD = [AESCrypt decrypt:encryptedPWD password:pwdKey];     NSLog(@ "加密后密码:%@  解密后密码: %@" ,encryptedPWD,decryptedPWD);}

Print Result: infeng123456

Cryptographic decryption method function prototype, the two parameters passed the first is the encrypted data, the second is the key to encrypt the data, the decryption time also need this key to decrypt the encrypted data

1. + (NSString *)encrypt:(NSString *)message password:(NSString *)password;  2. + (NSString *)decrypt:(NSString *)base64EncodedString password:(NSString *)password;

 

IOS AES encrypted third-party libraries

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.