p)(d Posted April 8, 2008 Share Posted April 8, 2008 i try to xor a lot of 16byte binarys, but it seems that bitxor only use 8bit? this is a part of my code: $input = Binary("0x00112233445566778899AABBCCDDEEFF") $key = Binary("0x9E3D486739F7E51CDAED76CCE36AD732") $output = Binary (BitXOR($input, $key)) msgbox(1,"",$output) the output is: 0x9E000000 any idee? SYS 64738 Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 8, 2008 Share Posted April 8, 2008 i try to xor a lot of 16byte binarys, but it seems that bitxor only use 8bit? this is a part of my code: $input = Binary("0x00112233445566778899AABBCCDDEEFF") $key = Binary("0x9E3D486739F7E51CDAED76CCE36AD732") $output = Binary (BitXOR($input, $key)) msgbox(1,"",$output) the output is: 0x9E000000 any idee? It get: 0x9E2C6A547DA2836B5274DC772FB739CD $input = Binary("0x00112233445566778899AABBCCDDEEFF") $key = Binary("0x9E3D486739F7E51CDAED76CCE36AD732") $output = "0x" For $n = 1 To 16 $input_int = Int(BinaryMid($input, $n, 1)) ConsoleWrite("$input_int = " & $input_int & @LF) $key_int = Int(BinaryMid($key, $n, 1)) ConsoleWrite("$key_int = " & $key_int & @LF) $XOR_int = BitXOR($input_int, $key_int) ConsoleWrite("$XOR_int = " & $XOR_int & @LF) $output &= Hex($XOR_int, 2) ConsoleWrite("$output = " & $output & @LF) Next $output_bin = Binary($output) ConsoleWrite(@LF & "Final $output_bin = " & $output_bin & @LF) BitXor() operates on bytes as unsigned integers, hence the conversion. Variable $output is assembled as a string of hex, which requires a final conversion back to binary. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
p)(d Posted April 8, 2008 Author Share Posted April 8, 2008 thanx a lot! SYS 64738 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now