Results 1 to 15 of 15

Math Help - affine cipher

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    23

    affine cipher

    A plaintext letter is left fixed by a cipher if it remains the same in the ciphertext generated by the cipher. Find the letters left fixed by each affine cipher.

    a) c = 5P+11(mod26)

    b) c = 5P+14(mod26)

    thank you.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    If a letter is left fixed, can you write down an equation that represents that fact?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2009
    Posts
    23
    ans.
    a) no letter left fixed
    b) D and Q

    ???
    Follow Math Help Forum on Facebook and Google+

  4. #4
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    I understand those are the answers, but you didn't do what I asked. You gotta think this out! Can you write down an equation that represents the concept of one of those affine ciphers leaving a letter fixed? What does "leaving a letter fixed" mean?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Dec 2009
    Posts
    23
    ok.
    What does "leaving a letter fixed" mean?
    ans. plaintext letter=ciphertext letter although the plaintext letter is encrypted.
    Attached Thumbnails Attached Thumbnails affine cipher-13-8-2553-20-04-54.png   affine cipher-13-8-2553-20-07-52.png  
    Follow Math Help Forum on Facebook and Google+

  6. #6
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    Correct. By your png's, it looks like you've pretty much solved the problem, although such a brute-force approach isn't going to explain why the second cipher leaves two letters fixed, and the first cipher doesn't leave any letters fixed. You'd need some number theory to figure that out.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Dec 2009
    Posts
    23
    Explain why the second cipher leaves two letters fixed, and the first cipher doesn't leave any letters fixed.

    a) 5p + 11 = p (mod 26)
    4p = -11 (mod 26)
    Since 4 and 26 are both even, adding any number of 26's
    to -11 will never produce a multiple of 4, so there are no fixed points
    in this one.

    b)
    5p + 14 = p (mod 26)
    4p + 14 = 0 (mod 26)
    4p = -14 (mod 26)
    4p = (-14+26) = 12 (mod 26)
    p = 3

    To 12, we can add 26, but 38 not divisible by 4.
    Adding another 26, we get 4p = 64, which gives p = 16.
    Adding two more 26's we get 4p = 116, but then p = 29 which is > 26, so we are done.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Dec 2009
    Posts
    23
    teacher, help me please.

    Cryptanalyze the ciphertext created by an affine cipher c=ap+k(mod26) :
    IRCCH EKKEV CLLFK EIOKL XKKLF ILIGM EKOIV EKKE

    I would like to use the most frequently occuring letters in the ciphertext correspond to those in the plaintext but i can't find correct key. guess so dificult
    I want to find key by method at above,then solve equation to find a and k by linear congruence.
    Do you have techniques for guess?

    now I get correct key C=7p+8(mod26) because I try to shift ordinal No.03,05,07,09,11,15,17,19,21,23,25 for a, and shift ordinal No.00 through 25for k. it must spend very long time for finding. --"
    Last edited by calfever; August 14th 2010 at 05:11 AM.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    Reply to post # 7: I think the fixed points are going to be related to whether gcd(k,26) = 1 or not. If it is relatively prime, then I think you're going to see that there are no fixed points. That's my hunch, completely unproven. If gcd(a,26) is not equal to 1, then your cipher isn't going to work very well, since I don't think it's a bijection. So how would you prove this?

    Set p = a p + k (mod 26). Then p (1-a) = k (mod 26). Under what conditions can this equation be satisfied? (I don't actually know the answer off the top of my head - it's been a while since I did number theory.) In your original problem a), you've got p (1-5) = 11 (mod 26). Now, -4 = 22 (mod 26). Hence, we'd have to solve 22 p = 11 (mod 26). The LHS is even, and the RHS is odd. Is that enough to guarantee the non-existence of solutions?

    On the other hand, with problem a), you've got 22 p = 14 (mod 26). It strikes me that you might be able to find a solution to that, even though I don't think 22 has an inverse mod 26. In fact, you should be able to find exactly two solutions.

    Reply to post # 8: A frequency analysis is never a bad idea. E, T, and A, in that order, are the most common letters in English. If you can find the E and the T correctly, that should be enough to get your a and k in the affine cipher formula. You'd just have a system of two equations in two unknowns.

    The frequencies of your letters are:

    I = 5
    R = 1
    C = 3
    H = 1
    E = 6
    K = 9
    V = 2
    L = 5
    F = 2
    O = 2
    X = 1
    G = 1
    M = 1.

    So you'd probably assume that the K cipher = E plain, and that E cipher = T plain. Going with that assumption, what two equations do you get?
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Newbie
    Joined
    Dec 2009
    Posts
    23
    Quote Originally Posted by Ackbeet View Post

    So you'd probably assume that the K cipher = E plain, and that E cipher = T plain. Going with that assumption, what two equations do you get?
    i understand.
    i did. i found it's not. i shown in attachment

    but correct key that i found is the K cipher = E plain, and that I cipher = A plain

    Ususlly the first letter is K and second letter is E follow that you said.
    But this problem,the first letter is K and second letter is I. how i will know?

    or i try to guess must go on until i found correct key.
    Attached Thumbnails Attached Thumbnails affine cipher-image-10-.jpg  
    Follow Math Help Forum on Facebook and Google+

  11. #11
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    But this problem,the first letter is K and second letter is I. how i will know?
    You won't know ahead of time. In fact, ahead of time, you usually won't even know that the cipher is an affine cipher! You can usually guess that the cipher is a letter-by-letter substitution, by using various statistical analyses.

    Statistically, the more letters you have in the ciphertext (assuming the plaintext language is English), the more certain you can be that the highest occurring letters will show up in their correct locations in the frequency order. This is not a very long ciphertext, so I wouldn't necessarily expect everything to be in textbook order.

    Using the cipher you found, what is the plaintext?
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Newbie
    Joined
    Dec 2009
    Posts
    23
    the plaintext is " A FOOL SEES NOT THE SAME TREE THAT A WISE MAN SEES".
    Follow Math Help Forum on Facebook and Google+

  13. #13
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    Good stuff! Is there anything unclear to you concerning this problem?
    Follow Math Help Forum on Facebook and Google+

  14. #14
    Newbie
    Joined
    Dec 2009
    Posts
    23
    my last question.



    Do I understand it correct? If incorrect,please tell me about correct problem-solving.

    Thank you very much.
    Last edited by calfever; August 25th 2010 at 05:28 AM.
    Follow Math Help Forum on Facebook and Google+

  15. #15
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    Your computations seem correct to me. The only question I would have is what the word "product" means there. Does it just mean the output of each cipher, separately? Or does it mean you apply one cipher, and then compose it with the other? Composition seems an unlikely interpretation, because the composition of two affine ciphers is itself affine. You wouldn't gain a stronger cipher that way, and you might even weaken the cipher.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Affine matrix cipher
    Posted in the Number Theory Forum
    Replies: 0
    Last Post: March 17th 2011, 04:29 AM
  2. How many keys for an affine cipher in z27?
    Posted in the Number Theory Forum
    Replies: 0
    Last Post: March 6th 2011, 07:27 PM
  3. Affine Cipher Codebreak!
    Posted in the Number Theory Forum
    Replies: 0
    Last Post: March 6th 2011, 04:17 PM
  4. codebreaking! affine cipher
    Posted in the Number Theory Forum
    Replies: 0
    Last Post: February 20th 2011, 03:26 PM
  5. 2-dimensional affine cipher help
    Posted in the Advanced Math Topics Forum
    Replies: 0
    Last Post: October 1st 2010, 10:53 PM

Search Tags


/mathhelpforum @mathhelpforum