Ignore:
Timestamp:
Jun 26, 2010, 11:39:44 AM (11 years ago)
Author:
Paul Lelgemann
Message:

+ KeySearcher: display of aggregated linkmanager statistics
o KeySearcher: job identifier extended with sample decryption data to preserve decryption algorithm settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/P2P/Storage/StorageKeyGenerator.cs

    r1698 r1704  
    1818        public String Generate()
    1919        {
     20            // Add simple data
    2021            var bytesToUse = keySearcher.CostMaster.getBytesToUse();
    2122            var rawIdentifier = "P2PJOB";
     
    2627            rawIdentifier += keySearcher.CostMaster.getRelationOperator();
    2728
     29            // Add initialization vector when available
    2830            if (keySearcher.InitVector != null)
    2931            {
     
    3133            }
    3234
    33             var inputData = Encoding.ASCII.GetString(keySearcher.EncryptedData);
     35            // Add input data with the amount of used bytes
     36            var inputData = keySearcher.EncryptedData;
    3437            if (inputData.Length > bytesToUse)
    35             {
    36                 inputData = inputData.Substring(0, bytesToUse);
    37             }
     38                Array.Copy(inputData, inputData, bytesToUse);
    3839
    39             rawIdentifier += inputData;
     40            rawIdentifier += Encoding.ASCII.GetString(inputData);
     41
     42            // Add cost of input data to preserve cost master settings
     43            rawIdentifier += keySearcher.CostMaster.calculateCost(inputData);
     44
     45            // Add decrypted input data to preserve encryption settings
     46            var keyLength = keySearcher.Pattern.giveInputPattern().Length / 3;
     47            var decryptedData = keySearcher.ControlMaster.Decrypt(inputData, new byte[keyLength], new byte[8]);
     48            rawIdentifier += Encoding.ASCII.GetString(decryptedData);
    4049
    4150            var hashAlgorithm = new SHA1CryptoServiceProvider();
Note: See TracChangeset for help on using the changeset viewer.