Javascript/Unityscript or c# String obfuscator ...

I guess this is not 100.0% Unity related …

I just need a U/S (javascript is close enough) or c#

routine that will take a long String and un / obfuscate it.

(TBC I do not mean source code … just a simple long String, likely the contents of a simple text file.)

So,

  var xx:String = someTextAsset.text;
  var clear:String = _handyRoutine( xx );

So, it could encrypt it in a simple way or otherwise mash it up, and then unmash it.

I am not a regular javasript/c# programmer so i don’t know all the secret stashes you guys know.

(Something may already exist in .NET for all I know.)

Does anyone have a reliable one on hand ? Thanks a million!!!

You can just save class provided by Mark Brittingham in your unity scripts, and use it for encrypting / decrypting your strings, but its only C# solution. Im not sure if you can use it in javascript, but propably you could, since C# is compiled before javascripts (i think so). Its worth try though

If you want to obfuscate strings so no one can read them, I think best way would be to convert them to arrays of ints that contains Unicode values for each character and then do function that would take such array and decode it into string. You could also use some simple encryption on it like xoring or rot13.