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