'Set a password for a GNTP Message
@param password:  Null to clear password
@param encryptAlgo: Currently only supports MD5
@todo: Support other hash functions'

def set_password(self, password, encryptAlgo='MD5'):

    self.password = password
    if (not password):
        self.info['encryptionAlgorithmID'] = None
        self.info['keyHashAlgorithm'] = None
        return
    password = password.encode('utf8')
    seed = time.ctime()
    salt = hashlib.md5(seed).hexdigest()
    saltHash = hashlib.md5(seed).digest()
    keyBasis = (password + saltHash)
    key = hashlib.md5(keyBasis).digest()
    keyHash = hashlib.md5(key).hexdigest()
    self.info['keyHashAlgorithmID'] = encryptAlgo.upper()
    self.info['keyHash'] = keyHash.upper()
    self.info['salt'] = salt.upper()
