source: trunk/eraser6/Eraser.DefaultPlugins/ErasureMethods/Gutmann.cs @ 1210

Revision 1210, 5.2 KB checked in by lowjoel, 5 years ago (diff)

Reshuffle the directory structure for Eraser.DefaultPlugins? as the files were becoming messy.

  • 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 * The Gutmann Lite algorithm in this file is implemented using the description
8 * in EMIShredder (http://www.codeplex.com/EMISecurityShredder)
9 *
10 * This file is part of Eraser.
11 *
12 * Eraser is free software: you can redistribute it and/or modify it under the
13 * terms of the GNU General Public License as published by the Free Software
14 * Foundation, either version 3 of the License, or (at your option) any later
15 * version.
16 *
17 * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY
18 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 *
21 * A copy of the GNU General Public License can be found at
22 * <http://www.gnu.org/licenses/>.
23 */
24
25using System;
26using System.Collections.Generic;
27using System.Text;
28using System.Runtime.InteropServices;
29
30using Eraser.Manager;
31using Eraser.Util;
32
33namespace Eraser.DefaultPlugins
34{
35    [DefaultFileErasure(1)]
36    [Guid("1407FC4E-FEFF-4375-B4FB-D7EFBB7E9922")]
37    sealed class Gutmann : PassBasedErasureMethod
38    {
39        public override string Name
40        {
41            get { return S._("Gutmann"); }
42        }
43
44        public override Guid Guid
45        {
46            get { return new Guid("{1407FC4E-FEFF-4375-B4FB-D7EFBB7E9922}"); }
47        }
48
49        protected override bool RandomizePasses
50        {
51            get { return true; }
52        }
53
54        protected override ErasureMethodPass[] PassesSet
55        {
56            get
57            {
58                return new ErasureMethodPass[]
59                {
60                    new ErasureMethodPass(WriteRandom, null),                                   // 1
61                    new ErasureMethodPass(WriteRandom, null),
62                    new ErasureMethodPass(WriteRandom, null),
63                    new ErasureMethodPass(WriteRandom, null),
64                    new ErasureMethodPass(WriteConstant, new byte[] {0x55}),                    // 5
65                    new ErasureMethodPass(WriteConstant, new byte[] {0xAA}),
66                    new ErasureMethodPass(WriteConstant, new byte[] {0x92, 0x49, 0x24}),
67                    new ErasureMethodPass(WriteConstant, new byte[] {0x49, 0x24, 0x92}),
68                    new ErasureMethodPass(WriteConstant, new byte[] {0x24, 0x92, 0x49}),
69                    new ErasureMethodPass(WriteConstant, new byte[] {0x00}),                    // 10
70                    new ErasureMethodPass(WriteConstant, new byte[] {0x11}),
71                    new ErasureMethodPass(WriteConstant, new byte[] {0x22}),
72                    new ErasureMethodPass(WriteConstant, new byte[] {0x33}),
73                    new ErasureMethodPass(WriteConstant, new byte[] {0x44}),
74                    new ErasureMethodPass(WriteConstant, new byte[] {0x55}),                    // 15
75                    new ErasureMethodPass(WriteConstant, new byte[] {0x66}),
76                    new ErasureMethodPass(WriteConstant, new byte[] {0x77}),
77                    new ErasureMethodPass(WriteConstant, new byte[] {0x88}),
78                    new ErasureMethodPass(WriteConstant, new byte[] {0x99}),
79                    new ErasureMethodPass(WriteConstant, new byte[] {0xAA}),                    // 20
80                    new ErasureMethodPass(WriteConstant, new byte[] {0xBB}),
81                    new ErasureMethodPass(WriteConstant, new byte[] {0xCC}),
82                    new ErasureMethodPass(WriteConstant, new byte[] {0xDD}),
83                    new ErasureMethodPass(WriteConstant, new byte[] {0xEE}),
84                    new ErasureMethodPass(WriteConstant, new byte[] {0xFF}),                    // 25
85                    new ErasureMethodPass(WriteConstant, new byte[] {0x92, 0x49, 0x24}),
86                    new ErasureMethodPass(WriteConstant, new byte[] {0x49, 0x24, 0x92}),
87                    new ErasureMethodPass(WriteConstant, new byte[] {0x24, 0x92, 0x49}),
88                    new ErasureMethodPass(WriteConstant, new byte[] {0x6D, 0xB6, 0xDB}),
89                    new ErasureMethodPass(WriteConstant, new byte[] {0xB6, 0xDB, 0x6D}),        // 30
90                    new ErasureMethodPass(WriteConstant, new byte[] {0xDB, 0x6D, 0xB6}),
91                    new ErasureMethodPass(WriteRandom, null),
92                    new ErasureMethodPass(WriteRandom, null),
93                    new ErasureMethodPass(WriteRandom, null),
94                    new ErasureMethodPass(WriteRandom, null)                                    // 35
95                };
96            }
97        }
98    }
99
100    sealed class GutmannLite : PassBasedErasureMethod
101    {
102        public override string Name
103        {
104            get { return S._("Gutmann Lite"); }
105        }
106
107        public override Guid Guid
108        {
109            get { return new Guid("{AE5EB764-41B0-4601-BDF2-326B5838D44A}"); }
110        }
111
112        protected override bool RandomizePasses
113        {
114            get { return false; }
115        }
116
117        protected override ErasureMethodPass[] PassesSet
118        {
119            get
120            {
121                return new ErasureMethodPass[]
122                {
123                    new ErasureMethodPass(WriteRandom, null),                               //Original pass 1
124                    new ErasureMethodPass(WriteConstant, new byte[] {0x55}),                    //Original pass 5
125                    new ErasureMethodPass(WriteConstant, new byte[] {0xAA}),                    //Original pass 6
126                    new ErasureMethodPass(WriteConstant, new byte[] {0x92, 0x49, 0x24}),        //Original pass 7
127                    new ErasureMethodPass(WriteConstant, new byte[] {0x49, 0x24, 0x92}),        //Original pass 8
128                    new ErasureMethodPass(WriteConstant, new byte[] {0x24, 0x92, 0x49}),        //Original pass 9
129                    new ErasureMethodPass(WriteConstant, new byte[] {0x4B}),
130                    new ErasureMethodPass(WriteConstant, new byte[] {0xB4}),
131                    new ErasureMethodPass(WriteConstant, new byte[] {0x00}),
132                    new ErasureMethodPass(WriteConstant, new byte[] {0x11}),
133                };
134            }
135        }
136    }
137}
Note: See TracBrowser for help on using the repository browser.