2 // RC4.cs: RC4(tm) symmetric stream cipher
3 // RC4 is a trademark of RSA Security
6 // Sebastien Pouliot (spouliot@motus.com)
8 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
12 using System.Security.Cryptography;
14 namespace Mono.Security.Cryptography {
16 public abstract class RC4 : SymmetricAlgorithm {
18 private static KeySizes[] s_legalBlockSizes = {
19 new KeySizes (64, 64, 0)
22 private static KeySizes[] s_legalKeySizes = {
23 new KeySizes (40, 2048, 8)
30 FeedbackSizeValue = BlockSizeValue;
31 LegalBlockSizesValue = s_legalBlockSizes;
32 LegalKeySizesValue = s_legalKeySizes;
35 new static public RC4 Create()
37 return Create ("RC4");
40 new static public RC4 Create (string algName)
42 object o = CryptoConfig.CreateFromName (algName);
43 // in case machine.config isn't configured to use
44 // any RC4 implementation
46 o = new ARC4Managed ();