Encryption logic changed