예제 #1
0
 def _regen_b3b4(self):
     """Regenerate b3 and b4. This is the encrypted form of L. 
     """
     tw = MCRYPT('twofish', 'ecb')
     tw.init(self.pprime)
     self.b3b4 = tw.encrypt(self.hshkey)
     log.debug("B3/B4 set to %s" % repr(self.b3b4))
예제 #2
0
파일: __init__.py 프로젝트: lionel/pypwsafe
 def _regen_b3b4(self):
     """Regenerate b3 and b4. This is the encrypted form of L. 
     """
     tw = MCRYPT('twofish', 'ecb')
     tw.init(self.pprime)
     self.b3b4 = tw.encrypt(self.hshkey)
     log.debug("B3/B4 set to %s" % repr(self.b3b4))
예제 #3
0
 def _regen_b1b2(self):
     """Regenerate b1 and b2. This is the encrypted form of K. 
     
     """
     tw = MCRYPT('twofish', 'ecb')
     tw.init(self.pprime)
     self.b1b2 = tw.encrypt(self.enckey)
     log.debug("B1/B2 set to %s" % repr(self.b1b2))
예제 #4
0
파일: __init__.py 프로젝트: lionel/pypwsafe
 def _regen_b1b2(self):
     """Regenerate b1 and b2. This is the encrypted form of K. 
     
     """
     tw = MCRYPT('twofish', 'ecb')
     tw.init(self.pprime)
     self.b1b2 = tw.encrypt(self.enckey)
     log.debug("B1/B2 set to %s" % repr(self.b1b2))
예제 #5
0
def encryptXtea(key, iv, str):
	m = MCRYPT('xtea', 'ecb')
	key = key.ljust(m.get_key_size(), "\0")
	iv = iv.ljust(m.get_iv_size(), "\0")
	m.init(key, iv)
	return m.encrypt(str)
예제 #6
0
 def encrypt_data(self):
     """Encrypted fulldata to cryptdata"""
     tw = MCRYPT('twofish', 'cbc')
     tw.init(self.enckey, self.iv)
     self.cryptdata = tw.encrypt(self.fulldata)
예제 #7
0
파일: __init__.py 프로젝트: lionel/pypwsafe
 def encrypt_data(self):
     """Encrypted fulldata to cryptdata"""
     tw = MCRYPT('twofish', 'cbc')
     tw.init(self.enckey, self.iv)
     self.cryptdata = tw.encrypt(self.fulldata)