':rtype: basestring'

def encrypt(self, section, key, _decrypt=False):

    if (key in [u'config_version', u'encryption_version', u'encryption_secret']):
        pass
    else:
        try:
            if (self.ENCRYPTION_VERSION == 1):
                unique_key1 = hex((uuid.getnode() ** 2))
                if _decrypt:
                    section[key] = u''.join((chr((ord(x) ^ ord(y))) for (x, y) in izip(base64.decodestring(section[key]), cycle(unique_key1))))
                else:
                    section[key] = base64.encodestring(u''.join((chr((ord(x) ^ ord(y))) for (x, y) in izip(section[key], cycle(unique_key1))))).strip()
            elif (self.ENCRYPTION_VERSION == 2):
                if _decrypt:
                    section[key] = u''.join((chr((ord(x) ^ ord(y))) for (x, y) in izip(base64.decodestring(section[key]), cycle(sickrage.srCore.srConfig.ENCRYPTION_SECRET))))
                else:
                    section[key] = base64.encodestring(u''.join((chr((ord(x) ^ ord(y))) for (x, y) in izip(section[key], cycle(sickrage.srCore.srConfig.ENCRYPTION_SECRET))))).strip()
        except:
            pass
