CIS 556, Fall 2015
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.

92bc51597765f58cc5ff89fbc8aa5bd4e354e53cff3b5f81
80af4c5e6473ea8fdee5fecdc7b60fd4f757ff65d9690dab8bc10347b7488cc965f39885f19d40f3e1778f8c6fcc58c90d64ff
92e70371266db986c5abcc8cd4aa1499b153b031b0370ffecdcb0c4cbc1cd8c26bf096d6b4d317eee03b8b8d79cc58c90d7b9249e1d101ac5314941ef288399196cee8da99
808a19185665f58c80e5dec4c1b15bdce211b12df56e10ea9edb1a4de90cc7ab
92e70379762cb98ec3eb89f5cfb05bd2fe45b124b03a05e781880047b548b0c47db1d3bffdc952f7e27799966b9801ef583f9a0eb7fd01bf5207d14eea943fc68dd4fe91f647020f8c9a085f67353047b6e12aed540a5dac88836aac2f77a8874da50d6ad8c1b9e7
808a19184873b989d8e5e4cdd2bc44bf
92e70370602df18182e5fdc4c1b15cc6bc50e52bff6e06e29ec04328
808a19185268fcc0c5b6c78bd4fa5be2f45da969b03d08eecdcc1f4bf5038b8168f49893fdd259fea077a29b7ecc4cc358289045ad9468ab1b18c04ee08f3f949ed9e39aac6d
92e703706479b5c0d5aadc8cc3b71acfe81fe516e43b12ec88c7030ebb009d8677bd92d6b9d254efe125ce9d7f98528601348000f8c444b61b06dc0bfdd62bc680d3f9d4e00e0611c7c93555633b592ea5af2fa8001b57f9c68d69ac2f75a1d549a5086bcac7f48885a9
808a19184820fe8fd8e5c0d88ee533d4f555aa26fb606a
92e7036c6961edc7dfe8c88cc6b015dbe81fe50cb0290fff99c94d4afa0c9cce67f6dfd6a9d258b584
808a19185668f8948ca1c68cd9aa0e95e550ae20b0280ff9cdc94d4afa0c9cce67f6ccfc
92e7036f646cf5cdcde989dfcfa81ec1f85ca036b00740ff8cc3080ffa4899d274f4819fb39117e8e13a8b8a638144d55812d554f6df44f55a51f70fff9a2783959286
808a19185261e0cc8c8c8ec880b21ad9fa11a465fd270ceecdce0250bb09d8e265f1929bb8d11991
92e703616e75b98dc9a4c78cc3ad14d6fe5da431f56e03ea81c90047f746d8e824f19a9db89d43f3ef23ce8a65830d861a2e8100eedb54f8551e9409e69e3995d9d5f8dab32f0003c5c90c52756f377defa779a041164ce994ce27b0606deec943a51e6dcfcce59edfc22c616adf8eb6eefeba263c5242
f0fd03616e75b983cdab8ed880a614d8f411ac2bb02605f98888184cf70d8bd224e49c83fdce56e2a277ccad7d8353c21e328648b996019654069427b49726c69ed5fa91b31e0a0fc986155f34767f7ca7e63eb845114ba2ec
808a19182f2eb793dbaadbc8c6ac08ddbd11b632ff3c04ed84db050cb546d8e824e99b9fb3d617d2ae30818a2a85558858128600fec001fa4806db1cf79d2395919eb3fe
92e703706068b7c0f8adc8d887b656d4b158b16bb0170ffecdcf1847e81bd8c870b3f9
da
f0fd037b6e6efe92cdb1dcc0c1b112daff42e965e92115ab85c91b47bb0f97d570f89dd6a9d55ee8ae318f8c24cc01e40d2fd559f8c106aa5e51da01e7db2e8997d9ac8df6134470
f0fd03616e75b983cdab89cac9ab1f95e559a065e22b13ffcdc70b02ef009d816cf29e93aad245f0ae279c91688044cb0b7b9d45e5d11bd2
f0fd03507574e99396ea86dbd7b255d6f842eb30e02b0ee5c3cd0957b4169bc877a8c6c0f2d540aaa13f99cf249c45c072
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