Hack Forums
[Python] Command-Line File Encrypter - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Command-Line File Encrypter (/showthread.php?tid=6191631)



Command-Line File Encrypter - MiguelSanchez - Feb 1, 2022

Rubik's Crypt:

Usage: Options E to encrypt string, D to decrypt string
EF to encrypt file (must also have an output name after the password)
DF to decrypt file (must also have an output name after the password)

rubikscrypt Directive Input Password (OutputFile?)\
e.g.
    rubikscrypt E "Encrypt This String" Password
    rubikscrypt D "Decrypt This String" Password
    rubikscrypt EF filetoencrypt Password outputname
    rubikscrypt DF filetodecrypt Password outputname


To install it into your command line (and therefore all your future programs via os.system)
create a batch file rubikscrypt.bat as follows,
Code
@echo off
python C:\Users\User\Documents\CMD\rubikscrypt.py %*

and make sure to put the batch file in on of the directories in your path (start menu search -> edit the system environment variables -> Environment Variables ->path)

Here is the python script,
rubikscrypt.py
[paste]
https://pastebin.com/shNUGhMs
[/paste]

I hope someone enjoys it. Sorry for the lack of comments, check my post history for a description on the cryptography board (this version is more updated than the one I linked there, finished hopefully)