#NEWLINE# def decrypt( self , data , pad = None , padmode = None ) : #NEWLINE# #INDENT# 'decrypt(data, [pad], [padmode]) -> bytes\n\n        data : bytes to be encrypted\n        pad  : Optional argument for decryption padding. Must only be one byte\n        padmode : Optional argument for overriding the padding mode.\n\n        The data must be a multiple of 8 bytes and will be decrypted\n        with the already specified key. In PAD_NORMAL mode, if the\n        optional padding character is supplied, then the un-encrypted\n        data will have the padding characters removed from the end of\n        the bytes. This pad removal only occurs on the last 8 bytes of\n        the data (last data block). In PAD_PKCS5 mode, the special\n        padding end markers will be removed from the data after\n        decrypting, no pad character is required for PAD_PKCS5.\n        ' #NEWLINE# ENCRYPT = des . ENCRYPT #NEWLINE# DECRYPT = des . DECRYPT #NEWLINE# data = self . _guardAgainstUnicode ( data ) #NEWLINE# if ( pad is not None ) : #NEWLINE# #INDENT# pad = self . _guardAgainstUnicode ( pad ) #NEWLINE# #UNINDENT# if ( self . getMode ( ) == CBC ) : #NEWLINE# #INDENT# self . __key1 . setIV ( self . getIV ( ) ) #NEWLINE# self . __key2 . setIV ( self . getIV ( ) ) #NEWLINE# self . __key3 . setIV ( self . getIV ( ) ) #NEWLINE# i = 0 #NEWLINE# result = [ ] #NEWLINE# while ( i < len ( data ) ) : #NEWLINE# #INDENT# iv = data [ i : ( i + 8 ) ] #NEWLINE# block = self . __key3 . crypt ( iv , DECRYPT ) #NEWLINE# block = self . __key2 . crypt ( block , ENCRYPT ) #NEWLINE# block = self . __key1 . crypt ( block , DECRYPT ) #NEWLINE# self . __key1 . setIV ( iv ) #NEWLINE# self . __key2 . setIV ( iv ) #NEWLINE# self . __key3 . setIV ( iv ) #NEWLINE# result . append ( block ) #NEWLINE# i += 8 #NEWLINE# #UNINDENT# if ( _pythonMajorVersion < 3 ) : #NEWLINE# #INDENT# data = '' . join ( result ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# data = bytes . fromhex ( '' ) . join ( result ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# data = self . __key3 . crypt ( data , DECRYPT ) #NEWLINE# data = self . __key2 . crypt ( data , ENCRYPT ) #NEWLINE# data = self . __key1 . crypt ( data , DECRYPT ) #NEWLINE# #UNINDENT# return self . _unpadData ( data , pad , padmode )