Modified encryption logic