Exemplo n.º 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";
Exemplo n.º 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";
Exemplo n.º 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"
Exemplo n.º 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"
Exemplo n.º 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"
Exemplo n.º 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";