View Full Version : Encryption and Decryption of NSString
ruhi
Dec 30, 2009, 12:32 AM
Hello,
I am looking for some help in encrypting and NSString object and decrypting back to original NSString by using some simple algorithm like XOR Encryption.
Please provide me with some help.
Thanks,
Ruhi
Detrius
Dec 30, 2009, 09:52 AM
First, you have to actually get accessible binary data.
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/UTF8String
In C, binary xor is done with "^"
http://www.fredosaurus.com/notes-cpp/expressions/bitops.html
When you're done, you go back to an NSString:
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/clm/NSString/stringWithUTF8String:
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.