Exemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                string fileToEncrypt = @"C: \Users\Zsombor\Documents\Visual Studio 2015\Projects\LicenceHandler\docs\LICENSE";
                string fileToDecrypt = @"C:\Users\Zsombor\Documents\Visual Studio 2015\Projects\LicenceHandler\Encrypt\LICENSE.enc";
                string key = "palmon";

                RSAProvider rsap = new RSAProvider(key);
               rsap.encryptUsingPublicKey(fileToEncrypt);
               rsap.decryptFileUsingPrivateKey(fileToDecrypt, "palmon");
            }
            catch(Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                string fileToEncrypt = @"C: \Users\Zsombor\Documents\Visual Studio 2015\Projects\LicenceHandler\docs\LICENSE";
                string fileToDecrypt = @"C:\Users\Zsombor\Documents\Visual Studio 2015\Projects\LicenceHandler\Encrypt\LICENSE.enc";
                string key           = "palmon";


                RSAProvider rsap = new RSAProvider(key);
                rsap.encryptUsingPublicKey(fileToEncrypt);
                rsap.decryptFileUsingPrivateKey(fileToDecrypt, "palmon");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }