n-class encryption