Changeset 28 for trunk/bin/bletchley-encode
- Timestamp:
- 12/21/12 22:44:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/bletchley-encode
r20 r28 28 28 29 29 30 parser = argparse.ArgumentParser(description='A simple encoder script that is useful in shell scripts.') 31 parser.add_argument('input_file', nargs='?', default=None, 32 help='File containing encrypted blobs to analyze, one per line. Omit to read from stdin.') 33 parser.add_argument('-e', dest='encoding_chain', type=str, required=True, 34 help='Comma-separated sequence of encoding formats used to encode the token, starting with the last encoding to apply.') 30 parser = argparse.ArgumentParser( 31 description='A simple encoder script that is useful in shell scripts.' 32 ' For more information, see: http://code.google.com/p/bletchley/wiki/Overview') 33 parser.add_argument( 34 'input_file', nargs='?', default=None, 35 help='File containing encrypted blobs to analyze, one per line. ' 36 'Omit to read from stdin.') 37 parser.add_argument( 38 '-e', dest='encoding_chain', type=str, required=True, 39 help='Comma-separated sequence of encoding formats used to encode the' 40 ' token, starting with the last encoding to apply.' 41 ' (Use "?" for a listing of supported encodings.)') 35 42 options = parser.parse_args() 43 44 if options.encoding_chain == '?': 45 print('\n\t'.join(['Supported encodings:']+blobtools.supportedEncodings())) 46 sys.exit(0) 36 47 37 48 input_file = sys.stdin … … 43 54 specified_encodings = options.encoding_chain.split(',') 44 55 specified_encodings.reverse() 56 # XXX: report invalid encodings 45 57 sys.stdout.write(blobtools.encodeChain(specified_encodings, blob)) 58 sys.stdout.write('\n')
Note: See TracChangeset
for help on using the changeset viewer.