What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Jul 15, 2007 by dunglas
Labels: Phase-Implementation
CryptManagerModule  
The cryptmanager.py Python module

Introduction

cryptmanger.py is a Python module wich allow to manage an encrypted folder list, encrypt, open, close and uncrypt folders.

Details

cryptmanager.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.

Data

Data()

  • Return a Folders object (pickeling).

  • folders is the current Folders object.

Data has one public method:

  • save() save the current Folders object.

Folder

Folder(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.

Folders

Folders()

  • li is a list of Folder

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.

Manage

Manage(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.


Sign in to add a comment