| 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 | #include "stdafx.h" |
|---|
| 23 | #include "EraserDll.h" |
|---|
| 24 | |
|---|
| 25 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 26 | // include here the header files for all built-in methods |
|---|
| 27 | #include "Gutmann.h" |
|---|
| 28 | #include "DoD.h" |
|---|
| 29 | #include "RND.h" |
|---|
| 30 | #include "Custom.h" |
|---|
| 31 | #include "FirstLast2kb.h" |
|---|
| 32 | #include "Schneier7pass.h" |
|---|
| 33 | |
|---|
| 34 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 35 | // pass arrays |
|---|
| 36 | const PASS passGutmann[PASSES_GUTMANN] = { |
|---|
| 37 | passRandom, // 1 |
|---|
| 38 | passRandom, |
|---|
| 39 | passRandom, |
|---|
| 40 | passRandom, |
|---|
| 41 | passOne(0x55), // 5 |
|---|
| 42 | passOne(0xAA), |
|---|
| 43 | passThree(0x92, 0x49, 0x24), |
|---|
| 44 | passThree(0x49, 0x24, 0x92), |
|---|
| 45 | passThree(0x24, 0x92, 0x49), |
|---|
| 46 | passOne(0x00), // 10 |
|---|
| 47 | passOne(0x11), |
|---|
| 48 | passOne(0x22), |
|---|
| 49 | passOne(0x33), |
|---|
| 50 | passOne(0x44), |
|---|
| 51 | passOne(0x55), // 15 |
|---|
| 52 | passOne(0x66), |
|---|
| 53 | passOne(0x77), |
|---|
| 54 | passOne(0x88), |
|---|
| 55 | passOne(0x99), |
|---|
| 56 | passOne(0xAA), // 20 |
|---|
| 57 | passOne(0xBB), |
|---|
| 58 | passOne(0xCC), |
|---|
| 59 | passOne(0xDD), |
|---|
| 60 | passOne(0xEE), |
|---|
| 61 | passOne(0xFF), // 25 |
|---|
| 62 | passThree(0x92, 0x49, 0x24), |
|---|
| 63 | passThree(0x49, 0x24, 0x92), |
|---|
| 64 | passThree(0x24, 0x92, 0x49), |
|---|
| 65 | passThree(0x6D, 0xB6, 0xDB), |
|---|
| 66 | passThree(0xB6, 0xDB, 0x6D), // 30 |
|---|
| 67 | passThree(0xDB, 0x6D, 0xB6), |
|---|
| 68 | passRandom, |
|---|
| 69 | passRandom, |
|---|
| 70 | passRandom, |
|---|
| 71 | passRandom // 35 |
|---|
| 72 | }; |
|---|
| 73 | |
|---|
| 74 | const PASS passDOD[PASSES_DOD] = { |
|---|
| 75 | passOne(0x55), // E (replaced with a random character) |
|---|
| 76 | passOne(0xAA), |
|---|
| 77 | passRandom, |
|---|
| 78 | passOne(0x00), // C (replaced with a random character) |
|---|
| 79 | passOne(0x55), // E (replaced with a random character) |
|---|
| 80 | passOne(0xAA), |
|---|
| 81 | passRandom |
|---|
| 82 | }; |
|---|
| 83 | |
|---|
| 84 | const PASS passDOD_E[PASSES_DOD_E] = { |
|---|
| 85 | passOne(0x00), // E |
|---|
| 86 | passOne(0xFF), |
|---|
| 87 | passRandom |
|---|
| 88 | }; |
|---|
| 89 | |
|---|
| 90 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 91 | // the array of built-in methods (add #defines to Pass.h) |
|---|
| 92 | const BMETHOD bmMethods[nBuiltinMethods] = { |
|---|
| 93 | bmEntry(GUTMANN_METHOD_ID, // REQUIRED: ID |
|---|
| 94 | "Gutmann", // REQUIRED: Description (max. 80 chars) |
|---|
| 95 | PASSES_GUTMANN, // REQUIRED: Passes |
|---|
| 96 | wipeFileWithGutmann, // REQUIRED: Wipe function |
|---|
| 97 | 1, // OPTIONAL: Shuffle passes (depends on wipe function) |
|---|
| 98 | passGutmann), // OPTIONAL: Pointer to pass array (depends on wipe function) |
|---|
| 99 | |
|---|
| 100 | bmEntry(DOD_METHOD_ID, |
|---|
| 101 | "US DoD 5220.22-M (8-306. / E, C and E)", |
|---|
| 102 | PASSES_DOD, |
|---|
| 103 | wipeFileWithDoD, |
|---|
| 104 | 0, |
|---|
| 105 | passDOD), |
|---|
| 106 | |
|---|
| 107 | bmEntry(DOD_E_METHOD_ID, |
|---|
| 108 | "US DoD 5220.22-M (8-306. / E)", |
|---|
| 109 | PASSES_DOD_E, |
|---|
| 110 | wipeFileWithCustom, // There's no need to write yet another wipe function... |
|---|
| 111 | 0, |
|---|
| 112 | passDOD_E), |
|---|
| 113 | |
|---|
| 114 | bmEntry(RANDOM_METHOD_ID, |
|---|
| 115 | "Pseudorandom Data", |
|---|
| 116 | PASSES_RND, |
|---|
| 117 | wipeFileWithPseudoRandom, |
|---|
| 118 | 0, |
|---|
| 119 | 0), |
|---|
| 120 | |
|---|
| 121 | bmEntry(FL2KB_METHOD_ID, |
|---|
| 122 | "Only first and last 2KB", |
|---|
| 123 | PASSES_FL2KB, |
|---|
| 124 | wipeFileWithFirstLast2kb, |
|---|
| 125 | 0, |
|---|
| 126 | 0), |
|---|
| 127 | |
|---|
| 128 | bmEntry(SCHNEIER_METHOD_ID, |
|---|
| 129 | "Schneier's 7 pass", |
|---|
| 130 | PASSES_SCHNEIER, |
|---|
| 131 | wipeFileWithSchneier7Pass, |
|---|
| 132 | 0, |
|---|
| 133 | 0) |
|---|
| 134 | |
|---|
| 135 | }; |
|---|
| 136 | const BMETHOD* GetBMethods() |
|---|
| 137 | { |
|---|
| 138 | return &bmMethods[0]; |
|---|
| 139 | } |
|---|