pieguy
Joined 13 years ago
Karma
163
Submissions
28
Member since
Feb 28
Joined 13 years ago
> he assumes what the judge said is true
The judge says he will be hanged. Your comments are inconsistent.
(c(mod p)) (mod 2) = (p * q + 2 * r + m (mod p)) (mod 2) = 2r + m (mod 2) = m
This breaks if 2*r > p. Even if you choose r to be small during encryption, the r values accumulate with each homomorphic operation and will eventually be too big. The only restriction stated is that r is "from a different interval than the private key one". This should be made more clear. (STDIN)= 5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8
Which is obviously not what you want. So I changed it to: echo -n "$password" | openssl sha1 -binary | xxd -p -uAlso, your double hashing scheme has a bug. You identified that it's problematic if hash_b returns 0, but adding 1 to the result doesn't actually solve anything, because now you have the same problem if hash_b returns num_buckets-1.