source: trunk/eraser6/Eraser.DefaultPlugins/Plugin.cs @ 1079

Revision 989, 3.8 KB checked in by lowjoel, 5 years ago (diff)

Removed ISAAC after consultation with Professor Ling San (see my rc5 announcement.)

  • Property svn:keywords set to Id
Line 
1/*
2 * $Id$
3 * Copyright 2008 The Eraser Project
4 * Original Author: Joel Low <lowjoel@users.sourceforge.net>
5 * Modified By:
6 *
7 * This file is part of Eraser.
8 *
9 * Eraser is free software: you can redistribute it and/or modify it under the
10 * terms of the GNU General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option) any later
12 * version.
13 *
14 * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY
15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 *
18 * A copy of the GNU General Public License can be found at
19 * <http://www.gnu.org/licenses/>.
20 */
21
22using System;
23using System.Collections.Generic;
24using System.Text;
25using System.Windows.Forms;
26
27using Eraser.Manager;
28using Eraser.Manager.Plugin;
29using Eraser.Util;
30
31namespace Eraser.DefaultPlugins
32{
33    public sealed class DefaultPlugin : IPlugin
34    {
35        public void Initialize(Host host)
36        {
37            Settings = new DefaultPluginSettings();
38
39            //Then register the erasure methods et al.
40            ErasureMethodManager.Register(new Gutmann());               //35 passes
41            ErasureMethodManager.Register(new GutmannLite());           //10 passes
42            ErasureMethodManager.Register(new DoD_EcE());               //7 passes
43            ErasureMethodManager.Register(new RCMP_TSSIT_OPS_II());     //7 passes
44            ErasureMethodManager.Register(new Schneier());              //7 passes
45            ErasureMethodManager.Register(new VSITR());                 //7 passes
46            ErasureMethodManager.Register(new DoD_E());                 //3 passes
47            ErasureMethodManager.Register(new HMGIS5Enhanced());        //3 passes
48            ErasureMethodManager.Register(new USAF5020());              //3 passes
49            ErasureMethodManager.Register(new USArmyAR380_19());        //3 passes
50            ErasureMethodManager.Register(new GOSTP50739());            //2 passes
51            ErasureMethodManager.Register(new HMGIS5Baseline());        //1 pass
52            ErasureMethodManager.Register(new Pseudorandom());          //1 pass
53            EraseCustom.RegisterAll();
54
55            PrngManager.Register(new RngCrypto());
56
57            //Done last
58            try
59            {
60                ErasureMethodManager.Register(new FirstLast16KB());
61            }
62            catch (Exception)
63            {
64            }
65        }
66
67        public void Dispose()
68        {
69            GC.SuppressFinalize(this);
70        }
71
72        public string Name
73        {
74            get { return S._("Default Erasure Methods and PRNGs"); }
75        }
76
77        public string Author
78        {
79            get { return S._("The Eraser Project <eraser-development@lists.sourceforge.net>"); }
80        }
81
82        public bool Configurable
83        {
84            get { return true; }
85        }
86
87        public void DisplaySettings(Control parent)
88        {
89            SettingsForm form = new SettingsForm();
90            form.ShowDialog();
91        }
92
93        /// <summary>
94        /// The dictionary holding settings for this plugin.
95        /// </summary>
96        internal static DefaultPluginSettings Settings;
97    }
98
99    /// <summary>
100    /// A concrete class to manage the settings for this plugin.
101    /// </summary>
102    internal class DefaultPluginSettings
103    {
104        public DefaultPluginSettings()
105        {
106            settings = Manager.ManagerLibrary.Instance.SettingsManager.ModuleSettings;
107        }
108
109        /// <summary>
110        /// The First/last 16 kilobyte erasure method.
111        /// </summary>
112        public Guid FL16Method
113        {
114            get
115            {
116                return settings["FL16Method"] == null ? Guid.Empty :
117                    (Guid)settings["FL16Method"];
118            }
119            set
120            {
121                settings["FL16Method"] = value;
122            }
123        }
124
125        /// <summary>
126        /// The set of custom erasure methods.
127        /// </summary>
128        public Dictionary<Guid, CustomErasureMethod> EraseCustom
129        {
130            get
131            {
132                return (Dictionary<Guid, CustomErasureMethod>)settings["EraseCustom"];
133            }
134            set
135            {
136                settings["EraseCustom"] = value;
137            }
138        }
139
140        /// <summary>
141        /// The data store for our settings.
142        /// </summary>
143        Settings settings;
144    }
145}
Note: See TracBrowser for help on using the repository browser.