Updated encryption algorithm