加密算法和按位奇偶校验

Encryption Algorithm and bitwise parity

我目前正在学习加密算法和解决问题。我在这里有点迷路了。我想知道是否有人可以给我一些指导。到目前为止,我知道初始奇偶校验定义是偶校验,但我不确定如何进行后续步骤。感谢您的指导。

》一个简单的哈希方法将给定的数据分成整数个字节,如果需要,用1填充到低位,使数据成为字节的整数倍,然后计算中的位的按位奇偶校验字节长的哈希码。

此方案为以下十六进制数据计算的哈希码是多少: 0x000100010

列出另一个具有相同哈希码的相同长度的数据项。这是一个好的哈希方案吗?解释你的答案。

奇偶定义:10101011 1,奇数个1给出奇偶值1。"

Parity is pretty simple: it just means to count the number of 1 bits in the value to see if it's an even or odd number. In this case it looks like you're using even parity, which means that an odd number of 1s produces a parity value of 1 (so that the total number of 1 bits, including the parity, becomes even), and an even number of 1s produces a parity value of 0. Even parity is equivalent to just XOR将所有位组合在一起。

你的 "bitwise parity" 方案听起来你应该取值 0x000100010(4.5 字节)并将其扩展为 0x000100010F(5 字节,低 4 位全为 1),然后将其拆分为8 位值 0x00、0x01、0x00、0x01 和 0x0F,然后对所有这些进行按位异或。