Generate a 7-digit number where the first and last bit of


We are tasked to build a simple RSA crypto system.

Looking for guidance in creating a program in Python with the various steps that are stated here.

1.) Generate a 7-digit number, where the first and last bit of the number are 1.  Each of the 5 remaining bits needs to be generated randomly; get a (pseudo-)random number, and extract the least significant bit to be your random bit.  Output the print out of each step to screen using trace function.

2.) Now use Miller-Rabin algorithm to test the number generated if it is a PRIME.  If the number passes the Miller-Rabin test with 20 values of A, where A is a number between 0 and N (which can be randomly chosen), mark it as PRIME.  If not, go back to Step 1.

Solution Preview :

Prepared by a verified Expert
Business Management: Generate a 7-digit number where the first and last bit of
Reference No:- TGS01698595

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)