We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
背包加密中Archaic题目中的makeKey函数,原题中是
def makeKey(n): privKey = [random.randint(1, 4**n)] s = privKey[0] for i in range(1, n): privKey.append(random.randint(s + 1, 4**(n + i))) s += privKey[i] q = random.randint(privKey[n-1] + 1, 2*privKey[n-1]) r = random.randint(1, q) while gmpy2.gcd(r, q) != 1: r = random.randint(1, q) pubKey = [ r*w % q for w in privKey ] return privKey, q, r, pubKey
其中q应该是q = random.randint(s+ 1, 2*s)吧,能解出来是因为正好最后一位是0?
The text was updated successfully, but these errors were encountered:
好像是这么回事,我有时间仔细看一下如何修改一下,目前时间不太充足。当然欢迎直接提供 PR。
Sorry, something went wrong.
No branches or pull requests
背包加密中Archaic题目中的makeKey函数,原题中是
其中q应该是q = random.randint(s+ 1, 2*s)吧,能解出来是因为正好最后一位是0?
The text was updated successfully, but these errors were encountered: