navneet83/Cross-platform-AES-encryption

Decryption result getting null in IOS

arpitjoshi08 opened this issue · 0 comments

i am using this code for encrypt and decryption
NSString * _secret = @"Ashish";           NSString * _key = @"1234";          NSData * encryptedData = [[StringEncryption alloc] encrypt:[_secret dataUsingEncoding:NSUTF8StringEncoding] key:_key iv:@"WLCOU32wBQnUDdw="];           NSLog(@"encrypted data:: %@", [encryptedData  base64EncodingWithLineLength:0]); //print the encrypted text           encryptedData = [[StringEncryption alloc] decrypt:encryptedData  key:_key iv:@"WLCOU32wBQnUDdw="];          NSString * decryptedText = [[NSString alloc] initWithData:encryptedData encoding:NSUTF8StringEncoding];      NSLog(@"decrypted data:: %@", decryptedText); //print the decrypted text
encryption result getting properly but decryption result getting null.How can we resolved that?
i am just checking with hard code data in both android and ios but its working properly in android.