def mac_verification_engine(self, ReceivedCiphertext, ReceivedMac): print( "======================PLS Client Inside Mac Verification Engine====================" ) VerificationCheck = CipherUtil.MAC_HMAC_SHA1(self.MKS) return VerificationCheck.verifyMac(ReceivedCiphertext, ReceivedMac)
def mac_engine(self, ciphertext): makehmac = CipherUtil.MAC_HMAC_SHA1(self.mkc) mac = makehmac.mac(ciphertext) # Creating PLS Data Packet and Writing down PEEP serverdata = PlsData() serverdata.Ciphertext = ciphertext serverdata.Mac = mac serializeddata = serverdata.__serialize__() self.transport.write(serializeddata)
def mac_engine(self, ciphertext): print("======================PLS Client Inside Mac Engine====================") makehmac = CipherUtil.MAC_HMAC_SHA1(self.mkc) mac = makehmac.mac(ciphertext) # Creating PLS Data Packet and Writing down PEEP print("=================== Writing Data down to PEEP from Application inside PlsClient================\n") serverdata = PlsData() serverdata.Ciphertext = ciphertext serverdata.Mac = mac serializeddata = serverdata.__serialize__() self.transport.write(serializeddata)
def mac_verification_engine(self, ReceivedCiphertext, ReceivedMac): VerificationCheck = CipherUtil.MAC_HMAC_SHA1(self.mks) return VerificationCheck.verifyMac(ReceivedCiphertext, ReceivedMac)
def MAC_Engine(self, ciphertext): hmac_engine = CipherUtil.MAC_HMAC_SHA1(self.MKs) return hmac_engine.mac(ciphertext)