C1= 5
C2= 6
C3= 10
GCD --> Greater Common Divisor
B1 a. Let x := 3C1 + 1 and let y := 5C2 + 1. Use the Euclidean algorithm to determine the GCD (x, y), and we denote this integer by g. b. Reverse the steps in this algorithm to find integers a and b with ax+by = 8. c. Use this to find the inverse of x modulo y. If the inverse doesn't exist why not?
Write code for RSA encryption package rsa; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class RSA { private BigInteger phi; private BigInteger e; private BigInteger d; private BigInteger num; public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.println("Enter the message you would like to encode, using any ASCII characters: "); String input = keyboard.nextLine(); int[] ASCIIvalues = new int[input.length()]; for (int i = 0; i < input.length(); i++) { ASCIIvalues[i] = input.charAt(i); } String ASCIInumbers...
You may import the following library functions in your module: from fractions import gcd from math import floor from random import randint You may also use: • the built-in pow() function to compute modular exponents efficiently (i.e., ak mod n can be written in Python as pow(a,k,n)), • the sum() function returns the sum of a list of integers (sum(1,2,3,4) returns 10). problem 1 a. Implement a function invPrime(a, p) that takes two integers a and p > 1 where...
We know that we can reduce the base of an exponent modulo m: a(a mod m)k (mod m). But the same is not true of the exponent itself! That is, we cannot write aa mod m (mod m). This is easily seen to be false in general. Consider, for instance, that 210 mod 3 1 but 210 mod 3 mod 3 21 mod 3-2. The correct law for the exponent is more subtle. We will prove it in steps (a)...
I have to use the following theorems to determine whether or not it is possible for the given orders to be simple. Theorem 1: |G|=1 or prime, then it is simple. Theorem 2: If |G| = (2 times an odd integer), the G is not simple. Theorem 3: n is an element of positive integers, n is not prime, p is prime, and p|n. If 1 is the only divisor of n that is congruent to 1 (mod p) then...