Introductioncryptmanger.py is a Python module wich allow to manage an encrypted folder list, encrypt, open, close and uncrypt folders. Detailscryptmanager.py is composed of 4 public classes (and some privates classes, see the code for details): - Data: access to main folder list.
- Folder: structure representing a folder.
- Folders: list of folders and operations on list.
- Manage: operations on a folder.
DataData() - Return a Folders object (pickeling).
- folders is the current Folders object.
Data has one public method: - save() save the current Folders object.
FolderFolder(path) - path represent the full path to the mount point (the encrypted directory).
- crypt is the place where encrypted data are stored.
- digest contain the sha256 hash of the path name.
Folder has no public method. FoldersFolders() Folder has 5 publics methods: - add(folder) add a Folder to the list li. Raise an AlreadyExists_ exception if the Folder is already in the list.
- rem(folder) remvoe a Folder of the list li.
- update(folder) update a Folder which the list li contain.
- get(path) return a Folder if it is in the list. Either raise an Uncrypted exception.
- clean() update the object to the current real status and remove out of dates entries.
ManageManage(folder) - Manage the specified Folder
Manage has 4 publics methods: - crypt(password) encrypt the Folder with password. Raise a LoError_ exception if no loopback device available. Raise a IMGexists exception if an ecrypted image already exists for this Folder.
- mount(password) open the Folder to is path using password. Raise a BadPassword_ exception if the password is wrong. Raise an AlreadyOpened_ exception if the encrypted folder is already open.
- unmount() close the Folder. Raise a NotOpened_ exception if the Folder was not open.
- uncrypt(password) uncrypt the crypted Folder. Raise a BadPassword_ exception if the password is wrong.
|