Simple insecure two-way data “obfuscation”?

后端 未结 17 1383
别跟我提以往
别跟我提以往 2020-11-22 01:10

I\'m looking for very simple obfuscation (like encrypt and decrypt but not necessarily secure) functionality for some data. It\'s not mission critical. I need something to k

17条回答
  •  你的背包
    2020-11-22 01:48

    I think this is the worlds simplest one !

    string encrypted = "Text".Aggregate("", (c, a) => c + (char) (a + 2));
    

    Test

     Console.WriteLine(("Hello").Aggregate("", (c, a) => c + (char) (a + 1)));
                //Output is Ifmmp
     Console.WriteLine(("Ifmmp").Aggregate("", (c, a) => c + (char)(a - 1)));
                //Output is Hello
    

提交回复
热议问题