如何从顺序异或过程的最终结果输出中找到原始值?

发布于 2024-09-16 09:06:24 字数 486 浏览 3 评论 0原文

问题是我想获取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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心头的小情儿 2024-09-23 09:06:24

如果我正确理解你的问题,这是不可能的。有多种方法可以将 result 拆分回 strAstrBstrC

为了更容易理解原因,请考虑加法。假设您从 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 into strA, strB and strC.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文