secured encryption method creationwith final switch