Base cipher method