如何解码base64编码的string?

我试图“解码”下面的Base64string:

OBFZDTcPCxlCKhdXCQ0kMQhKPh9uIgYIAQxALBtZAwUeOzcdcUEeW0dMO1kbPElWCV1ISFFKZ0kdWFlLAURPZhEFQVseXVtPOUUICVhMAzcfZ14AVEdIVVgfAUIBWVpOUlAeaUVMXFlKIy9rGUN0VF08Oz1POxFfTCcVFw1LMQNbBQYWAQ ==

这就是我所知道的string本身:

  1. 原始string首先通过以下代码:

    private static string m000493(string p0, string p1) { StringBuilder builder = new StringBuilder(p0); StringBuilder builder2 = new StringBuilder(p1); StringBuilder builder3 = new StringBuilder(p0.Length); int num = 0; Label_0084: while (num < builder.Length) { int num2 = 0; while (num2 < p1.Length) { if ((num == builder.Length) || (num2 == builder2.Length)) { MessageBox.Show("EH?"); goto Label_0084; } char ch = builder[num]; char ch2 = builder2[num2]; ch = (char)(ch ^ ch2); builder3.Append(ch); num2++; num++; } } return m0001cd(builder3.ToString()); } 

    代码中的p1部分应该是string“ _p0lizei. ”。

  2. 然后通过以下代码转换为Base64string:

     private static string m0001cd(string p0) { string str2; try { byte[] buffer = new byte[p0.Length]; str2 = Convert.ToBase64String(Encoding.UTF8.GetBytes(p0)); } catch (Exception exception) { throw new Exception("Error in base64Encode" + exception.Message); } return str2; } 

问题是,如何解码Base64string,以便我可以找出原始string是什么?

简单:

 byte[] data = Convert.FromBase64String(encodedString); string decodedString = Encoding.UTF8.GetString(data); 

m000493方法似乎执行某种异或encryption。 这意味着同样的方法可以用于encryption和解密文本。 所有你需要做的是反向m0001cd

 string p0 = Encoding.UTF8.GetString(Convert.FromBase64String("OBFZDT...")); string result = m000493(p0, "_p0lizei."); // result == "gaia^unplugged^Ta..." 

return m0001cd(builder3.ToString()); 改成return builder3.ToString();