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
// pod 'AesGcm' | |
#import <AesGcm/IAGAesGcm.h> | |
// replace with your own key, base64 encoding | |
static NSString * const AES_GCM_KEY = @"MTIzNDU2Nzg5MGFiY2RlZg=="; | |
- (NSString *)encryptString:(NSString *)text { | |
NSData *key = [[NSData alloc] initWithBase64EncodedString:AES_GCM_KEY options:NSDataBase64DecodingIgnoreUnknownCharacters]; | |
NSData *iv = [self randomKeyDataGeneratorWithNumberBits:96]; |