public ProtoBinaryManager() { //If you use new line in your password or salt string, //Windows machine could produce different result because it uses \r\n instead of just \n var password = EncryptionPassword.Replace("\r", ""); var salt = EncryptionSalt.Replace("\r", ""); // Debug.Log(string.Join(" ",Encoding.ASCII.GetBytes(password).Select(x => x.ToString("X")))); // Debug.Log(string.Join(" ",Encoding.ASCII.GetBytes(salt).Select(x => x.ToString("X")))); derivator = new Rfc2898DeriveBytes(Encoding.ASCII.GetBytes(password), Encoding.ASCII.GetBytes(salt), 5555); key = derivator.GetBytes(16); }