Modified encryption to use CTR mode