2 // System.Security.Cryptography.RC2.cs
5 // Andrew Birkett (andy@nobugs.org)
6 // Sebastien Pouliot (sebastien@ximian.com)
8 // (C) 2004 Novell (http://www.novell.com)
13 namespace System.Security.Cryptography {
16 // a. IETF RFC2286: A Description of the RC2(r) Encryption Algorithm
17 // http://www.ietf.org/rfc/rfc2268.txt
19 public abstract class RC2 : SymmetricAlgorithm {
21 public static new RC2 Create ()
23 return Create ("System.Security.Cryptography.RC2");
26 public static new RC2 Create (string algName)
28 return (RC2) CryptoConfig.CreateFromName (algName);
31 protected int EffectiveKeySizeValue;
33 public virtual int EffectiveKeySize {
35 if (EffectiveKeySizeValue == 0)
38 return EffectiveKeySizeValue;
41 EffectiveKeySizeValue = value;
45 public override int KeySize {
46 get { return base.KeySize; }
49 EffectiveKeySizeValue = value;
57 FeedbackSizeValue = 64;
59 // The RFC allows keys of 1 to 128 bytes, but MS impl only supports
60 // 40 to 128 bits, sigh.
61 LegalKeySizesValue = new KeySizes [1];
62 LegalKeySizesValue [0] = new KeySizes (40, 128, 8);
64 LegalBlockSizesValue = new KeySizes [1];
65 LegalBlockSizesValue [0] = new KeySizes (64, 64, 0);