ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 11 May 2013 08:32:27 -0500The sage example in Crypto (Stallings)https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/When I doing the exercise of the textbook in Append -C
I confront a question, it says
" Write a function that takes a bitlength n and generates a modulus N of bitlength n and g less than N and relatively prime to it. "
I am confused about the meaning
does is mean that I have to use the bitlength n and generate the modulus N?
( len(bin(n)) % N)? Fri, 10 May 2013 06:24:40 -0500https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/Comment by vdelecroix for <p>When I doing the exercise of the textbook in Append -C
I confront a question, it says
" Write a function that takes a bitlength n and generates a modulus N of bitlength n and g less than N and relatively prime to it. "</p>
<p>I am confused about the meaning</p>
<p>does is mean that I have to use the bitlength n and generate the modulus N?
( len(bin(n)) % N)? </p>
https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/?comment=17718#post-id-17718Could you give the precise reference of the exercise in appendix C ?Sat, 11 May 2013 08:18:47 -0500https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/?comment=17718#post-id-17718Comment by vdelecroix for <p>When I doing the exercise of the textbook in Append -C
I confront a question, it says
" Write a function that takes a bitlength n and generates a modulus N of bitlength n and g less than N and relatively prime to it. "</p>
<p>I am confused about the meaning</p>
<p>does is mean that I have to use the bitlength n and generate the modulus N?
( len(bin(n)) % N)? </p>
https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/?comment=17717#post-id-17717I got it... exercise 11.1 in the 5th edition.Sat, 11 May 2013 08:22:29 -0500https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/?comment=17717#post-id-17717Answer by vdelecroix for <p>When I doing the exercise of the textbook in Append -C
I confront a question, it says
" Write a function that takes a bitlength n and generates a modulus N of bitlength n and g less than N and relatively prime to it. "</p>
<p>I am confused about the meaning</p>
<p>does is mean that I have to use the bitlength n and generate the modulus N?
( len(bin(n)) % N)? </p>
https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/?answer=14910#post-id-14910You need to output a couple (N,g) where N is an integer whose bitlength is n (in other words it has n digits in base 2) and g is an integer relatively prime to N. I guess that your N should be a product of two primes p and q as in the description above. You may use the function random_prime of Sage for that purpose.
I confess that I do not understand this first question as it is not used in the next items...Sat, 11 May 2013 08:32:27 -0500https://ask.sagemath.org/question/10110/the-sage-example-in-crypto-stallings/?answer=14910#post-id-14910