If lenallbytesi 0 encryptednonce 22 else

This preview shows page 2 - 3 out of 3 pages.

if len(all_bytes[i]) == 0: encrypted_nonce += "22" else: encrypted_nonce += max(all_bytes[i].items(), key=lambda x: x[1])[0] print("Encryted nonce (without mannual modification): {}".format(encrypted_nonce)) for s in ciphertext: print(strxor(s, encrypted_nonce).decode(encoding="ascii", errors="replace")) print(strxor(target, encrypted_nonce).decode(encoding="ascii", errors="replace")) encrypted_nonce = list(encrypted_nonce) encrypted_nonce[4] = "5" encrypted_nonce[5] = "f" encrypted_nonce[10] = "e" encrypted_nonce[11] = "7" encrypted_nonce[22] = "9" encrypted_nonce[23] = "1" encrypted_nonce[40] = "6" encrypted_nonce[41] = "d" encrypted_nonce[56] = "6" encrypted_nonce[57] = "c" encrypted_nonce[76] = "4" encrypted_nonce[77] = "a" encrypted_nonce[80] = "b" encrypted_nonce[81] = "a" encrypted_nonce[82] = "7" encrypted_nonce[83] = "d" encrypted_nonce[96] = "2" encrypted_nonce[97] = "f"
Image of page 2

Subscribe to view the full document.

encrypted_nonce[112] = "5" encrypted_nonce[113] = "2" encrypted_nonce[124] = "c" encrypted_nonce[125] = "f" encrypted_nonce[130] = "8" encrypted_nonce[131] = "1" encrypted_nonce[152] = "e" encrypted_nonce[153] = "e" encrypted_nonce[158] = "a" encrypted_nonce[159] = "e" encrypted_nonce[174] = "a" encrypted_nonce[175] = "e" encrypted_nonce[176] = "6" encrypted_nonce[177] = "a" encrypted_nonce[178] = "d" encrypted_nonce[179] = "c" encrypted_nonce[182] = "1" encrypted_nonce[183] = "8" encrypted_nonce[184] = "5" encrypted_nonce[185] = "0" encrypted_nonce[188] = "1" encrypted_nonce[189] = "4" encrypted_nonce = "".join(encrypted_nonce) print("\nActual encryted nonce: {}".format(encrypted_nonce)) for s in ciphertext: print(strxor(s, encrypted_nonce).decode(encoding="ascii", errors="replace")) print(strxor(target, encrypted_nonce).decode(encoding="ascii", errors="replace")) # possible_bytes = [] # for c1 in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]: # for c2 in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]: # possible_bytes.append(c1+c2) # index = 48 # for b in possible_bytes: # encrypted_nonce[2*index] = list(b)[0] # encrypted_nonce[2*index+1] = list(b)[1] # print(b) # print(strxor(target, "".join(encrypted_nonce)).decode(encoding="ascii", errors="replace"))
Image of page 3
You've reached the end of this preview.
  • Fall '08
  • Staff

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern