예제 #1
0
파일: test2.py 프로젝트: Renelvon/matasano
def solve(hex1, hex2):
    dec1 = stringlib.decode_hex(hex1)
    dec2 = stringlib.decode_hex(hex2)
    xored = strxor.strxor(dec1, dec2)
    return stringlib.encode_hex(xored).lower()
예제 #2
0
def solve(plaintext, key):
    ltext, lkey = len(plaintext), len(key)
    reps = (ltext + lkey - 1) // lkey
    rep_key = (key * reps)[:ltext]
    ciphertext = strxor.strxor(plaintext, rep_key)
    return stringlib.encode_hex(ciphertext).lower()
예제 #3
0
파일: test5.py 프로젝트: Renelvon/matasano
def solve(plaintext, key):
    ltext, lkey = len(plaintext), len(key)
    reps = (ltext + lkey - 1) // lkey
    rep_key = (key * reps)[:ltext]
    ciphertext = strxor.strxor(plaintext, rep_key)
    return stringlib.encode_hex(ciphertext).lower()
예제 #4
0
def solve(hex1, hex2):
    dec1 = stringlib.decode_hex(hex1)
    dec2 = stringlib.decode_hex(hex2)
    xored = strxor.strxor(dec1, dec2)
    return stringlib.encode_hex(xored).lower()