def encrypt(self) -> bytes: return encodeBytes( self.__public.encrypt( strToBytes(self.__data), padding.OAEP(mgf=padding.MGF1(algorithm=hashes.SHA256()), algorithm=hashes.SHA256(), label=None))).decode('utf-8')
def MD5(self): digest = hashes.Hash(hashes.MD5(), backend=default_backend()) digest.update(strToBytes(self.__data)) return encodeBytes(digest.finalize()).decode("utf-8")
def sign(self) -> str: return encodeBytes(self.__private.sign(strToBytes(self.__message), ec.ECDSA(hashes.SHA256()))).decode("utf-8")
def encrypt(self) -> str: encryptor = self.__cipher.encryptor() return encodeBytes( encryptor.update(self.__padData()) + encryptor.finalize()).decode('utf-8')
def get_iv(self): return encodeBytes(self.__iv).decode('utf-8')
def get_key(self): return encodeBytes(self.__key).decode('utf-8')