Ignore:
Timestamp:
Jun 24, 2010, 1:15:16 PM (11 years ago)
Author:
Paul Lelgemann
Message:

o Refactoring in CrypP2P
o AES: NullReference in AES-Plugin fixed
o Small fixes in KeySearcher, StorageKeyGenerator uses IV and truncates input data

File:
1 edited

Legend:

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

    r1674 r1698  
    1414            this.keySearcher = keySearcher;
    1515            this.settings = settings;
    16            
    1716        }
    1817
    1918        public String Generate()
    2019        {
     20            var bytesToUse = keySearcher.CostMaster.getBytesToUse();
    2121            var rawIdentifier = "P2PJOB";
    2222            rawIdentifier += settings.ChunkSize + settings.Key;
    2323            rawIdentifier += keySearcher.ControlMaster.GetType();
    2424            rawIdentifier += keySearcher.CostMaster.GetType();
    25             rawIdentifier += keySearcher.CostMaster.getBytesToUse();
     25            rawIdentifier += bytesToUse;
    2626            rawIdentifier += keySearcher.CostMaster.getRelationOperator();
    27             rawIdentifier += Encoding.ASCII.GetString(keySearcher.EncryptedData);
     27
     28            if (keySearcher.InitVector != null)
     29            {
     30                rawIdentifier += Encoding.ASCII.GetString(keySearcher.InitVector);
     31            }
     32
     33            var inputData = Encoding.ASCII.GetString(keySearcher.EncryptedData);
     34            if (inputData.Length > bytesToUse)
     35            {
     36                inputData = inputData.Substring(0, bytesToUse);
     37            }
     38
     39            rawIdentifier += inputData;
    2840
    2941            var hashAlgorithm = new SHA1CryptoServiceProvider();
Note: See TracChangeset for help on using the changeset viewer.