Author: alanmc
Date: 2006-09-10 08:04:27 -0400 (Sun, 10 Sep 2006)
New Revision: 65160

Added:
   branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/IEncryptor.cs
   branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/NoEncryption.cs
   
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4FullEncryption.cs
   
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4HeaderEncryption.cs
Log:
Structure for encryption classes and interface now finalised.

Added: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/IEncryptor.cs
===================================================================
--- branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/IEncryptor.cs  
2006-09-10 12:03:51 UTC (rev 65159)
+++ branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/IEncryptor.cs  
2006-09-10 12:04:27 UTC (rev 65160)
@@ -0,0 +1,44 @@
+//
+// IEncryptor.cs
+//
+// Authors:
+//   Alan McGovern [EMAIL PROTECTED]
+//
+// Copyright (C) 2006 Alan McGovern
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MonoTorrent.Client.Encryption
+{
+    public interface IEncryptor
+    {
+        void Encrypt(byte[] buffer, int offset, int count);
+
+        
+        void Decrypt(byte[] buffer, int offset, int count);
+    }
+}


Property changes on: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/IEncryptor.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/NoEncryption.cs
===================================================================
--- 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/NoEncryption.cs    
    2006-09-10 12:03:51 UTC (rev 65159)
+++ 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/NoEncryption.cs    
    2006-09-10 12:04:27 UTC (rev 65160)
@@ -0,0 +1,56 @@
+//
+// NoEncryption.cs
+//
+// Authors:
+//   Alan McGovern [EMAIL PROTECTED]
+//
+// Copyright (C) 2006 Alan McGovern
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Net;
+
+namespace MonoTorrent.Client.Encryption
+{
+    internal class NoEncryption : IEncryptor
+    {
+        public NoEncryption()
+        {
+        }
+
+
+        public void Encrypt(byte[] buffer, int offset, int count)
+        {
+            return;
+        }
+
+
+        public void Decrypt(byte[] buffer, int offset, int count)
+        {
+            return;
+        }
+    }
+}
\ No newline at end of file


Property changes on: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/NoEncryption.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4FullEncryption.cs
===================================================================
--- 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4FullEncryption.cs
   2006-09-10 12:03:51 UTC (rev 65159)
+++ 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4FullEncryption.cs
   2006-09-10 12:04:27 UTC (rev 65160)
@@ -0,0 +1,62 @@
+//
+// RC4FullEncryption.cs
+//
+// Authors:
+//   Alan McGovern [EMAIL PROTECTED]
+//
+// Copyright (C) 2006 Alan McGovern
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Net;
+using System.Security.Cryptography;
+
+namespace MonoTorrent.Client.Encryption
+{
+    internal class RC4FullEncryption : IEncryptor
+    {
+        private ICryptoTransform encryptor;
+        private ICryptoTransform decryptor;
+        private Mono.Security.Cryptography.RC4 rc4;
+
+        public RC4FullEncryption()
+        {
+            this.rc4 = Mono.Security.Cryptography.RC4.Create();
+            this.encryptor = rc4.CreateEncryptor();
+            this.decryptor = rc4.CreateDecryptor();
+        }
+
+        public void Encrypt(byte[] buffer, int offset, int count)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void Decrypt(byte[] buffer, int offset, int count)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
\ No newline at end of file


Property changes on: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4FullEncryption.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4HeaderEncryption.cs
===================================================================
--- 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4HeaderEncryption.cs
 2006-09-10 12:03:51 UTC (rev 65159)
+++ 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4HeaderEncryption.cs
 2006-09-10 12:04:27 UTC (rev 65160)
@@ -0,0 +1,64 @@
+//
+// RC4HeaderEncryption.cs
+//
+// Authors:
+//   Alan McGovern [EMAIL PROTECTED]
+//
+// Copyright (C) 2006 Alan McGovern
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Net;
+using System.Security.Cryptography;
+
+namespace MonoTorrent.Client.Encryption
+{
+    internal class RC4HeaderEncryption : IEncryptor
+    {
+        private ICryptoTransform encryptor;
+        private ICryptoTransform decryptor;
+        private Mono.Security.Cryptography.RC4 rc4;
+     
+        public RC4HeaderEncryption()
+        {
+            this.rc4 = Mono.Security.Cryptography.RC4.Create();
+            this.encryptor = rc4.CreateEncryptor();
+            this.decryptor = rc4.CreateDecryptor();
+        }
+
+
+        public void Encrypt(byte[] buffer, int offset, int count)
+        {
+            throw new NotImplementedException();
+        }
+
+
+        public void Decrypt(byte[] buffer, int offset, int count)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
\ No newline at end of file


Property changes on: 
branches/BitSharp/bitsharp/src/MonoTorrent.Client/Encryption/RC4HeaderEncryption.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to