public void GenerateContentWithUmlautsTest()
        {
            var    key      = MpAlgorithm.GetKeyForPassword("uÜ", "testÖ");
            string password = MpAlgorithm.GenerateContent("Long Password", "strnÄ", key, 1, HashHMAC);

            Assert.AreEqual("YepiHedo1*Kada", password);
        }
        public void GenerateContentWithUmlautsAndCounterTest()
        {
            var    key      = MpAlgorithm.GetKeyForPassword("uÜ", "testÖ");
            string password = MpAlgorithm.GenerateContent("Long Password", "strnÄ", key, 42, HashHMAC);

            Assert.AreEqual("Gasc3!YeluMoqb", password);
        }
        public void GenerateContentTest()
        {
            var    key      = MpAlgorithm.GetKeyForPassword("u", "test");
            string password = MpAlgorithm.GenerateContent("Long Password", "strn", key, 1, HashHMAC);

            Assert.AreEqual("LapdKebv2_Tele", password);
        }
示例#4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            /*_ioConnectionInfo = new IOConnectionInfo() { Path = "/mnt/sdcard/keepass/keechallenge.xml" };
             * _ioConnectionInfoOut = new IOConnectionInfo() { Path = "/mnt/sdcard/keepass/keechallengeOut.xml" };
             */

            FindViewById <Button>(Resource.Id.MyButton1).Text = "";
            Stopwatch sw = new Stopwatch();

            sw.Start();
            var key = new MpAlgorithm().GetKeyForPassword("u", "test");

            sw.Stop();
            string password = MpAlgorithm.GenerateContent("Long Password", "strn", key, 1, HashHMAC);

            FindViewById <Button>(Resource.Id.MyButton1).Text = password;
            FindViewById <Button>(Resource.Id.MyButton2).Text = sw.ElapsedMilliseconds.ToString();


            // Get our button from the layout resource,
            // and attach an event to it
            FindViewById <Button>(Resource.Id.MyButton1).Click += (sender, args) =>
            {
                //	Decrypt(_ioConnectionInfo);
            };
            FindViewById <Button>(Resource.Id.MyButton2).Click += (sender, args) =>
            {
                //Decrypt(_ioConnectionInfoOut);
            };


            FindViewById <Button>(Resource.Id.MyButton3).Click += (sender, args) => StartActivityForResult(typeof(PrefActivity), 1);
        }