Determine if key is incorrect with CCCrypt kCCOptionPKCS7Padding-Objective C
问题 I am working on incorporating encryption for data stored in my application. I have gotten pretty far in that I am encrypting and decrypting data, my problem is that I cannot seem to force an obvious decryption error when the wrong key is used. My decrypt function: + (NSData *)decryptedDataForData:(NSData *)data password:(NSString *)password iv:(NSData *)iv salt:(NSData *)salt error:(NSError **)error { NSAssert(iv, @"IV must not be NULL"); NSAssert(salt, @"salt must not be NULL"); NSData *key