Encrypt AES/CBC/PKCS7Padding
问题 Help me to make encryption AES/CBC/PKCS7Padding ? Below is my code to decrypt AES/CBC/PKCS7 . It's working but when I encrypt some string and decrypt from my self it's error. Below i adding code to encrypt and decrypt AES/CBC/PKCS7Padding. - (NSData *)AES256Encrypt:(id)key { NSString *iv = @"FEDCBA9876543210"; NSData *keyPtr = [key copy]; size_t dataLength = [self length]; NSData *ivPtr = [iv dataUsingEncoding:NSUTF8StringEncoding]; //NSData *encrypted = [self subdataWithRange:NSMakeRange(0,