예제 #1
0
        private void DecryptFile(string p_input)
        {
            Spartacus.Utils.Cryptor v_cryptor;
            string v_output;

            try
            {
                Console.Write("Type the password to decrypt the file: ");
                v_cryptor = new Spartacus.Utils.Cryptor(Console.ReadLine());

                if (p_input.EndsWith(".crypt"))
                {
                    v_output = p_input.Replace(".crypt", "");
                }
                else
                {
                    v_output = p_input + ".decrypt";
                }

                v_cryptor.DecryptFile(p_input, v_output);

                Console.WriteLine();
                Console.WriteLine("File {0} successfully decrypted to the file {1}.", p_input, v_output);
            }
            catch (Spartacus.Utils.Exception e)
            {
                Console.WriteLine(e.v_message);
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
예제 #2
0
        private void DecryptFile(string p_input, string p_output)
        {
            Spartacus.Utils.Cryptor v_cryptor;

            try
            {
                Console.Write("Type the password to decrypt the file: ");
                v_cryptor = new Spartacus.Utils.Cryptor(Console.ReadLine());

                v_cryptor.DecryptFile(p_input, p_output);

                Console.WriteLine();
                Console.WriteLine("File {0} successfully decrypted to the file {1}.", p_input, p_output);
            }
            catch (Spartacus.Utils.Exception e)
            {
                Console.WriteLine(e.v_message);
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }