FAES/FAES_File.cs
/// <summary>
/// Runs the appropriate action (Encrypt/Decrypt)
/// </summary>
/// <param name="success">Output of if the action was successful</param>
Runs the appropriate action (Encrypt/Decrypt)
Runs the appropriate action ( Encrypt / Decrypt )
[Obsolete("This method of automatically encrypting/decrypting a FAES_File is deprecated. Please use FAES_Encrypt/FAES_Decrypt.")]
        public void Run(ref bool success)
        {
            if (!String.IsNullOrEmpty(_password))
            {
                if (isFileEncryptable())
                {
                    Logging.Log($"Encrypting '{_filePath}'...");
                    FileAES_Encrypt encrypt = new FileAES_Encrypt(new FAES_File(_filePath), _password, _passwordHint);
                    success = encrypt.encryptFile();
                }
                else if (isFileDecryptable())
                {
                    Logging.Log($"Decrypting '{_filePath}'...");
                    FileAES_Decrypt decrypt = new FileAES_Decrypt(new FAES_File(_filePath), _password);
                    success = decrypt.decryptFile();
                }
                else
                {
                    throw new Exception("The file/folder specified is not valid!");
                }
            }
            else throw new Exception("A password has not been set!");
        }
[ Obsolete ( " " ) ] public void Run ( ref bool success ) { if ( ! String . IsNullOrEmpty ( _password ) ) { if ( isFileEncryptable ( ) ) { Logging . Log ( $" Encrypting ' { _filePath } '... " ) ; FileAES_Encrypt encrypt = new FileAES_Encrypt ( new FAES_File ( _filePath ) , _password , _passwordHint ) ; success = encrypt . encryptFile ( ) ; } else if ( isFileDecryptable ( ) ) { Logging . Log ( $" Decrypting ' { _filePath } '... " ) ; FileAES_Decrypt decrypt = new FileAES_Decrypt ( new FAES_File ( _filePath ) , _password ) ; success = decrypt . decryptFile ( ) ; } else { throw new Exception ( " " ) ; } } else throw new Exception ( " " ) ; }
Runs the appropriate action (Encrypt/Decrypt)
Runs the appropriate action ( Encrypt / Decrypt )
bool
ref
success
Output of if the action was successful
Output of if the action was successful