def _salt_cipher_secret(secret):
 salt = _get_new_csrf_string()
 chars = CSRF_ALLOWED_CHARS
 pairs = zip((chars.index(x) for x in secret), (chars.index(x) for x in salt))
 cipher = ''.join((chars[((x + y) % len(chars))] for (x, y) in pairs))
 return (salt + cipher)

def _salt_cipher_secret ( secret ) : salt = _get_new_csrf_string ( ) chars = CSRF_ALLOWED_CHARS pairs = zip ( ( chars . index ( x ) for x in secret ) , ( chars . index ( x ) for x in salt ) ) cipher = '' . join ( ( chars [ ( ( x + y ) % len ( chars ) ) ] for ( x , y ) in pairs ) ) return ( salt + cipher )
given a secret .