文書の過去の版を表示しています。


XOR

xortools

Single-byte XOR

  • key: 0xBC
from xortools import single_byte_xor
in_buf = open('test.txt', 'rb').read()
out_buf = open('test-xor.txt', 'wb')
out_buf.write(single_byte_xor(in_buf, 0xBC))
out_buf.close()

Four-byte XOR

  • key: 0x12345678
from xortools import four_byte_xor
in_buf = open('test.txt', 'rb').read()
out_buf = open('test-xor.txt', 'wb')
out_buf.write(four_byte_xor(in_buf, 0x12345678))
out_buf.close()

XORSearch

# ./XORSearch.exe key.zip.enc key.txt                                                                                         
Found XOR AB position 001E: key.txt.A.
Found XOR AB position 0075: key.txtPK..
#
Usage: XORSearch [-siuh] [-l length] [-n length] [-f search-file] file string
XORSearch V1.6, search for a XOR, ROL or ROT encoded string in a file
Use -s to save the XOR, ROL or ROT encoded file containing the string
Use -l length to limit the number of printed characters (50 by default)
Use -i to ignore the case when searching
Use -u to search for Unicode strings (limited support)
Use -f to provide a file with search strings
Use -n length to print the length neighbouring charaters (before & after the found keyword)
Use -h to search for hex strings
Options -l and -n are mutually exclusive
Options -u and -h are mutually exclusive
Source code put in the public domain by Didier Stevens, no Copyright
Use at your own risk
https://DidierStevens.com
crypt/xor.1329538951.txt.gz · 最終更新: 2012/02/18 04:22 by kikuzou
 
特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki