CIS 700, Fall 2014
Homework 1: Many-time pad

Each line of the ascii plaintext has been encrypted by xoring with the same randomly generated key pad, then encoded in hex. Your task is to decrypt as much of it as possible. You should at least be able to get the entire first and last lines.

Please submit your code and a short description of how you solved the problem along with any other files to Canvas before class on September 8. You may discuss this assignment in small groups with classmates, but please code and write up your solutions yourself. Please credit any collaborators you discussed with and any references you used.

I recommend you start early.


60c2d5ceccb3a49ef296a7172ac38c5a2440ffd3cc73f6e6b91c22e89f2897eec952aea8e56abd33dc8e12a3efab6efcbfd83f879ed78304a1f4f68deac1a65cc202
0bf09acbd9b9a98ba595ea556d90995a2d059bd4cc65b9c0b45336e18e33d5ab9e48aaafae66fd75bf
0df1ce9cd7aca99eed9ca55865c283563240d4d0896bbfc1f1162eead70cd3a1cb58b2a7e560bc20d9845ba4efee23e9bdd86c808296c205a3f4e189e8dfed5c8770d21b10cc668179da6fb6dbcf24b4d12478aee4c09448b5ae77701972c49de7b6010c3a97044481ff050a
60d3df9bcaafa98dea90eb5c2ac482132705cf96c57ab8d1b91633af962edea0994ffab7a03cf175dd855ba0e2e270edb0cf2997c9fd
60cdce9ccfabfacae4d9f1547fd785132113c8dfce6dbbd7bf077badd72fdaa7da1b9ea5a073f301dd8f0eb0e2ff23f0bcd1289f9ed9e8
60c2d5ceccb3a49ef296a4192ac9885f2c05df96e56cb9dca00636f89b729becf748fab4ad62a775d48c17f7f3e476baa3d86c948883c21eaaf4e684e9dba81a8d7a820d16ce62812d9b67b398cb77fcd42769e0a9c09604a8a97c701366d08ee6f4011420911c12c790
60cd9adfd0afea81e09da5527e909b5632199bc2c16ca4dda4143fe38e709bbddf52bee0b16bb675d68f16a7ffff66eff99d2d9d83d79602a4a0b59df3c5fc19c26cc7181ad66e9b689670f7d1d977e0dd2e2fa1aada8d0db3e818
0ba4ced4d1a4e2caf191e01b7ac282512c05d69a8977b992b31677fe8235cfab9e53b5aea070a775c2890fbfaaf26ce8f99d2580c7838a0bb1f4ec83f38bfe19c266c70816ca278e6e8e7cb6d4c62eb4de2560b7aa898d00a0b232240266918de0b65217268c190d8ce90522c7
48
62a49affd7a4ee98e48df0576bc4845c2e139796d06ca392b91221ead73bd4baca5eb4e0b16bba2695861aa5a4ab23dfa0c96c8a8882c518a0f4fb83f28cec138c6d820716cc26e5
62a49ae5d7bfa989e497a55d63de89133408de96db66a5c6f11c31af8334deeed654b7a5b26ca13e959009b8e8e766f0a69d24969592d860
62a49ad4ccbef999bfd6aa4c7dc7c350291395c3d966b8dcff1633fad822d5afda52bba8ea60bc20c7931ea4a5e86aeee28d7cde81c6d645ada3a4c3eedbb952926cc474

For reference, the ciphertext was generated using the following Python program, borrowed from Dan Boneh.
def strxor(a, b):     # xor two strings (trims the longer input)
    return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b)])

def random(size=16):
    return open("/dev/urandom").read(size)

def encrypt(key, msg):
    c = strxor(key, msg)
    print c.encode('hex')
    return c

def main():
    key = random(1024)
    ciphertexts = [encrypt(key, msg) for msg in MSGS]
    return ciphertexts