Variable key stretching with fast dictionary-based entropy calculation