def dec(data, **kwargs):
 key = _get_key(**kwargs)
 sk = base64.b64decode(key)
 b = libnacl.secret.SecretBox(key=sk)
 return b.decrypt(base64.b64decode(data))

def dec ( data , ** kwargs ) : key = _get_key ( ** kwargs ) sk = base64 . b64decode ( key ) b = libnacl . secret . SecretBox ( key = sk ) return b . decrypt ( base64 . b64decode ( data ) )
takes a key generated from nacl .