Open denzerd opened 8 years ago
Solved it by using BBAES as mentioned in Issue #35
But would still be interesting why it's not working?
Best regards
This may be because of latest version of iOS. Which version of iOS are you on ?
Tried with an iOS 8.2 device.
hii naveen
i m also getting the same error in ios 9.0 . it is working proper in android, but with same key and IV it generating different encrypted string in ios , and getting null decrypt string. here is my code
NSString _secret = @"bhavesh"; NSString _key = @"vector"; NSData * encryptedData = [[StringEncryption alloc] encrypt:[_secret dataUsingEncoding:NSUTF8StringEncoding] key:_key iv:@"vector"];
NSLog(@"encrypted data:: %@", [encryptedData base64EncodingWithLineLength:0]); //print the encrypted text
encryptedData = [[StringEncryption alloc] decrypt:encryptedData key:_key iv:@"vector"];
NSString * iv = [[[[StringEncryption alloc] generateRandomIV:11] base64EncodingWithLineLength:0] substringToIndex:16];
NSString * decryptedText = [[NSString alloc] initWithData:encryptedData encoding:NSUTF8StringEncoding];
NSLog(@"decrypted data:: %@", decryptedText); //print the decrypted text
Hi there,
I try to use your library classes to encrypt and decrypt some strings that are shared between apps. I'm using C# to create a Hybrid app with one code base for iOS and Android. So the encryption is done in C#. That's working fine that way:
After that I cut the encrypted text into half and put the iv in. On that way I'm able to read the used iv from other apps that share the value with the encrypting app.
In Android, that's working pretty fine that way:
That's working perfect. I receive my text without problems. I try the same approach in iOS that way:
But result is always null.
I can confirm that the iv is correct, it's definitely the same as used for encryption and the encryptedText after replacing the iv is exactly the same as after encryption and before putting in the iv. So, what am I doing wrong?
Thanks a lot!
Best regards