Guest User

Untitled

a guest
Jul 15th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. def main():
  2.     inp = raw_input()
  3.     n = len( inp )
  4. #   k = n - 3
  5.     k = n
  6.     pol = 0xEDB88320
  7.     n = (n - k)
  8.     c = raw_input()
  9.     c2 = raw_input()
  10.     c = c ^ c2
  11.     p2 = (pol << 1) | 1
  12.     while ( n < 3 ):
  13.         if (c & 0x80000000):
  14.             c = (c << 1) ^ p2
  15.         else :
  16.             c <<= 1
  17.         n += 1
  18.         print ("XOR masks:%02X%02X%02X%02X\n", c & 0xff, (c >> 8) & 0xff,(c >> 16) & 0xff, c >> 24)
  19.     return 0
  20.  
  21. if __name__ == '__main__':
  22.     main()
Add Comment
Please, Sign In to add comment