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