refine granularity for encryption api