📄 readme.txt
字号:
README FOR DES SEARCH ENGINE CONTROLLER SOFTWARE April 23, 1998Written 1998 by Cryptography Research (http://www.cryptography.com)for the Electronic Frontier Foundation (EFF). Placed in the publicdomain by Cryptography Research and EFF.This is unsupported free software. Use and distribute at your ownrisk. U.S. law may regulate the use and/or export of this program.Foreign laws may also apply.---------------------------------------------------------------------Section 1: Compiling the Programs.Compiling the programs should be easy. Using 32-bit Microsoft VisualC++ for Windows compile as shown below. For Borland C++ or othercompilers, replace "cl" with the compiler name (e.g., bcc). On a 16-bit DOS compiler with a large search array, the large memory model(Borland's "-ml" flag) is required or the system will run out ofmemory. > cl search.c keyblock.c chipio.c des.c > cl initsrch.c keyblock.c > cl autoconf.c chipio.c > cl testvec.c sim.c des.c---------------------------------------------------------------------Section 2: Auto-Configuring the Search Array.The auto-configuration program is an important part of the DESCracker. Because there are a large number of chips in the system, itis inevitable that a few fail. By automatically removing defectiveunits, it is not necessary to repair the system when failures dooccur.The program "autoconf.exe" will automatically identify theconfiguration of a search array. With the I/O port base address at210 hex, simply run the program with the command: > autoconf search.cfg -tNote that the "-t" flag performs register testing (recommended if thesearch system might contain defective chips that need to be avoided).If the I/O port is at an address other than 210, specify the address.The "-v" flag provides verbose output. For example: > autoconf search.cfg 210 -t -vWhen autoconf completes, it will print the total number of chips tothe screen and save the configuration information to theconfiguration file. The configuration can be edited (e.g., withgrep) to remove defective units not caught with autoconf.(Note that this first release does not implement search unit testing code except for the register tests.) ---------------------------------------------------------------------Section 3: Initializing a Search.The search parameters have to be specified before a key can be found.The program initsrch creates a "search context" file that containsthese search parameters and a list of the regions of keyspace thatremain to be searched.The search parameters can either be entered into initsrch orspecified on the command line. To enter them manually, run initsrchwith no parameters: > initsrchThe program will then prompt for the search context file. Pressenter for the default filename ("search.ctx").Next, the program will prompt for a search mode. Five modes are supported and are described in the following sections. K - Known plaintext E - ECB ASCII text C - CBC ASCII text B - Blaze challenge M - Manual parameter specification1. Known plaintext searchingThis is the simplest (and most common) mode of operation. If acomplete DES plaintext/ciphertext pair is known, this mode can beused to quickly search for the key. When prompted, enter theplaintext in hexadecimal form (e.g., "123456789ABCDEF0") and pressenter. Next, enter the ciphertext, also in hexadecimal. The programwill then create a search context file and exit.2. ECB ASCII text searchingIf your target message is known to be ASCII text and was encryptedusing DES ECB mode, enter two different ciphertexts. The programwill create the search context file and exit. The program isconfigured to include all letters ("a-z" and "A-Z"), numbers ("0-9"),and common punctuation (ASCII zero, tab, linefeed carriage return,space, and common punctuation (!"'(),-.^_). For other charactersets, use the manual parameter specification option.3. CBC ASCII text searchingIf your message is ASCII text and was encrypted using DES CBC mode,this option lets you specify an initialization vector and twociphertext messages. The CBC mode ASCII option uses the same ASCIItext characters as ECB ASCII.4. The Blaze challengeMatt Blaze's DES challenge involves searching for a key such that arepeated plaintext byte produces a repeated ciphertext byte. Thisoption will search for keys that meet the challenge. Simply specifythe desired repeated ciphertext byte.5. Manual parameter specificationThe manual parameter mode allows direct control over the searchparameters. The manual mode requires entering more data than theother modes; it is often easier to pipe input from a script file,e.g.: > initsrch < search.scrFirst, enter the plaintext vector. This is 64 hex digits long andspecifies the bytes that can appear in "valid" plaintexts. The mostsignificant bit of the left-hand digit specifies whether ASCII 255can appear, and the least significant bit of the last digit specifieswhether ASCII zero can appear. For example, the plaintext vector forthe ASCII text modes is: 0000000000000000000000000000000007FFFFFFC7FFFFFE8FFF738700002601Next, enter the initialization vector for the first DES, if any.This will be XORed onto the first plaintext before its validity ischecked.Next, enter the two ciphertexts (ciphertext 0 and ciphertext 1).These may be the same or different.Next, enter the plaintext byte mask. This sets bits that should beignored in the plaintext. For example, if the left-hand byte of theplaintext is unknown or can have any value, the plaintext byte maskwould be set to 80 (hex).Finally, enter the searchInfo byte. Bit 1 of this byte specifieswhether CBC mode should be used. If so, the first ciphertext will beXORed onto candidate plaintexts produced by decrypting the secondciphertext. Bit 2 of searchInfo specifies whether the extraXoroperation should be done. This operation XORs the right half of theplaintext onto the left half before it is checked. (For the Blazechallenge, the desired plaintext has a single byte repeated. TheextraXor operation will set the left half of the plaintext to zero ifthe plaintext is good. The plaintextByteMask can then be set to 0x0Fto ignore the right half and the plaintextVector has only the bit forASCII zero set.)5. The search context fileThe search context file contains a header, the search parameters, and2^24 bits corresponding to the unsearched key regions. The searchparameters are: plaintextVector (32 bytes), plaintextXorMask (8bytes), ciphertext0 (8 bytes), ciphertext1 (8 bytes),plaintextByteMask (1 byte), and searchInfo (1 byte). Each searchregion includes 2^32 keys. The first bit (the MSB of the first keyregion byte) corresponds to the keys 00000000000000 through000000FFFFFFFF, in 56-bit notation. (To produce the 56-bit form of a64-bit DES key, delete the eight parity bits.)---------------------------------------------------------------------Section 4: Running a Search.The most common way to run a search is to type: > search search.cfg search.ctx logfile -qThe "-q" flag requests quiet output, which prints less information tothe screen. The search.cfg file is produced by autoconf, andsearch.ctx is produced by initsrch. The logfile will contain a listof candidate keys encountered.If a search is stopped partway through, work done in partially-completed key regions is lost, but completed regions are noted in thesearch context file. Note that a complete search will produce arather large amount of data in the logfile. If hard disk space islimited, it may be desirable to stop the search occasionally (forexample, daily) to purge the logfile.---------------------------------------------------------------------Section 5: Porting to other platforms.When porting to other platforms, some code changes or additions maybe required. The following may not be found on all systems: stricmp: This is a case-insensitive strcmp found on many compilers. If it isn't present, you can either use strcmp (though commands will become case sensitive) or write one. SEEK_SET: A constant (equal to zero) used to tell fseek() to go to a fixed offset. Usually defined in stdio.h kbhit(void): Returns true if a key has been pressed. (Used to check for commands during searches.) getch(void): Reads a keystroke from the keyboard. inportb(unsigned portNum): Reads a byte from an I/O port. Used only by chipio.c. On other platforms, inportb may need to be emulated. (For Visual C++, inportb is implemented in chipio.c as inline assembly language.) outportb(int portNum, int value): Sends a byte to an I/O port. Used only by chipio.c. On other platforms, outportb may need to be emulated. (For Visual C++, outportb is implemented in chipio.c as inline assembly language.)---------------------------------------------------------------------Section 6: Final commentsAs this code goes to press, there was little opportunity for testingand the code has not undergone any of the assurance, code review, ortesting processes we normally use. When working on the code, youyou may find a few bugs. Feedback, as always, is appreciated.Paul Kocher, Josh Jaffe, and everyone else at Cryptography Researchwould like to thank John Gilmore and the EFF for funding this uniqueproject, and AWT for their expert hardware work!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -