public static string UnlockText(string s) { int i = s.IndexOf(">> "); string key = s.Substring(2, i - 2); return(Obfuscation.Lock(s.Substring(i + 3), key, false)); }
public static string UnshiftText(string s) { string hex = s.Substring(0, 2); int i = int.Parse(hex, System.Globalization.NumberStyles.HexNumber); s = s.Substring(2); return(Obfuscation.Shift(s, -i)); }
public static string ShiftText(string s) { Random r = new Random(CryptoRandomNumber.Next()); int rndmin = r.Next(7, 44); int rndmax = r.Next(66, 127); int rnd = r.Next(rndmin, rndmax); string hex = rnd.ToString("X2"); return(hex + Obfuscation.Shift(s, rnd)); }
public static string LockText(string s) { string key = CreateKey(); return("<<" + key + ">> " + Obfuscation.Lock(s, key, true)); }