同态和非交换哈希函数?

huangapple go评论72阅读模式
英文:

Homomorphic and non-commutative hash function?

问题

存在非交换同态哈希函数吗(或者已经进行了研究/发布)?
Facebook开发的LtHash并在GitHub上实现此处是我正在寻找的类型的函数,但LtHash是可交换的,我想知道是否存在非交换的哈希算法。

我已经在网上查找了一下,到目前为止还没有找到既是同态的又是非交换的哈希函数(或者更好的实现方法)。

英文:

Does a non commutative homomorphic hash function exist (or been researched/published)?
LtHash developed by Facebook and implemented on Github here is the sort of function I am looking for, but LtHash commutes and I'd like to know if there is a non commutative hashing algorithm.

I have had a look online and so far not found any hashing functions (or even better implementations) that are both homomorphic and non commutative.

答案1

得分: 1

LtHash仅在省略区块索引时可交换,但这也会使其不安全。我猜你省略了它们,因为你想能够像你的图示示例注释中那样连接哈希值。

为了使用LtHash实现这一点,你可以使用第一个区块和相邻区块的成对代替带有索引的区块对。

例如,[a,b,c,d,e] 的LtHash通常是 sum([ h([0,a]), h([1,b]), h([2,c]), h([3,d]), h([4,e]) ])

而现在,你可以使用 sum([ h(a), h([a,b]), h([b,c]), h([c,d]), h([d,e]) ])

现在,如果你知道起始和结束区块,你可以连接哈希值:

Hash([a,b,c,d,e,f]) = Hash([a,b,c]) + Hash([d,e,f]) + h([c,d]) - h(d)

英文:

LtHash only commutes if you leave out the block indexes, but that makes it also insecure. I guess you left them out, because you want to be able to concatenate hashes as in your graph example comment.

In order to do that with LtHash, you can use the first block and pairs of adjacent blocks instead of pairs of blocks with indexes.

For example, the LtHash of [a,b,c,d,e] would normally be sum([ h([0,a]), h([1,b]), h([2,c]), h([3,d]), h([4,e]) ])

Instead, you can use sum([ h(a), h([a,b]), h([b,c]), h([c,d]), h([d,e]) ]).

Now you can concatenate hashes if you know the starting and ending blocks:

Hash([a,b,c,d,e,f]) = Hash([a,b,c]) + Hash([d,e,f]) + h([c,d]) - h(d)

huangapple
  • 本文由 发表于 2023年6月21日 23:52:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76525107.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定