Skip to content

Commit

Permalink
Delete some code fragments #53
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Haardiek <[email protected]>
  • Loading branch information
shaardie committed Nov 17, 2014
1 parent d942c15 commit 43a97e8
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions ircrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
ircrypt_asym_id = {}
ircrypt_cipher = {}
ircrypt_pub_keys_memory = {}
ircrypt_sym_keys_memory = {}
ircrypt_key_ex_memory = {}
ircrypt_gpg_binary = None
ircrypt_message_plain = {}
Expand All @@ -84,7 +83,6 @@
# Constants used throughout this script
MAX_PART_LEN = 300
MSG_PART_TIMEOUT = 300 # 5min
KEY_PART_TIMEOUT = 100
NEVER = 0
ALWAYS = 1
IF_NEW = 2
Expand Down Expand Up @@ -166,30 +164,6 @@ def update(self, id, msg):
self.modified = time.time()


class SymKeyParts:
'''Class used for storing parts of symmetric keys which were generate by two
userns.'''

modified = 0
parts = 0
key = ''

def update(self, keypart):
'''This method updates an already existing message part by adding a new
part to the old ones and updating the identifier of the latest received
message part.
'''
if time.time() - self.modified > KEY_PART_TIMEOUT or self.parts > 1:
self.key = ''
self.parts = 0
if self.key == '':
self.key = keypart
else:
self.key = ''.join(chr(ord(x) ^ ord(y)) for x, y in zip(self.key, keypart))
self.parts = self.parts + 1
self.modified = time.time()


class KeyExchange:
'''Class used for key exchange'''

Expand Down

0 comments on commit 43a97e8

Please sign in to comment.