Esempio n. 1
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            this.decText.Text = "";

            InitializeEncryptionEngine();

            if (xe.IsHashAlgorithm)
            {
                this.btnDecrypt.Enabled = false;
            }
            else if (xe.IsSymmetricAlgorithm)
            {
                this.btnDecrypt.Enabled = true;
            }

            xe.Key            = this.keyText.Text;
            this.encText.Text = xe.Encrypt(this.srcText.Text);

            ToggleStateOfButtons();

            if (chkClipPaste.Checked)
            {
                Clipboard.SetData(DataFormats.Text, this.encText.Text);
            }
        }
Esempio n. 2
0
        public bool Test()
        {
            string teststring = "I am a test string";

            //byte[] m_myArr;
            m_myEncrypter = new XCryptEngine(XCryptEngine.AlgorithmType.BlowFish);
            try{
                m_myWriter = new StreamWriter("bgame.conf");
                for (int w = 0; w < 10; w++)
                {
                    m_myWriter.WriteLine(m_myEncrypter.Encrypt(teststring, "bdbgame"));
                }
            }
            catch (Exception e) {
                new genericDialogs().ShowErrorBox(e.ToString());
                return(false);
            }
            return(true);
        }