iphone - NSMutableData convert to NSString -
why data not similar objnsdata
?
nsstring *strdata = @"bonjour tout le monde, je voudrais vous présenter la société fdfdfdf futur"; nsmutabledata *objnsdata = [nsmutabledata datawithdata:[strdata datausingencoding:nsutf8stringencoding]]; objnsdata = [objnsdata encryptaes:@"samplekey"]; nslog(@"objnsdata%@", objnsdata); nsstring *str=[[nsstring alloc] initwithdata: objnsdata encoding:nsutf8stringencoding]; nslog(@"str%@",str); nsmutabledata *data = [[nsmutabledata alloc] initwithdata:[ str datausingencoding:nsutf8stringencoding]]; nslog(@"data%@",data);
you seem storing nsdata
representation of string, encrypting , hoping converting give same thing started out with.
while i'm not entirely sure why you're trying encrypt nsdata
instance, if want convert nsstring
want decrypt on way back.
Comments
Post a Comment