Changeset 677 for trunk/CrypPlugins/DES


Ignore:
Timestamp:
Oct 7, 2009, 4:49:16 PM (12 years ago)
Author:
Sven Rech
Message:

some KeySearcher updates (but still doesn't really work)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/DES/DES.cs

    r676 r677  
    376376    public class DESControl : IControlEncryption
    377377    {
     378        public event KeyPatternChanged keyPatternChanged;
    378379        private DES plugin;
    379380
     
    399400        public string getKeyPattern()
    400401        {
    401             return "not implemented yet";
     402            return "[0-9A-F][0-9A-F]-[0-9A-F][0-9A-F]-[0-9A-F][0-9A-F]-[0-9A-F][0-9A-F]-"
     403                +"[0-9A-F][0-9A-F]-[0-9A-F][0-9A-F]-[0-9A-F][0-9A-F]-[0-9A-F][0-9A-F]";
    402404        }
    403405
    404406        public byte[] getKeyFromString(string key)
    405407        {
    406             return null;
     408            byte[] bkey = new byte[8];
     409            for (int i = 0; i < 7; i++)
     410            {
     411                bkey[i] = Convert.ToByte(key.Substring(i * 3, 2), 16);               
     412            }
     413            return bkey;
    407414        }
    408415
Note: See TracChangeset for help on using the changeset viewer.