| 1 | /* |
|---|
| 2 | * $Id$ |
|---|
| 3 | * Copyright 2008-2021 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 | |
|---|
| 25 | using System; |
|---|
| 26 | using System.Collections.Generic; |
|---|
| 27 | using System.Text; |
|---|
| 28 | using System.Runtime.InteropServices; |
|---|
| 29 | |
|---|
| 30 | using Eraser.Util; |
|---|
| 31 | using Eraser.Plugins; |
|---|
| 32 | using Eraser.Plugins.ExtensionPoints; |
|---|
| 33 | |
|---|
| 34 | namespace Eraser.DefaultPlugins |
|---|
| 35 | { |
|---|
| 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 GetType().GUID; } |
|---|
| 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 | } |
|---|