Changeset 28 for trunk/bin/bletchley-analyze
- Timestamp:
- 12/21/12 22:44:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/bletchley-analyze
r13 r28 29 29 30 30 31 parser = argparse.ArgumentParser(description='Analyzes samples of encrypted data in an attempt to decode samples to binary and identify patterns useful in cryptanalysis.') 31 parser = argparse.ArgumentParser( 32 description='Analyzes samples of encrypted data in an attempt to decode' 33 ' samples to binary and identify patterns useful in cryptanalysis.' 34 ' For more information, see: http://code.google.com/p/bletchley/wiki/Overview') 32 35 parser.add_argument('input_file', nargs='?', default=None, 33 help='File containing encrypted blobs to analyze, one per line. Omit to read from stdin.') 36 help='File containing encrypted blobs to analyze, one per' 37 ' line. Omit to read from stdin.') 34 38 parser.add_argument('-e', dest='encoding_chain', type=str, default=None, 35 help='Comma-separated sequence of formats used to encode the tokens, beginning with the last one applied. (default: auto-detect)') 39 help='Comma-separated sequence of formats used to encode' 40 ' the tokens, beginning with the last one applied. ' 41 '(default: auto-detect. Use "?" for a listing of supported encodings.)') 36 42 parser.add_argument('-b', dest='block_size', type=int, default=8, 37 43 help='The block size displayed and used in highlighting (default: 8)') … … 44 50 options = parser.parse_args() 45 51 52 if options.encoding_chain == '?': 53 print('\n\t'.join(['Supported encodings:']+blobtools.supportedEncodings())) 54 sys.exit(0) 55 46 56 input_file = sys.stdin 47 57 if options.input_file is not None: 48 58 input_file = file(options.input_file, 'rb') 49 50 59 51 60 blobs = input_file.read().rstrip('\n').replace('\r', '').split('\n')
Note: See TracChangeset
for help on using the changeset viewer.