def __init__(self): MatasanoChallenge.__init__(self) self.plaintext = Base64Decoder().decode(self.PLAINTEXT)
def value(self): ciphertext = Base64Decoder().decode_file(self.FILE) return AES(self.KEY).decrypt(ciphertext, mode=CBC(self.IV)).bytes()
def value(self): key = 'YELLOW SUBMARINE' ciphertext = Base64Decoder().decode_file(self.FILE) return AES(key).decrypt(ciphertext, mode=ECB()).bytes()
def __init__(self): MatasanoChallenge.__init__(self) ciphertext = Base64Decoder().decode_file(self.FILE) self.plaintext = AES(self.KEY).decrypt(ciphertext, mode=ECB()).bytes()
def expected_value(self): decoded_lines = Base64Decoder().decode_file_lines(self.ANSWER_FILE) return Concatenation(decoded_lines).value()
def _choose_plaintext(self): plaintexts = FileLines(self.INPUT_FILE).value() plaintext = random.choice(plaintexts) return Base64Decoder().decode(plaintext)
def value(self): plaintexts = Base64Decoder().decode_file_lines(self.FILE) ciphertexts = self._encrypt(plaintexts) return FixedNonceCTRDecrypter().decrypt(ciphertexts)
def value(self): decoded_content = Base64Decoder().decode_file(self.FILE) return RepeatingKeyXORDecrypter().decrypt(decoded_content)
def _decode_trailing_string(self): string = self._trailing_string() return Base64Decoder().decode(string)