Optimal Caesar shift implementation