source: trunk/CrypPluginBase/Control/IControlEncryption.cs @ 1162

Last change on this file since 1162 was 1162, checked in by Arno Wacker, 12 years ago

KeySearcher:

  • Removed creation of CryptoolStream for each trial key -> performance boost
  • Re-integrated the usage of only the partial encrypted message for trial decryption (byteToUse). Now the value set in the costFunction will determine how many bytes will be used. This value shall be moved in the future to the KeySearcher settings.

IControlEncryption

  • Added an extended method for Decrypt to IControlEncryption for usage with bytesToUse

AES/DES/SDES

  • Updated for compatibility with IControlEncryption-changes (the new parameter is also used by all three)

Samples

  • Updated KeySearcher-Sample-DES to use only 128 bytes for bruteforcing instead of 256 (increase performance a little)

Note: providing a value for bytesToUse smaller than the blocksize of the algorithm used is an error case - not sure if every case is already covered.

File size: 1.3 KB
Line 
1/*
2   Copyright 2009 Thomas Schmid
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21
22namespace Cryptool.PluginBase.Control
23{
24    public interface IControlEncryption : IControl, IDisposable
25    {
26        byte[] Encrypt(byte[] key, int blocksize);
27        byte[] Decrypt(byte[] ciphertext, byte[] key, int bytesToUse);
28        byte[] Decrypt(byte[] ciphertext, byte[] key);
29        string getKeyPattern();
30        byte[] getKeyFromString(string key, ref int[] arrayPointers, ref int[] arraySuccessors, ref int[] arrayUppers);
31        void changeSettings(string setting, object value);
32        IControlEncryption clone();
33        event KeyPatternChanged keyPatternChanged;
34    }
35}
Note: See TracBrowser for help on using the repository browser.