source: branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/RNGCrypto.cs @ 2459

Revision 2459, 1.5 KB checked in by lowjoel, 2 years ago (diff)

Woops, we do need to declare override since we are going to be inherited from a PrngBase? class (which will be committed later)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
RevLine 
[1359]1/*
2 * $Id$
[1675]3 * Copyright 2008-2010 The Eraser Project
[1359]4 * Original Author: Joel Low <lowjoel@users.sourceforge.net>
5 * Modified By:
6 *
7 * This file is part of Eraser.
8 *
9 * Eraser is free software: you can redistribute it and/or modify it under the
10 * terms of the GNU General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option) any later
12 * version.
13 *
14 * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY
15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 *
18 * A copy of the GNU General Public License can be found at
19 * <http://www.gnu.org/licenses/>.
20 */
21
22using System;
23using System.Collections.Generic;
24using System.Text;
[2368]25
[1359]26using System.Runtime.InteropServices;
[2368]27using System.Security.Cryptography;
[1359]28
29using Eraser.Util;
[2368]30using Eraser.Plugins;
31using Eraser.Plugins.ExtensionPoints;
[1359]32
33namespace Eraser.DefaultPlugins
34{
35    [Guid("6BF35B8E-F37F-476e-B6B2-9994A92C3B0C")]
[2459]36    class RngCrypto : PrngBase
[1359]37    {
[2459]38        public override string Name
[1359]39        {
40            get { return S._("RNGCryptoServiceProvider"); }
41        }
42
[2459]43        public override Guid Guid
[1359]44        {
[1802]45            get { return GetType().GUID; }
[1359]46        }
47
[2459]48        public override void NextBytes(byte[] buffer)
[1359]49        {
50            rand.GetBytes(buffer);
51        }
52
[2459]53        protected override void Reseed(byte[] seed)
[1359]54        {
55            //No-op. RNGCryptoServiceProviders can't be reseeded.
56        }
57
58        RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
59    }
60}
Note: See TracBrowser for help on using the repository browser.