A module for encryption and information security operations.
Reason this release was yanked:
NO longer needed
Project description
Contents
better-cryptography
contains Python scripts for implementing various encryption methods (currently supports Blowfish and AES file encryption and RSA string encryption) and various logging needs.
FAQ
How do I install and import the package?
Install through the pip3 install better-cryptography
command. Import via import better_cryptography
or from better_cryptography import ...
How do I report a bug?
Email me at w.garrioch456@gmail.com.
Syntax
-
Ciphers Class methods
-
hash(StringToHash)
Takes a string and returns a hex-encoded SHA 256 hash. -
change_encrypting_password(old_password, new_password)
Takes 2 arguements,old_password
andnew_password
, and changes the class'spassword
attribute. -
RSA Methods
-
generate_RSA_keys()
Returns a RSA key pair in a tuple(public_key, private_key)
-
RSA_encrypt_str(public_key, string)
Takes 2 arguements, apublic key
and the string to be encrypted. Returns the encrypted string. -
RSA_decrypt_str(private_key, encrypted_str)
Takes 2 arguements, aprivate key
and an encrypted string. Returns a decrypted string.
-
-
AES Methods
-
generate_symmetric_key(salt)
Takes a single argument,salt
, and returns a symmetric encryption key. Ifsalt
is not provided, the method generates a random salt and returns a tuple(key, salt)
. -
AESencrypt_file(path)
Takes a file path and encrypts with AES using a key generated with a random salt and the classpassword
attribute. Will not encrypt if the file is already encrypted. -
AESdecrypt_file(path)
Takes a file path and decrypts it using the classpassword
attribute and the salt written to the file. Will not decrypt if the file was encrypted with a different encryption algorithm, different key, or was already decrypted.
-
-
Blowfish Methods
BLOencrypt_file(path)
Takes a file path and encrypts it using the Blowfish algorithm. Will not encrypt if file is already encrypted.
BLOdecrypt_file(path)
Takes a file path and decrypts it using the Blowfish algorithm. Will not decrypt if the file was encrypted with a different encryption alogrithm, different key, or if the file was already decrypted.
-
- ## Log Class Methods
- `log_exists()`
Checks to see if a `log.log` file exists for the current user. Returns a boolean value.
- `create_log()`
Creates a `log.log` file for the current user.
- `audit(keywords)`
Takes a list of keywords and removes lines in the current `log.log` file that contain those keywords.
- `log(logstring)`
Takes a string to log into the `log.log` file and writes it.
- `change_user(new_user)`
Changes the class atrribute `username` to the `new_user` parameter.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for better cryptography-0.0.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 449063558cc95f3b404d2daa8a755c665802ca892d9ef9d4f1a32d5cb1135b11 |
|
MD5 | 482dee36b94f210d484242acf4100664 |
|
BLAKE2b-256 | d993c082f1335bd12069f994d36ef6a88331e0706cd5fce7dedda70c63692424 |
Hashes for better_cryptography-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 992a656460573d9974166a9eb718c689fbe21b53edfb1fa506ddabbde89ed96a |
|
MD5 | 2d6165fe1659a937bb90a34f3e91c9ad |
|
BLAKE2b-256 | abd53b510e6353b9a6baa8311c9949f9149e1e64a023d111fd97f9ab52e3e03d |