Esempio n. 1
0
        static string encrypt(string input)
        {
            string key = Setting.userPassword;

            AESservice  aes         = new AESservice(xSalt, xAesIv);
            CryptObject cryptObject = aes.encrypt(input, key);
            string      output      = cryptObject.value;

            return(output);
        }
Esempio n. 2
0
        void encrypt()
        {
            string plainText = getInput(textBox1);
            string password  = getInput(textBox2);

            AESservice aesService = getAESsettings();

            CryptObject cryptObject = aesService.encrypt(plainText, password);

            string output = cryptObject.value;

            if (cryptObject.operationSuccess)
            {
                printOutput(output);
                autoSign();
            }
            else
            {
                MessageBox.Show(output, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }