How do I decode a base64 encoded string?
我正在尝试"解码"以下base64字符串:
OBFZDTcPCxlCKhdXCQ0kMQhKPh9uIgYIAQxALBtZAwUeOzcdcUEeW0dMO1kbPElWCV1ISFFKZ0kdWFlLAURPZhEFQVseXVtPOUUICVhMAzcfZ14AVEdIVVgfAUIBWVpOUlAeaUVMXFlKIy9rGUN0VF08Oz1POxFfTCcVFw1LMQNbBQYWAQ==
这就是我对字符串本身的了解:
原始字符串首先通过以下代码传递:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 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()); } |
代码中的
然后通过以下代码将其转换为base64字符串:
问题是,如何对base64字符串进行解码,以便找出原始字符串是什么?
简单的:
1 2 | byte[] data = Convert.FromBase64String(encodedString); string decodedString = Encoding.UTF8.GetString(data); |
1 2 3 4 | string p0 = Encoding.UTF8.GetString(Convert.FromBase64String("OBFZDT...")); string result = m000493(p0,"_p0lizei."); // result =="gaia^unplugged^Ta..." |
用