Guest User

Eurobros be free

a guest
Jun 21st, 2018
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def scramble(data):
  2. res = bytearray()
  3. print(data[0], type(data))
  4. for d in data:
  5. print(d, 97)
  6. res += bytes([d, 97])
  7. res = bytes(res)
  8. print(res)
  9. return bytes(res)
  10.  
  11. def unscramble(data):
  12. res = bytearray()
  13. c = 0
  14. for d in data:
  15. if not c % 2:
  16. res.append(d)
  17. c+=1
  18. return bytes(res)
  19.  
  20.  
  21. test = scramble(open("test.txt", "rb").read())
  22. print(unscramble(test))
Add Comment
Please, Sign In to add comment