TRENDING NEWS

POPULAR NEWS

Use The Extended Euclidean Algorithm Of Back-substitution To Find The Value Of .

A)Use the Extended Euclidean Algorithm to compute gcd(1302, 1764), and find two integers x and y such that:?

a) 1764 = 1302*1 + 462;
1302 = 462*2 + 378;
462 = 378*1 + 84;
378 = 84*4 + 42;
84 = 42*2 + 0, hence on the previous line 42 = GCD(1764, 1302) .
Now go up:
42 = 378 - 84*4 = 378 - (462 - 378*1)*4 = 378*5 - 462*4 =
= 462*(-4) + (1302 - 462*2)*5 = 1302*5 - 462*14 =
= 1302*5 - (1764 - 1302*1)*14 = 1302*19 + 1764*(-14),
so x = 19, y = -14 gives the required representation.

b) If you know a particular solution (x, y) of the Diophantine equation
1302u + 1764v = 42 (here x = 19 and y = -14)
then if t is arbitrary integer the following expressions:
u = x + 1764t
v = y - 1302t
yield infinitely many solutions - see details here:
http://en.wikipedia.org/wiki/B%C3%A9zout...
For example t = 1 leads to u = 1783, v = -1316.

Use the extended Euclidean method algorithm to solve this..?

i have d= 7^-1(mod 360)

need to use the algorithm to solve it any help would be appreciated

the answer should be d = 103

i struggle with the inverse

Help with Extended Euclidean Algorithm?

I an trying to figure out how to generate keys for a basic RSA cipher as kind of an extra project.

I have everything worked out, up to the point where I generate my second key number, "d".

These are the steps I have to generate the keys:
1.Generate two large random primes, p and q, of approximately equal size such that their product n = pq is of the required bit length, e.g. 1024 bits.
2.Compute n = pq and phi = (p-1)(q-1).
3.Choose an integer e, 1 < e < phi, such that gcd(e, phi) = 1.
4.Compute the secret exponent d, 1 < d < phi, using 1 = e^1 mod phi.
5.The public key is (n, e) and the private key is (n, d). Keep all the values d, p, q and phi secret.
n is known as the modulus.
e is known as the public exponent or encryption exponent or just the exponent.
d is known as the secret exponent or decryption exponent.

I have both of my primes selected (41, 53)
I have my variable "n" (2173)
I have my variable phi (2080)
I also have "e" (433)

My problem is that I cannot figure out how to find the modular inverse of 433 mod 2080.

I have several tutorials I am following, but my answers do not come out anywhere near what theirs do, when I use the same numbers as them.

One tutorial uses the numbers:
primes: 11, 3
n = 33
phi = 20
e = 3
d = 17

When I run the calculations starting with their primes, I get lost at the Inv 3 mod 20.

another tutorial at http://www-math.cudenver.edu/~wcherowi/courses/m5410/exeucalg.htmla
has the steps to find what I'm looking for at the bottom. However, when I try "0-1(1) mod 26", I get some very small decimal, not their 25.

If anyone could point me to a good graphical example of finding the modular inverse of a number, that would be a HUGE help. Maybe the problem is that my online calculators (in the plural) aren't finding the right modulo answer. Maybe it's just that I'm doing something wrong, I don't know. Also, any websites on finding the modulo of a number by hand would also be helpful.

Thank you very much for any and all help!

Extended Euclidean Algorithm?

You are correct in finding your GCD. If you used the table method to implement the Euclidean algorithm, it is no more difficult to use the table method for the Extended Euclidean algorithm.

A detailed explanation of its table implementations can be found in the references below, for the Euclidean and the Extended Euclidean, respectively.

To make your four-column table, label the columns:
1) k -- this will be your multiplication factor
2) t -- one of your unknowns
3) s -- the second unknown
4) rem -- the remainder

(This should help you keep things straight as you progress.)

Fill in the first two rows:
ROW 1
k is unused (put a slash)
t = 1, s = 0
rem = the coefficient of t (14038)

ROW 2
leave k blank for now
t = 0, s = 1
rem = the coefficient of s (1529)

NOTE: it is much easier to visualize if you place the larger integer and its respective coefficient in ROW 1

Now, proceed for each row, starting in Row 3:
Divide the two previous Remainders (14038 DIV 1529) = 9
This is your previous "k" value
s = s from two rows above, minus k*(s from one row above)
t = t from two rows above, minus k*(t from one row above)
rem = the modulous of the two previous remainders
(14038 MOD 1529)

Continue until the rem is your GCD.

the resulting line may be substituted into your equation. The table should look like:

k t s rem
-- 1 0 14038
9 0 1 1529
5 1 -9 277
1 -5 46 144
.....
-- 138 -1267 1

To make the process faster (or to check your work as you go), note that the third column of your table should match the modulo remainders you came up with in the Euclidean algorithm table.

The resulting equation :
1529*(-1267) + 14038*138 = gcd (1529,14038) = 1

Proof of a more general extended euclidean algorithm?

Let a1, a2, . . . , ak be integers with gcd(a1, a2, . . . , ak) = 1, i.e., the largest positive integer dividing all of a1, . . . , ak is 1.

Prove that the equation a1u1 + a2u2 + · · · + akuk = 1 has a solution in integers u1, u2, . . . , uk.

(Hint. Repeatedly apply the extended Euclidean algorithm. You may find it easier to prove a more general statement in which gcd(a1, . . . , ak) is allowed to be larger than 1.)

Use the extended Euclidean algorithm to express gcd(252, 356) as a linear combination of 252 and 256?

It I could do that I would not be on YA, would I? Bet someone takes that as a challenge... Like me: I took it to the power of Google: Function ModularArithmetic(ByVal Base As Long, ByVal Power As Long, ByVal Modulo As Long) As Long Dim Result As Long = 1 Dim ExpCount As Integer = 0 Do While (Power > 0) If (Power And 1) Then Base = Pow(Base, 1 << ExpCount) Mod Modulo Result = (Result * Base) Mod Modulo ExpCount = 0 End If ExpCount += 1 Power >>= 1 Loop Return Result End Function Function Pow(ByVal base As Long, ByVal power As Long) As Long Return CLng(System.Math.Pow(base, power)) End Function

What is an algorithm in C?

An algorithm has nothing to do with the programming language used to implement it. So there is no such thing as an “algorithm in C”, or an “algorithm in Java”, or an “algorithm in Python”, etc. An algorithm is simply a recipe; a series of steps you can follow to solve a problem. Whether you implement that algorithm in C, Java, or Python doesn’t change the recipe. The language specifics that you use as you are coding your algorithm will vary depending on the language you are using, but the descriptions of the steps themselves has nothing to do with language.In other words, you should be able to describe your algorithm using your native language, or pseudocode. Once you have that down, you can translate those steps into code using whatever language you need. The hard part is usually coming up with the steps in the first place (what specific steps will you take to solve the problem at hand) rather than translating them into code.

Can someone clearly explain the recursive gcd algorithm?

Thanks for A2A.Let's start by changing a variable a little. Instead of [math]a = bq + r[/math], let’s use [math]a = dq + r, [/math]where a is dividend, d is divisor, q is quotient. r is the remainder.The recursive Greatest Common Divisor(gcd) algorithm has everything to do with the equation [math]a = dq + r[/math]. Let’s start by doing some example in math. Suppose we want to find gcd of 414 and 662.[math]662 = 414 \cdot 1 + 248[/math][math]414 = 218 \cdot 1 + 166[/math][math]248 = 166 \cdot 1 + 82[/math][math]166 = 82 \cdot 2 + 2[/math][math] 82 = 2 \cdot 41 + 0[/math]From this, we know that when the remainder is 0, gcd is the value of d, which is 2. So gcd of 414 and 662 is 2. Notice that, a in current line is d from previous line, and d from current line is r from previous line. The pattern goes like this until the remainder is 0.Alright, let’s do this in recursion. The recursion algorithm isint gcd(int a, int d)
{
if (d == 0)
return a;
else
return gcd(d, a % d);
}
The result of gcd(662, 414) is going to begcd(662, 414) = gcd(414, 248)
= gcd(248, 166)
= gcd(166, 82)
= gcd(164, 2)
= gcd(2, 0)
= 2
From here, you can see that recursive way of solving is identical to mathematical way of solving gcd line by line. So the algorithm and the math equation is related. In fact, recursive algorithm is just translation of mathematical equation.

How do I find the multiplicative inverse in GF(2^8) using extended Euclidean algo? Please elaborate on choosing values of a and b?

2^8 = 256 = a mod b , pick a,b such that gcd( a ,b) =1 256 = 25 mod 33 , gcd( 25, 33) =1 ,   ( what is GF ?)We must find the inverse of 25 mod 33We need an x ,such that x(25) = 1 mod 33of course from the outset we know that x = 4 ,in so far as that  4(25) = 100 =1 mod 33Now use the algo. Starting with step (0) we will calculate an auxiliary number p(I) wherep(I)  = p(i-2) - p(i-1)×q(i-1) mod n ,   q is each quotient at each step of the algorithm. ,and p(0)=0 and p(1)=1It is necessary that the final remainder is 1 ,otherwise the process will not work. We know from above that (25,33) will work.33 = q(1)25 +r(1) ,       step (0)33 = (1)(25) +8 ,           p0)=025  = q(2)(8) +r(2) ,      step (1)25  =  (3) (8) +1 ,          p(1) =1 (this has nothing to do with r(2)=1)                                   step (2)8     =  q(3)(8) + r(3) ,   p(2) = p(0) -p(1)q(1) mod 338     =    (1)(8)  + 0  ,      p(2) =  0    -  (1) (1) mod 33  =+32Go forward one step past the end of the algorithm to p(3) , in this case, in order to get the inversep(3) = p(1)-p(2)×q(2) mod n , ( information in steps (1) and (2) abovep(3)  = 1   -   32 × 3 mod 33 = 1 - 96 mod 33 p(3) = - 95 mod 33 = 4 p(3) = 4So the inverse of 25 mod 33 = 4 mod 334(25) =100 =1 mod 33(I don't know what GF above means I hope all of this in not in vain.If you draw a Cayley diagram you will find that G ={ 1,4,16,25,31} , × ,mod 33 is closed and that4^(-1) = 25 ,      25^(-1) = 4 ,       16^(-1)= 31 and 31^(-1) = 16 mod 33  Another set can be generated from 256 = 3 mod 11 F = { 1, 3 , 4 , 5 ,  9 } , × mod 113^(-1) mod 11 = 4 mod 11 ,      3(4) =1 mod 11 etcSun. 10 .00 P.M.Mon 10.50 AM , you're welcome! , what is GF?

TRENDING NEWS