Optimized encryption class.