Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing problem while decryption in iphone5 #56

Open
shwetalodhe opened this issue Jan 11, 2018 · 0 comments
Open

Facing problem while decryption in iphone5 #56

shwetalodhe opened this issue Jan 11, 2018 · 0 comments

Comments

@shwetalodhe
Copy link

Hi,
I am using this code of AES256 encryption in iphone app.This giving expected output in all device higher than iphone5 simualator(version 10.0). While converting the encrypted NSdata to nsstring using NSUTF8StringEncoding its returning nil nsstring.Unable to understand reason.Can anyone help on this.
Also find the code which i am using for conversion

NSString *cipherText =@"1xZKEyLmVzKDoA+2+G2xiA==";
NSString *ivRandom = @"54327CD65463ECAB";
NSString *key = @"B98MN8C9A8765BCA";
NSData *nsdataFromBase64String = [[NSData alloc]
initWithBase64EncodedString:cipherText options:0];

NSData *dataDecrypt = [cryptoLib decrypt:nsdataFromBase64String key:key iv:ivRandom];
NSString *base64Decoded = [[NSString alloc]
                           initWithData:dataDecrypt encoding:NSUTF8StringEncoding];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant