Sunday, 11 August 2013

Scramble an NSString reversibly without being able to store the original string

Scramble an NSString reversibly without being able to store the original
string

Is there a quick and dirty way to scramble an NSString and then unscramble
it?
// i.e.
NSString *helloWorld = @"Hello World!";
[helloWorld scrambled]; //helloWorld now = @"W olell!odh"
[helloWorld unscramble]; //helloWorld now = @"Hello World!"
I've already accomplished something similar to this with Base64
encryption, but it adds significant bloat to my string. I don't care about
the security level of the scrambling in the slightest, it just needs to be
re-ordered so that it isn't human-readable.

No comments:

Post a Comment