SecuredFiles is a Python library that provides a simple and secure way to work with encrypted and unencrypted files. It offers a set of classes that allow you to seamlessly lock and unlock files, making sure your sensitive data remains protected.
- Unix/ macOS :
python3 -m pip install --upgrade SecuredFiles- Windows :
py -m pip install --upgrade SecuredFilesSecuredFiles offers simple file management.
Declare the file path using SecuredFiles.File(path) and the library will automatically determine whether the file
is a .lck or not.
import SecuredFiles
file = SecuredFiles.File('your/file/path') # SecureFile or UnsecureFileYou can also directly declare the class of your file, but if you declare a file encrypted that is not, or decrypt a file that is, you risk encountering errors.
import SecuredFiles
secure = SecuredFiles.File.SecureFile('your/file/path.lck') # SecureFile
unsecure = SecuredFiles.File.UnsecureFile('your/file/path') # UnsecureFile.lck files are encrypted files generated by the library, whose key is generated and stored on your computer in the
~/.keys/SecuredFilesKey.key file. File data is always available in clear text using the library as follows:
import SecuredFiles
file = SecuredFiles.File('your/file/path.lck') # SecureFile
print(file.data)To convert a .lck file to a standard file, do:
import SecuredFiles
file = SecuredFiles.File('your/file/path.lck') # SecureFile
file = file.unlock() # UnsecureFileTo convert a standard file to a .lck file, do:
import SecuredFiles
file = SecuredFiles.File('your/file/path') # UnsecureFile
file = file.lock() # SecureFileRegardless of the chosen option, you can retrieve and modify the data using the .data attribute:
import SecuredFiles
file = SecuredFiles.File('your/file/path') # SecureFile or UnsecureFile
file.data = "some new data"
data = file.data
file.save()Make sure to use .save() to push changes back to the file after modification.
This library also has a command-line interface.
- Unix/ macOS :
python3 -m SecuredFiles [options] <read | lock | unlock> <filepath>- Windows :
py -m SecuredFiles [options] <read | lock | unlock> <filepath>-h,--help: Display help message and exit.-v,--version: Display the version and exit.
This project is licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.