source: trunk/eraser6/Eraser.DefaultPlugins/ErasureMethods/USArmyAR380_19.cs @ 1360

Revision 1360, 1.8 KB checked in by lowjoel, 4 years ago (diff)

Eraser's still under development, so update the copyright notice.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1/*
2 * $Id$
3 * Copyright 2008-2009 The Eraser Project
4 * Original Author: Joel Low <lowjoel@users.sourceforge.net>
5 * Modified By:
6 *
7 * The algorithm in this file is implemented using the description in EMIShredder
8 * (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 Eraser.Manager;
29using Eraser.Util;
30
31namespace Eraser.DefaultPlugins
32{
33    sealed class USArmyAR380_19 : PassBasedErasureMethod
34    {
35        public override string Name
36        {
37            get { return S._("US Army AR380-19"); }
38        }
39
40        public override Guid Guid
41        {
42            get { return new Guid("{0FE620EA-8055-4861-B5BB-BD8BDC3FD4AC}"); }
43        }
44
45        protected override bool RandomizePasses
46        {
47            get { return false; }
48        }
49
50        protected override ErasureMethodPass[] PassesSet
51        {
52            get
53            {
54                Prng prng = PrngManager.GetInstance(ManagerLibrary.Settings.ActivePrng);
55                int rand = prng.Next();
56
57                return new ErasureMethodPass[]
58                {
59                    new ErasureMethodPass(WriteRandom, null),
60                    new ErasureMethodPass(WriteConstant, new byte[] { (byte)(rand & 0xFF) }),
61                    new ErasureMethodPass(WriteConstant, new byte[] { (byte)~(rand & 0xFF) })
62                };
63            }
64        }
65    }
66}
Note: See TracBrowser for help on using the repository browser.