如何从顺序异或过程的最终结果输出中找到原始值?
问题是我想获取B的原始值,或者C或A的原始值。代码如下:
Dim strA As String = "A"
Dim strB As String = "B"
Dim strC As String = "C"
Dim result As Byte = 0
' Fetch the byte character code of strings and Xor them all into the result in a sequence.
result = result Xor AscW(strA)
result = result Xor AscW(strB)
result = result Xor AscW(strC)
' the final result value is 64
如何做到这一点?请帮助我找到解决此问题的正确方法。如果可以有另一个参数,当应用公式时可以显示原始值:“A”,“B”,“C”。谢谢。
The problem is that I want to get the original values of B, or the original value of C or A. Here is the code:
Dim strA As String = "A"
Dim strB As String = "B"
Dim strC As String = "C"
Dim result As Byte = 0
' Fetch the byte character code of strings and Xor them all into the result in a sequence.
result = result Xor AscW(strA)
result = result Xor AscW(strB)
result = result Xor AscW(strC)
' the final result value is 64
How to do this? Please help me with the correct solution to this problem. If there can be another parameter which when applied with a formula may reveal the original values: "A", "B", "C". Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确理解你的问题,这是不可能的。有多种方法可以将
result
拆分回strA
、strB
和strC
。为了更容易理解原因,请考虑加法。假设您从 A = 5、B = 6 和 C = 7 开始。总和为 18。现在假设您从 A = 1、B = 1 和 C = 16 开始。总和仍然是 18。底线:如果您全部是“18”,无法将其拆分回来,因为多个输入给出相同的输出。
If I understand your question correctly, this is simply not possible. There are multiple ways to split
result
back intostrA
,strB
andstrC
.To make it easier to see why, consider addition instead. Suppose you start with A = 5, B = 6 and C = 7. The sum is 18. Now suppose you start with A = 1, B = 1 and C = 16. The sum is still 18. Bottom line: if all you have is "18" there's no way to split it back, because multiple inputs give the same output.