updated encryption algorithm