Beispiel #1
0
 def testTamperMac(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     a["digest"]= "tampered" 
     assert not m1.verify(a), "expected message to verify";
Beispiel #2
0
 def testTamperAlg(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     m1._algorithm = "alg" # bypassing the algorithm check to verify the mac is over the alg + data 
     a["alg"]= "alg" 
     assert not m1.verify(a), "expected message to verify";
Beispiel #3
0
 def testTamperAlg(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     m1._algorithm = "alg"  # bypassing the algorithm check to verify the mac is over the alg + data
     a["alg"] = "alg"
     assert not m1.verify(a), "expected message to verify"
Beispiel #4
0
 def testTamperMac(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     a["digest"] = "tampered"
     assert not m1.verify(a), "expected message to verify"
Beispiel #5
0
 def testSeperateVerify(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     assert m1.verify(a), "expected message to verify"
Beispiel #6
0
 def testSeperateVerify(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     assert m1.verify(a), "expected message to verify";