예제 #1
0
    def decrypt(self, ciphertext):
        """

        :param ciphertext: bytes
        :return: str
        """
        if type(ciphertext) is not bytes:
            raise TypeError("AES decryptor supports bytes only")
        return conversion.bytes_to_str(self.cipher_core.decrypt(ciphertext))
예제 #2
0
    def decrypt_single_val(self, ciphertext):
        """

        :param ciphertext: bytes
        :return: str
        """
        if not isinstance(ciphertext, bytes):
            raise TypeError("AES decryptor supports bytes only")
        plaintext = conversion.bytes_to_str(
            self.cipher_core.decrypt(ciphertext))
        self._renew()
        return plaintext