source: trunk/EraserDll/Pass.cpp @ 4

Revision 4, 4.2 KB checked in by lowjoel, 7 years ago (diff)

Added the source files from EraserDll? (SVN migration commit 2)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1// Pass.cpp
2// Definitions for built-in wipe methods
3//
4// Eraser. Secure data removal. For Windows.
5// Copyright © 1997-2001  Sami Tolvanen (sami@tolvanen.com).
6//
7// This program is free software; you can redistribute it and/or
8// modify it under the terms of the GNU General Public License
9// as published by the Free Software Foundation; either version 2
10// of the License, or (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20// 02111-1307, USA.
21
22#define PASS_CPP
23
24#include "stdafx.h"
25#include "EraserDll.h"
26
27///////////////////////////////////////////////////////////////////////////////
28// include here the header files for all built-in methods
29#include "Gutmann.h"
30#include "DoD.h"
31#include "RND.h"
32#include "Custom.h"
33#include "FirstLast2kb.h"
34#include "Schneier7pass.h"
35
36///////////////////////////////////////////////////////////////////////////////
37// pass arrays
38const PASS passGutmann[PASSES_GUTMANN] = {
39    passRandom,                        // 1
40    passRandom,
41    passRandom,
42    passRandom,
43    passOne(0x55),                     // 5
44    passOne(0xAA),
45    passThree(0x92, 0x49, 0x24),
46    passThree(0x49, 0x24, 0x92),
47    passThree(0x24, 0x92, 0x49),
48    passOne(0x00),                     // 10
49    passOne(0x11),
50    passOne(0x22),
51    passOne(0x33),
52    passOne(0x44),
53    passOne(0x55),                     // 15
54    passOne(0x66),
55    passOne(0x77),
56    passOne(0x88),
57    passOne(0x99),
58    passOne(0xAA),                     // 20
59    passOne(0xBB),
60    passOne(0xCC),
61    passOne(0xDD),
62    passOne(0xEE),
63    passOne(0xFF),                     // 25
64    passThree(0x92, 0x49, 0x24),
65    passThree(0x49, 0x24, 0x92),
66    passThree(0x24, 0x92, 0x49),
67    passThree(0x6D, 0xB6, 0xDB),
68    passThree(0xB6, 0xDB, 0x6D),       // 30
69    passThree(0xDB, 0x6D, 0xB6),
70    passRandom,
71    passRandom,
72    passRandom,
73    passRandom                         // 35
74};
75
76const PASS passDOD[PASSES_DOD] = {
77    passOne(0x55),                     // E (replaced with a random character)
78    passOne(0xAA),
79    passRandom,
80    passOne(0x00),                     // C (replaced with a random character)
81    passOne(0x55),                     // E (replaced with a random character)
82    passOne(0xAA),
83    passRandom
84};
85
86const PASS passDOD_E[PASSES_DOD_E] = {
87    passOne(0x00),                     // E
88    passOne(0xFF),
89    passRandom
90};
91
92///////////////////////////////////////////////////////////////////////////////
93// the array of built-in methods (add #defines to Pass.h)
94const BMETHOD bmMethods[nBuiltinMethods] = {
95    bmEntry(GUTMANN_METHOD_ID,       // REQUIRED: ID
96            "Gutmann",               // REQUIRED: Description (max. 80 chars)
97            PASSES_GUTMANN,          // REQUIRED: Passes
98            wipeFileWithGutmann,     // REQUIRED: Wipe function
99            1,                       // OPTIONAL: Shuffle passes (depends on wipe function)
100            passGutmann),            // OPTIONAL: Pointer to pass array (depends on wipe function)
101
102    bmEntry(DOD_METHOD_ID,
103            "US DoD 5220.22-M (8-306. / E, C and E)",
104            PASSES_DOD,
105            wipeFileWithDoD,
106            0,
107            passDOD),
108
109    bmEntry(DOD_E_METHOD_ID,
110            "US DoD 5220.22-M (8-306. / E)",
111            PASSES_DOD_E,
112            wipeFileWithCustom,     // There's no need to write yet another wipe function...
113            0,
114            passDOD_E),
115
116    bmEntry(RANDOM_METHOD_ID,
117            "Pseudorandom Data",
118            PASSES_RND,
119            wipeFileWithPseudoRandom,
120            0,
121            0),
122
123    bmEntry(FL2KB_METHOD_ID,
124            "Only first and last 2KB",
125            PASSES_FL2KB,
126            wipeFileWithFirstLast2kb,
127            0,
128            0),
129
130    bmEntry(SCHNEIER_METHOD_ID,
131            "Schneier's 7 pass",
132            PASSES_SCHNEIER,
133            wipeFileWithSchneier7Pass,
134            0,
135            0)         
136
137};
138const BMETHOD* GetBMethods() 
139{
140    return &bmMethods[0];
141}
Note: See TracBrowser for help on using the repository browser.