def encryptDES(s):
 iv = helpers.randomKey(8)
 key = helpers.randomKey(8)
 desmain = DES.new(key, DES.MODE_CFB, iv)
 encrypted = desmain.encrypt(s)
 return (encrypted, (key, iv))

def encryptDES ( s ) : iv = helpers . randomKey ( 8 ) key = helpers . randomKey ( 8 ) desmain = DES . new ( key , DES . MODE_CFB , iv ) encrypted = desmain . encrypt ( s ) return ( encrypted , ( key , iv ) )
generates a random des key and iv .