In the previous chapter, we learned about handling files, directories, and data. We also learned about the tarfile module. In this chapter, we'll learn about file archiving, encryption, and decryption. Archiving plays an important role in managing files, directories, and data. But first, what is archiving? Archiving is a process that stores the files and directories into a single file. Python has the tarfile module for creating such archive files.
In this chapter, we will cover the following topics:
- Creating and unpacking archives
- Tar archives
- ZIP creation
- File encryption and decryption