python package that encrypt/decrypt files by key.
Project description
File Cryptor
Pages
Install
pip install fcryptor
CLI Usage
fcryptor [-h] (-c | -d) [-si] -i INPUT [-o OUTPUT] [-k KEY] [-gk]
optional arguments:
[ -h | --help ] show help message and exit
[ -c | --crypt ] crypting flag
[ -d | --decrypt ] decrypting flag
[ -si | --stdin ] when stdin is true, default=false
[ -i | --input ] INPUT Input File/stdin [for stdin pass -si | --stdin]
[ -o | --output ] OUTPUT Output crypt/decrypt result to File
[ -k | --key ] KEY key of/for file
[ -gk | --genkey ] generate a key and exit
CLI - Examples
fcryptor -c -si -i Hi
# output
Key is: szTaqno8sG4K8Gi0z1t4iTzlYb7RIebzhjPFpGPlstg=
encrypt:
gAAAAABfqVhMM5dk5HhO7Am3FyFk1qXpobq-JWyF5DbG1PFsRHWH3VzTzhyn8NrcBVfI10_lmqHSm3-YVC4BRYkLTK7T0ldu-Q==
fcryptor -d -si -i gAAAAABfqVhMM5dk5HhO7Am3FyFk1qXpobq-JWyF5DbG1PFsRHWH3VzTzhyn8NrcBVfI10_lmqHSm3-YVC4BRYkLTK7T0ldu-Q== -k szTaqno8sG4K8Gi0z1t4iTzlYb7RIebzhjPFpGPlstg=
# output
decrypt:
Hi
fcryptor -c -i test.txt -o test.enc
# output
Key is: dOmxLC4uEka9vGj8vfwECMHu9MbWo6RCYKDR1hXKGvU=
fcryptor -d -i test.enc -o test.txt
# output
when pass -d, you have to pass -k [the Key] argument
#again
fcryptor -d -i test.enc -o test_d.txt -k dOmxLC4uEka9vGj8vfwECMHu9MbWo6RCYKDR1hXKGvU=
#output
[nothing, just create test_d.txt file]
Code Usage
from fcryptor import FCryptor
fc = FCryptor() # can pass key here, no support custom key yet
out = fc.crypt(
"HI", # or file path
None, # or output path
from_stdin=True # or False if pass path
)
fc.decrypt(
out,
"./test.enc",
from_stdin=True
)
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
fcryptor-1.0.6.tar.gz
(3.9 kB
view details)
File details
Details for the file fcryptor-1.0.6.tar.gz
.
File metadata
- Download URL: fcryptor-1.0.6.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ddece0ab77e33406211b95576efa5de43c5d1c91d57d74210f186aff27b7358 |
|
MD5 | ad0cde7308d053ff0e5b80a06c380db9 |
|
BLAKE2b-256 | 7fc76389a94827e377b440e55fa51f3f708df3a9427be8cd7eb281497f5dc2bb |