Skip to content

PicselVaot/SecuredFiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecuredFiles

LassaInora - SecuredFiles GitHub tag stars - SecuredFiles forks - SecuredFiles

PyPI version Supported Versions License


Overview

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.

How to use

Installation

  • Unix/ macOS :
python3 -m pip install --upgrade SecuredFiles
  • Windows :
py -m pip install --upgrade SecuredFiles

Library Interface

SecuredFiles 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 UnsecureFile

You 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()  # UnsecureFile

To convert a standard file to a .lck file, do:

import SecuredFiles

file = SecuredFiles.File('your/file/path')  # UnsecureFile
file = file.lock()  # SecureFile

Modifying and Saving

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

Command Line Interface

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>

Options:

  • -h, --help : Display help message and exit.
  • -v, --version : Display the version and exit.

Contributors

Library created by

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.

About

Python's library for protect your files.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages