Skip to main content

Python's library for protect your files.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

securedfiles-1.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

securedfiles-1.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file securedfiles-1.1.0.tar.gz.

File metadata

  • Download URL: securedfiles-1.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for securedfiles-1.1.0.tar.gz
Algorithm Hash digest
SHA256 64a427de95a50af1590581c70e253b79971820160340a8d49b9b59a6f86caaf2
MD5 6c2c2a4efb4771c20f87b4058e38f3a0
BLAKE2b-256 3bcfd8134bb514586f94b1e0ac747df4ae52ebafad23cef4ece69b89ec4601c8

See more details on using hashes here.

File details

Details for the file securedfiles-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: securedfiles-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for securedfiles-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf49264a96ccdc40a16d60e55721a0e4f72078fcb0da406a4b961abffe03f147
MD5 eef73511ddde78248e7663f10a9db044
BLAKE2b-256 3aee6add003a301cf15100d3199ab35cd4159daa4cd9e251920ab9e931c75b9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page