static string TestKeyText(string key, string text)
        {
            var ps     = new PontifexSolitaire(key);
            var output = ps.Decrypt(text).Pad5();

            return(output);
        }
Ejemplo n.º 2
0
        public async void DecryptClicked(object sender, EventArgs e)
        {
            if (!ValidInputs())
            {
                await DisplayAlert("Missing input", "You must enter plaintext/ciphertext and the key", "OK");

                return;
            }
            var ps = new PontifexSolitaire(key.Text);

            ciphertext.Text = ps.Decrypt(plaintext.Text).Pad5();

            Tweet.Code = ciphertext.Text;
        }
        public async void DecryptClicked(object sender, EventArgs e)
        {
            if (!ValidInputs())
            {
                await DisplayAlert("Missing input", "You must enter plaintext/ciphertext and the key", "OK");

                return;
            }
            var ps = new PontifexSolitaire(key.Text);

            ciphertext.Text = ps.Decrypt(plaintext.Text).Pad5();

            // was for contest (now closed) http://blog.xamarin.com/xamarin-acquires-petzold/
            //Tweet.Code = ciphertext.Text;
        }
Ejemplo n.º 4
0
        public void scanView_OnScanResult(Result result)
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                var ps  = new PontifexSolitaire("patitofeo");
                var Ras = ps.Decrypt(result.Text).Pad5();
                //await DisplayAlert("Resultado", "The barcode's text is " + Ras, "OK");
                var user = await fireBaseHelper.GetById(Ras);

                if (user != null && user.Tickets >= 1)
                {
                    var sumTickets = user.Tickets - 1;
                    await fireBaseHelper.AddTicket(user.Id, user.Name, user.Number, user.Password, user.Rol, sumTickets);
                    //await DisplayAlert("Exito", "El tiquete ha sido cobrado ", "OK");
                    //Application.Current.MainPage = new AdminPage();
                    await Navigation.PushModalAsync(new AdminPage());
                }
                else
                {
                    await DisplayAlert("Error", "El usuario no existe o el codigo esta corrupto o no tiene tiquetes disponibles", "OK");
                    await Navigation.PushModalAsync(new AdminPage());
                }
            });
        }