Ignore:
Timestamp:
Jan 19, 2010, 1:11:42 PM (12 years ago)
Author:
arnold
Message:

Buggy P2PManager/Worker classes - don't use at present!

Location:
trunk/CrypPlugins/KeySearcher_IControl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher_IControl/IControlKeySearcher.cs

    r971 r1090  
    3232        /// Initiates bruteforcing, but really starts not until all MasterControls had finished initializing.
    3333        /// </summary>
    34         /// <param name="pattern"></param>
    35         void StartBruteforcing(KeyPattern pattern);
     34        /// <param name="pattern">a valid KeyPattern to bruteforce</param>
     35        /// <param name="encryptedData">encryptedData which are necessary for encrypting and calculating a cost factor</param>
     36        /// <param name="initVector">initVector necessary in some kinds of cipher-block-mode</param>
     37        void StartBruteforcing(KeyPattern pattern, byte[] encryptedData, byte[] initVector);
    3638
    3739        void StopBruteforcing();
  • trunk/CrypPlugins/KeySearcher_IControl/KeySearcher_IControl.cs

    r980 r1090  
    4242        }
    4343
     44        //only change: mandatory = false!!!
     45        [PropertyInfo(Direction.InputData, "Encrypted Data", "Encrypted data out of an Encryption PlugIn", "", false, false, DisplayLevel.Beginner, QuickWatchFormat.Hex, "")]
     46        public override byte[] EncryptedData
     47        {
     48            get
     49            {
     50                return base.EncryptedData;
     51            }
     52            set
     53            {
     54                base.EncryptedData = value;
     55            }
     56        }
     57
     58        //only change: mandatory = false!!!
     59        [PropertyInfo(Direction.InputData, "Initialization Vector", "Initialization vector with which the data were encrypted", "",false,false, DisplayLevel.Beginner,QuickWatchFormat.Hex,"")]
     60        public override byte[] InitVector
     61        {
     62            get
     63            {
     64                return base.InitVector;
     65            }
     66            set
     67            {
     68                base.InitVector = value;
     69            }
     70        }
     71
    4472        #region IKeySearcherControl Members
    4573
     
    72100        public event IsReadyForExecution OnAllMasterControlsInitialized;
    73101
    74         protected override void onStatusChanged(IControl sender, bool readyForExecution)
    75         {
    76             this.ReadyForExec = readyForExecution;
    77             if (readyForExecution)
     102        public override void  Execute()
     103        {
     104            if(this.ControlMaster != null)
     105            {
    78106                if (OnAllMasterControlsInitialized != null)
    79107                    OnAllMasterControlsInitialized();
     108            }
    80109        }
    81110    }
     
    84113    {
    85114        private KeySearcher_IControl keySearcher;
     115
     116        #region for bruteforcing necessary data
    86117        private KeyPattern actualKeyPattern;
     118        private byte[] encryptedData;
     119        private byte[] initVector;
     120        #endregion
     121
    87122        /// <summary>
    88123        /// workaround: Flag which will be set, when the OnAllMasterControlsInitialized
     
    120155        }
    121156
    122         public void StartBruteforcing(KeyPattern pattern)
     157        public void StartBruteforcing(KeyPattern pattern, byte[] encryptedData, byte[] initVector)
    123158        {
    124159            // if not all MasterControls are initialized, store the actual
     
    128163                tryBruteforcingBeforeMastersInitialized = true;
    129164                this.actualKeyPattern = pattern;
     165                this.encryptedData = encryptedData;
     166                this.initVector = initVector;
    130167                return;
    131168            }
    132             Bruteforcing(pattern);
     169            Bruteforcing(pattern, encryptedData, initVector);
    133170        }
    134171
     
    143180            if (this.tryBruteforcingBeforeMastersInitialized)
    144181            {
    145                 Bruteforcing(actualKeyPattern);
    146                 actualKeyPattern = null;
     182                Bruteforcing(this.actualKeyPattern, this.encryptedData, this.initVector);
     183                this.actualKeyPattern = null;
     184                this.encryptedData = null;
     185                this.initVector = null;
     186
    147187                this.tryBruteforcingBeforeMastersInitialized = false;
    148188            }
    149189        }
    150190
    151         private void Bruteforcing(KeyPattern actualKeyPattern)
     191        private void Bruteforcing(KeyPattern actualKeyPattern, byte[] encryptedData, byte[] initVector)
    152192        {
    153193            //because the KeySearcher object uses this property instead of the parameters in some internal methods... Dirty implementation...
     
    156196            this.keySearcher.Pattern.WildcardKey = actualKeyPattern.WildcardKey;
    157197
    158             this.keySearcher.BruteforcePattern(actualKeyPattern, this.keySearcher.ControlMaster, this.keySearcher.CostMaster);
     198            //New stuff because of changing the IControl data flow - Arnie 2010.01.18
     199
     200            this.keySearcher.BruteforcePattern(actualKeyPattern, encryptedData, initVector, this.keySearcher.ControlMaster, this.keySearcher.CostMaster);
    159201        }
    160202
Note: See TracChangeset for help on using the changeset viewer.