| 1 | /* |
|---|
| 2 | * $Id$ |
|---|
| 3 | * Copyright 2008-2010 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 | |
|---|
| 22 | using System; |
|---|
| 23 | using System.Collections.Generic; |
|---|
| 24 | using System.Text; |
|---|
| 25 | using System.Windows.Forms; |
|---|
| 26 | |
|---|
| 27 | using Eraser.Plugins; |
|---|
| 28 | using Eraser.Util; |
|---|
| 29 | |
|---|
| 30 | namespace Eraser.DefaultPlugins |
|---|
| 31 | { |
|---|
| 32 | public sealed class DefaultPlugin : IPlugin |
|---|
| 33 | { |
|---|
| 34 | public void Initialize(Host host) |
|---|
| 35 | { |
|---|
| 36 | Settings = new DefaultPluginSettings(); |
|---|
| 37 | |
|---|
| 38 | //Then register the erasure methods et al. |
|---|
| 39 | host.ErasureMethods.Add(new Gutmann()); //35 passes |
|---|
| 40 | host.ErasureMethods.Add(new DoD_EcE()); //7 passes |
|---|
| 41 | host.ErasureMethods.Add(new RCMP_TSSIT_OPS_II()); //7 passes |
|---|
| 42 | host.ErasureMethods.Add(new Schneier()); //7 passes |
|---|
| 43 | host.ErasureMethods.Add(new VSITR()); //7 passes |
|---|
| 44 | host.ErasureMethods.Add(new DoD_E()); //3 passes |
|---|
| 45 | host.ErasureMethods.Add(new HMGIS5Enhanced()); //3 passes |
|---|
| 46 | host.ErasureMethods.Add(new USAF5020()); //3 passes |
|---|
| 47 | host.ErasureMethods.Add(new USArmyAR380_19()); //3 passes |
|---|
| 48 | host.ErasureMethods.Add(new GOSTP50739()); //2 passes |
|---|
| 49 | host.ErasureMethods.Add(new HMGIS5Baseline()); //1 pass |
|---|
| 50 | host.ErasureMethods.Add(new Pseudorandom()); //1 pass |
|---|
| 51 | EraseCustom.RegisterAll(); |
|---|
| 52 | host.ErasureMethods.Add(new FirstLast16KB()); |
|---|
| 53 | |
|---|
| 54 | host.Prngs.Add(new RngCrypto()); |
|---|
| 55 | |
|---|
| 56 | host.EntropySources.Add(new KernelEntropySource()); |
|---|
| 57 | |
|---|
| 58 | host.FileSystems.Add(new Fat12FileSystem()); |
|---|
| 59 | host.FileSystems.Add(new Fat16FileSystem()); |
|---|
| 60 | host.FileSystems.Add(new Fat32FileSystem()); |
|---|
| 61 | host.FileSystems.Add(new NtfsFileSystem()); |
|---|
| 62 | |
|---|
| 63 | host.ErasureTargetFactories.Add(new FileErasureTarget()); |
|---|
| 64 | host.ErasureTargetFactories.Add(new FolderErasureTarget()); |
|---|
| 65 | host.ErasureTargetFactories.Add(new RecycleBinErasureTarget()); |
|---|
| 66 | host.ErasureTargetFactories.Add(new UnusedSpaceErasureTarget()); |
|---|
| 67 | host.ErasureTargetFactories.Add(new SecureMoveErasureTarget()); |
|---|
| 68 | host.ErasureTargetFactories.Add(new DriveErasureTarget()); |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | public void Dispose() |
|---|
| 72 | { |
|---|
| 73 | GC.SuppressFinalize(this); |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | public string Name |
|---|
| 77 | { |
|---|
| 78 | get { return S._("Default Erasure Methods and PRNGs"); } |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | public string Author |
|---|
| 82 | { |
|---|
| 83 | get { return S._("The Eraser Project <eraser-development@lists.sourceforge.net>"); } |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | public bool Configurable |
|---|
| 87 | { |
|---|
| 88 | get { return true; } |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | public void DisplaySettings(Control parent) |
|---|
| 92 | { |
|---|
| 93 | SettingsForm form = new SettingsForm(); |
|---|
| 94 | form.ShowDialog(); |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | /// <summary> |
|---|
| 98 | /// The dictionary holding settings for this plugin. |
|---|
| 99 | /// </summary> |
|---|
| 100 | internal static DefaultPluginSettings Settings; |
|---|
| 101 | } |
|---|
| 102 | |
|---|
| 103 | /// <summary> |
|---|
| 104 | /// A concrete class to manage the settings for this plugin. |
|---|
| 105 | /// </summary> |
|---|
| 106 | internal class DefaultPluginSettings |
|---|
| 107 | { |
|---|
| 108 | public DefaultPluginSettings() |
|---|
| 109 | { |
|---|
| 110 | settings = Manager.ManagerLibrary.Instance.SettingsManager.ModuleSettings; |
|---|
| 111 | } |
|---|
| 112 | |
|---|
| 113 | /// <summary> |
|---|
| 114 | /// The First/last 16 kilobyte erasure method. |
|---|
| 115 | /// </summary> |
|---|
| 116 | public Guid FL16Method |
|---|
| 117 | { |
|---|
| 118 | get |
|---|
| 119 | { |
|---|
| 120 | return settings.GetValue<Guid>("FL16Method"); |
|---|
| 121 | } |
|---|
| 122 | set |
|---|
| 123 | { |
|---|
| 124 | settings.SetValue("FL16Method", value); |
|---|
| 125 | } |
|---|
| 126 | } |
|---|
| 127 | |
|---|
| 128 | /// <summary> |
|---|
| 129 | /// The set of custom erasure methods. |
|---|
| 130 | /// </summary> |
|---|
| 131 | public Dictionary<Guid, CustomErasureMethod> EraseCustom |
|---|
| 132 | { |
|---|
| 133 | get |
|---|
| 134 | { |
|---|
| 135 | return settings.GetValue<Dictionary<Guid, CustomErasureMethod>>("EraseCustom"); |
|---|
| 136 | } |
|---|
| 137 | set |
|---|
| 138 | { |
|---|
| 139 | settings.SetValue("EraseCustom", value); |
|---|
| 140 | } |
|---|
| 141 | } |
|---|
| 142 | |
|---|
| 143 | /// <summary> |
|---|
| 144 | /// The data store for our settings. |
|---|
| 145 | /// </summary> |
|---|
| 146 | Settings settings; |
|---|
| 147 | } |
|---|
| 148 | } |
|---|