@check_redis_alive
def set_password(password, ttl):
    '\n    Encrypt and store the password for the specified lifetime.\n\n    Returns a token comprised of the key where the encrypted password\n    is stored, and the decryption key.\n    '
    storage_key = (REDIS_PREFIX + uuid.uuid4().hex)
    (encrypted_password, encryption_key) = encrypt(password)
    redis_client.setex(storage_key, ttl, encrypted_password)
    encryption_key = encryption_key.decode('utf-8')
    token = TOKEN_SEPARATOR.join([storage_key, encryption_key])
    return token
Encrypt and store the password for the specified lifetime.

Returns a token comprised of the key where the encrypted password
is stored, and the decryption key.
@check_redis_alive
def set_password(password, ttl):
    '\n    Encrypt and store the password for the specified lifetime.\n\n    Returns a token comprised of the key where the encrypted password\n    is stored, and the decryption key.\n    '
    storage_key = (REDIS_PREFIX + uuid.uuid4().hex)
    (encrypted_password, encryption_key) = encrypt(password)
    redis_client.setex(storage_key, ttl, encrypted_password)
    encryption_key = encryption_key.decode('utf-8')
    token = TOKEN_SEPARATOR.join([storage_key, encryption_key])
    return token