public static void EncryptHexKey(this QueryViewModel viewModel, byte[] data)
 {
     viewModel.HKeyID = AppResource.Instance.EncryptSalted(data).ToHexString();
 }
 public static void EncryptKey(this QueryViewModel viewModel, byte[] data)
 {
     viewModel.KeyID = Convert.ToBase64String(AppResource.Instance.EncryptSalted(data));
 }
 public static byte[] DecryptHexKey(this QueryViewModel viewModel)
 {
     return(AppResource.Instance.DecryptSalted(viewModel.HKeyID.HexToByteArray()));
 }
 public static int DecryptHexKeyValue(this QueryViewModel viewModel)
 {
     return(BitConverter.ToInt32(viewModel.DecryptHexKey(), 0));
 }
 public static byte[] DecryptKey(this QueryViewModel viewModel)
 {
     return(AppResource.Instance.DecryptSalted(Convert.FromBase64String(viewModel.KeyID)));
 }