Package: robocrypt
RobocryptSuper strong python3 encryption program with file and folder supportDue to the encryption algorithm in use here, large files should not be encrypted with this tool. Robocrypt keeps data in memory while encrypting/decrypting, so depending on the RAM in your system there will be a limit on the size of files you can handle with this tool.Robocrypt is amazing for encrypting small files and folders with sensitive data. It uses symmetric key encryption, plus a salt of random bytes. I guarantee that ain't nobody gonna break the encryption, unless you use a sub-par password.Documentation Index:InstallationSetupModule DocumentationCommand Line DocsInstallation:pip3 install robocryptSetup:Create asecuredirectory in/varthat only your user can read/write too:$sudomkdir/var/secure$sudochmod740/var/secureIf you're using Windows, do the same thing but inC:\secure.Generate a salt to use when encrypting stuff:$robocryptgenerate-salt69173Make sure that you decrypt anything you've encrypted with your current salt(or back it up) before you change it! Otherwise you will never be able to recover files that you encrypted.
If you intend to share encrypted files with someone, you also need to share your salt with them, or they will have serious trouble trying to decrypt the files.ModulerobocryptSub-modulesrobocrypt.clirobocrypt.inforobocrypt.libraryModulerobocrypt.cliFunctionsFunctioncommand_linedef command_line()This is the command line entry point ofrobocrypt.Modulerobocrypt.infoThis contains information about the module such as version and author.Modulerobocrypt.libraryThis contains all the core functions used byrobocrypt.FunctionsFunctiondecryptdef decrypt(
    message: bytes,
    password: bytes
) ‑> bytesDecrypt a chunk of bytes with a password.Argsmessage:bytes:   The bytes to decryptpassword:bytes:   The password to decrypt the message withReturnsbytes:   the decrypted bytesFunctiondecrypt_filedef decrypt_file(
    filepath: str,
    password: str
)Decrypts a file and saves it without its robo extension.Argsfilepath:str:   The encrypted file to decryptpassword:str:   The password to decrypt the file withFunctionencryptdef encrypt(
    message: bytes,
    password: bytes
) ‑> bytesEncrypts a bytes message using the specified bytes password.Argsmessage:bytes:   the message to encryptpassword:bytes:   the password to encrypt the message withReturnsbytes:   the encrypted bytesFunctionencrypt_filedef encrypt_file(
    filepath: str,
    password: str
)Encrypts a file and saves it with a.robofor file or.robodirextension for directories. I strongly advise that you not mess with the extensions if you want to be able to properly decrypt your files.Argsfilepath:str:   The file or directory to encryptpassword:str:   the password to encrypt the file withFunctiongenerate_saltdef generate_salt(
    length: int
)Generates a salt and stores it in the file indicated by the ENV varROBO_SALT_FILE.Argslength:int:   the number of bytes to contain in the saltReturnsstr:   the location of the new salt fileFunctionget_kdfdef get_kdf()Gets a KDF object to perform cryptography with.ReturnsPBKDF2HMAC:   the KDF to perform encryption/decryption withFunctionget_saltdef get_salt(
    salt_file: str = None
) ‑> bytesGets the salt bytes used to encrypt and decrypt things.If a salt file is not specified and the env varROBO_SALT_FILEis not set, a default salt location for your OS will be used. If there is not a salt at that location, robocrypt will raise an error.The salt file location is stored in the environment variableROBO_SALT_FILE. You can modify this environment variable to point to different salt files if desired.Argssalt_file:str:   a custom file to read the salt from.Returnsstr:   the salt bytesFunctionget_salt_filedef get_salt_file() ‑> strReturns the location of the salt file used for cryptography.On Unix systems the salt file is at/var/secure/robocrypt.salt, and on Windows the salt is atC:/secure/robocrypt.salt. If a custom salt is specified in the environment variableROBO_SALT_FILE, it will be used instead of the OS default.Returnsstr:   the path the to salt fileFunctionread_encrypted_filedef read_encrypted_file(
    filepath: str,
    password: str
) ‑> bytesReturns the decrypted content of an encrypted file without decrypting the file itself.Argsfilepath:str:   the encrypted file to readpassword:str:   the password to use to read the fileReturnsbytes:   the file's decrypted content in bytesClassesClassDecryptionErrorclass DecryptionErrorThis occurs when an invalid password is used to try to decrypt something, or the wrong salt is used.Generated bypdoc0.10.0 (https://pdoc3.github.io). That's why the documentation looks like crap.Robocrypt Command Line:Here is thehelpfor the robocrypt CLI:usage: robocrypt [-h] [-s SALT_FILE] [-v] {generate-salt,gs,encrypt,en,decrypt,de} ...____        __             __ __/ __ \____  / /_  ____     / // // /_/ / __ \/ __ \/ __ \   / // /_/ _, _/ /_/ / /_/ / /_/ /  /__  __//_/ |_|\____/_.___/\____/     /_/positional arguments:{generate-salt,gs,encrypt,en,decrypt,de}generate-salt (gs)  generate and save a new random salt of a given lengthencrypt (en)        encrypt a file or directorydecrypt (de)        decrypt a file or directoryoptional arguments:-h, --help            show this help message and exit-s SALT_FILE, --salt-file SALT_FILEspecify a salt file to use-v, --version         show program's version number and exitThe commands you can use are these:generate-saltor shortcutgsencryptor shortcutendecryptor shortcutdeTo specify a salt file to generate, encrypt, or decrypt, use the argument--salt-file /path/to/saltfile.generate-salt:Generate a salt in the default location:$sudorobocryptgenerate-salt5829Overwriting your old salt will render anything encrypted with it absolutely un-readable, unless you back it up.Are you sure you want to do this? yesSuccessfully saved a salt of length 5829 to /var/secure/robocrypt.saltRobocrypt will ask you if you really want to overwrite any existing salt files. Answeringnoat the prompt will exit the program without touching the salt.Generate a salt to a specific file:$sudorobocrypt--salt-file/var/secure/myother.saltgenerate-salt5829Successfully saved a salt of length 5829 to /var/secure/myother.saltHere we were not prompted to confirm because there was no previous file at/var/secure/myother.salt.encrypt:Encrypt a file:$ robocrypt encrypt tests/data/Dictionary.java 
Enter password to encrypt: 🔑
Successfully encrypted /path/tests/data/Dictionary.java!
$ ls tests/data/
Dictionary.java.robo  srcYou can see thatDictionary.javawas encrypted and saved asDictionary.java.robo.Encrypt a folder with a specified salt:$robocrypt--salt-file/var/secure/alternate.saltencrypttests/data/src/Enter password to encrypt: 🔑Successfully encrypted /path/tests/data/src!$lstests/data/Dictionary.java.robo  src.robodirThesrcdirectory was encrypted and saved assrc.robodirusing thealternate.salt.decrypt:Decrypt a file:$robocryptdecrypttests/data/Dictionary.java.roboEnter password to decrypt: 🔑Successfully decrypted /path/tests/data/Dictionary.java.robo!$lstests/data/Dictionary.java  src.robodirDictionary.javawas restored to its original state with only the.javaextension.Decrypt a folder with a specified salt:$robocrypt--salt-file/var/secure/alternate.saltdecrypttests/data/src.robodirEnter password to decrypt: 🔑Successfully decrypted /path/tests/data/src.robodir!$lstests/data/Dictionary.java  srcNow thesrcdirectory is back to normal, with no.robodirextension.Warning!When using the tool, don't jack around with the output files' extensions (.roboand.robodir). Robocrypt uses these extensions to tell what type of file is encrypted and if change them, you will regret it. Also, I would recommend not double-encrypting anything. Because of the way the program works with extensions, you'll end up screwing yourself. Encrypt your shitonetime with a strong password.