module cli.encryption_cli
¶
Short summary¶
module pyquickhelper.cli.encryption_cli
encrypt and decrypt command lines
Functions¶
function |
truncated documentation |
---|---|
Decrypts using class |
|
Encrypts or decrypts a folder, see |
|
Encrypts using class |
|
Defines the way to parse the magic command |
Documentation¶
encrypt and decrypt command lines
- pyquickhelper.cli.encryption_cli.decrypt(fLOG=<built-in function print>, args=None)[source]¶
Decrypts using class
EncryptedBackup
. The function relies on module pycrypto, cryptography, algoritm AES, Fernet.- Parameters:
fLOG – logging function
args – to overwrite
sys.args
Decrypt a string
Decrypts an encrypted string from the command line.
decrypt –help
usage: decrypt [-h] [-r REGEX] source dest password decrypt a folder. For a second run, the program looks into file status to avoid crypting same file gain, it does only modified files it does not work well in Python 2.7 with pycryptodome. positional arguments: source folder to decrypt dest location of the decrypted files password password, usually an ascii string with 16x characters optional arguments: -h, --help show this help message and exit -r REGEX, --regex REGEX the script can retrieve only a subpart of the data defined by a regular expression
- pyquickhelper.cli.encryption_cli.do_main(source, dest, password, encrypt, crypt_file, crypt_map, regex=None, fLOG=None)[source]¶
Encrypts or decrypts a folder, see
EncryptedBackup
. The function relies on module pycrypto, cryptography, algoritm AES, Fernet.- Parameters:
source – source of files to encrypt or decrypt
dest – destination
password – password
encrypt – boolean, True to encrypt
crypt_file – encrypted file
crypt_map –
EncryptedBackup
regex – regular expression to filter in files to retrieve
fLOG – logging function
- pyquickhelper.cli.encryption_cli.encrypt(fLOG=<built-in function print>, args=None)[source]¶
Encrypts using class
EncryptedBackup
. The function relies on module pycrypto, cryptography, algoritm AES, Fernet.- Parameters:
fLOG – logging function
args – to overwrite
sys.args
Encrypt a string
Encrypts a string from the command line.
encrypt –help
usage: encrypt [-h] [-s STATUS] [-m MAP] source dest password encrypt a folder. For a second run, the program looks into file status to avoid crypting same file gain, it does only modified files it does not work well in Python 2.7 with pycryptodome. positional arguments: source folder to encrypt dest location of the encrypted files password password, usually an ascii string with 16x characters optional arguments: -h, --help show this help message and exit -s STATUS, --status STATUS to keep track of what was done -m MAP, --map MAP mapping between raw files and crypted files