NSString from NSData #37

pepibumur opened this Issue Jul 7, 2013 · 3 comments


None yet

3 participants


I'm having troubles to retrieve NSString from a previous generated NSData from RNCryptor.
In my app I generate an NSData from NSString using RNCryptor. This NSData is stored in Keychain ( previously converted to base 64 NSString ).
When I need this information, I retrieve this NSString from keychaing and convert to NSData ( using reverse base 64 ).

Once I have this NSDate I apply RNDecryptor in order to have the original NSString.
The problem I have is that RNDecryptor returns an NSData that I try to convert into NSString using NSUTF8StringEncoding but it returns an error.

 NSData *data=[RNDecryptor decryptData:datafrombase64 withPassword:pass error:&error];
        return NO;
    NSString *srcString=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

Does someone know the way to retrieve NSString?

abc2mit commented Sep 2, 2014

This seems like a problem with using the RNCryptor library and isn't related to any issues with SSKeychain.

abc2mit commented Sep 2, 2014

But if you want to know the answer to this, you can take a look at my post here:

or see the other posts for alternate answers.

soffes commented Jun 19, 2015

Thanks @abc2mit!

@soffes soffes closed this Jun 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment