module cli.encryption_file_cli

Short summary

module pyquickhelper.cli.encryption_file_cli

encrypt and decrypt command lines for just a file

source on GitHub

Functions

function

truncated documentation

decrypt_file

Decrypts using class decrypt_stream().

do_main

Encrypt or decrypt of a file

encrypt_file

Encrypts using class encrypt_stream().

get_parser

defines the way to parse the magic command %encrypt and %decrypt

Documentation

encrypt and decrypt command lines for just a file

source on GitHub

pyquickhelper.cli.encryption_file_cli.decrypt_file(fLOG=<built-in function print>, args=None)[source]

Decrypts using class decrypt_stream.

Parameters:
  • fLOG – logging function

  • args – to overwrite sys.args

Decrypt a file

Decrypt a file from the command line.

decrypt_file –help

usage: decrypt_file [-h] source dest password

decrypt_file a file does not work well in Python 2.7 with pycryptodome

positional arguments:
  source      file to decrypt_file
  dest        location of the decrypt_fileed file
  password    password, usually an ascii string with 16x characters

optional arguments:
  -h, --help  show this help message and exit

source on GitHub

pyquickhelper.cli.encryption_file_cli.do_main(source, dest, password, encrypt, fLOG=None)[source]

Encrypt or decrypt of a file

Parameters:
  • source – source of files to encrypt or decrypt

  • dest – destination

  • password – password

  • encrypt – boolean, True to encrypt

  • fLOG – logging function

source on GitHub

pyquickhelper.cli.encryption_file_cli.encrypt_file(fLOG=<built-in function print>, args=None)[source]

Encrypts using class encrypt_stream.

Parameters:
  • fLOG – logging function

  • args – to overwrite sys.args

Encrypt a file

Encrypt a file from the command line.

encrypt_file –help

usage: encrypt_file [-h] source dest password

encrypt_file a file does not work well in Python 2.7 with pycryptodome

positional arguments:
  source      file to encrypt_file
  dest        location of the encrypt_fileed file
  password    password, usually an ascii string with 16x characters

optional arguments:
  -h, --help  show this help message and exit

source on GitHub

pyquickhelper.cli.encryption_file_cli.get_parser(encrypt)[source]

defines the way to parse the magic command %encrypt and %decrypt

Parameters:

encrypt – encrypt or decrypt

Returns:

parser

source on GitHub