Guest User

Untitled

a guest
Dec 13th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/usr/bin/python
  2. #-*- coding: utf-8 -*-
  3.  
  4. import hashlib
  5.  
  6. data1 = open('./shattered-1.pdf', 'rb').read()
  7. data2 = open('./shattered-2.pdf', 'rb').read()
  8.  
  9. filesize = (2017*1024 + 2018*1024) / 2 # 2065920
  10.  
  11. data1 += 'A'*(filesize - len(data1))
  12. data2 += 'A'*(filesize - len(data2))
  13.  
  14. open('file1', 'wb').write(data1)
  15. open('file2', 'wb').write(data2)
  16.  
  17. print('SHA-1 hash\n-----')
  18. print('file1: ' + hashlib.sha1(data1).hexdigest())
  19. print('file2: ' + hashlib.sha1(data2).hexdigest())
  20. print('-----')
Add Comment
Please, Sign In to add comment