From: maronvomra on 11 Dec 2009 18:53 Hi, In affine cipher if the output is negative then how to get the keys like if the keys are (a,b) and if letter C is represented as 2, maps to the letter T, represented as 19, and the letter R, represented as 17 maps to Q , represented as 16 so we get 19 = a.2 + b mod 26 16 = a.17 + b mod 26 Subtracting these two equ. we get 3 = -15a or, 15power -1 mod 26 = 7 mod 26 now how to get k which is (5,9) Thanks.
From: Jeff Dege on 12 Dec 2009 00:31 On Fri, 11 Dec 2009 15:53:01 -0800, maronvomra wrote: > Hi, > In affine cipher if the output is negative then how to get the keys like > if the keys are (a,b) and if letter C is represented as 2, maps to the > letter T, represented as 19, and the letter R, represented as 17 maps to > Q , represented as 16 so we get > 19 = a.2 + b mod 26 > 16 = a.17 + b mod 26 > Subtracting these two equ. we get 3 = -15a or, 15power -1 mod 26 = 7 > mod 26 > now how to get k which is (5,9) It's just plain algebra, except for the difference in how the multiplicative inverse is calculated. You've got 3 = -15 * a, which is 1 * 5a = -3, which is 15 * a = 23 Now 15 * 7 = 105, which is 15 * 7 = 1, so as you say, 15^-1 = 7 So going back to 15 * a = 23, you get 7 * 15 * a = 7 * 23, which gives you 1 * a = 161, or a = 5 And then plugging a = 5 into 19 = a * 2 + b, we get 5 * 2 + b = 19, which is 10 + b = 19, and then b = 9. -- That's the mild form of the vilification that is the reflexive tool of intimidation for the Left when it doesn't control the state. When it does, you get the gulag and the firing squad. - David Horowitz
From: maronvomra on 12 Dec 2009 20:01 On Dec 12, 12:31 am, Jeff Dege <jd...(a)jdege.visi.com> wrote: > On Fri, 11 Dec 2009 15:53:01 -0800, maronvomra wrote: > > Hi, > > In affine cipher if the output is negative then how to get the keys like > > if the keys are (a,b) and if letter C is represented as 2, maps to the > > letter T, represented as 19, and the letter R, represented as 17 maps to > > Q , represented as 16 so we get > > 19 = a.2 + b mod 26 > > 16 = a.17 + b mod 26 > > Subtracting these two equ. we get 3 = -15a or, 15power -1 mod 26 = 7 > > mod 26 > > now how to get k which is (5,9) > > It's just plain algebra, except for the difference in how the > multiplicative inverse is calculated. > > You've got 3 = -15 * a, which is 1 * 5a = -3, which is 15 * a = 23 > > Now 15 * 7 = 105, which is 15 * 7 = 1, so as you say, 15^-1 = 7 > > So going back to 15 * a = 23, you get 7 * 15 * a = 7 * 23, which gives > you 1 * a = 161, or a = 5 > > And then plugging a = 5 into 19 = a * 2 + b, we get 5 * 2 + b = 19, which > is 10 + b = 19, and then b = 9. > > -- > That's the mild form of the vilification that is the reflexive tool of > intimidation for the Left when it doesn't control the state. When it does, > you get the gulag and the firing squad. > - David Horowitz Thanks a lot. I got it now.
|
Pages: 1 Prev: Self-schrinking vs von Neumann unbiasing Next: SSL certificates and keys |