Vote count:
0
I'm trying to convert a Python script to .NET and this is the only line I'm having a hard time understanding:
password_encrypted = self._encrypt(message + '10' * 16)
Which calls this function:
def _encrypt(self, plaintext):
cipher = Cipher(algorithms.AES(self.key), modes.CBC(bytes(16)), backend=self.backend)
encryptor = cipher.encryptor()
return encryptor.update(bytes.fromhex(plaintext)) + encryptor.finalize()
I can see that the message variable has the string "10" appended to it, but I'm confused by the * 16. The message variable is a SHA256 hash converted to Hex string, so it can't be multiplied by 16. Any ideas what the * 16 is doing?
asked 1 min ago
Trying to convert a Python line and can't understand this logic: message + '10' * 16
Aucun commentaire:
Enregistrer un commentaire