From 25cd64d51f6aff555123711f515b6329cc0b1b09 Mon Sep 17 00:00:00 2001 From: Iam iAGorynT <108758623+iAGorynT@users.noreply.github.com> Date: Sun, 5 May 2024 12:32:09 -0500 Subject: [PATCH] Create Cryptxt-Script.md Added new script documentation for shell script. --- Docs/Cryptxt-Script.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Docs/Cryptxt-Script.md diff --git a/Docs/Cryptxt-Script.md b/Docs/Cryptxt-Script.md new file mode 100644 index 0000000..cf2bd0d --- /dev/null +++ b/Docs/Cryptxt-Script.md @@ -0,0 +1,27 @@ +## Script: Cryptxt.sh +### Desc: OpenSSL Text Encrypt / Decrypt +Date: 05/05/2024 + +_Documentation_ + +This script is a shell script written in zsh. It provides a simple interface for encrypting and decrypting text using OpenSSL. Let's break down its functionality: + +1. **Clear Screen and Display Title**: The script starts by clearing the screen and displaying a title, "OpenSSL Text Encrypt / Decrypt". + +2. **User Input**: It enters a loop where it prompts the user to choose between encryption ("enc") or decryption ("dec"). It repeatedly asks for input until a valid choice is made. + +3. **Request Text and Password**: After the user chooses an action, it prompts for the text to be encrypted or decrypted and the password to be used for the encryption/decryption. The password input is masked (hidden) as the user types. + +4. **Check Input**: It checks if all necessary parameters (action, string, password) are set. If any of them are missing, it displays an error message and exits the script. + +5. **Encrypt or Decrypt**: Depending on the chosen action ("enc" or "dec"), it performs encryption or decryption using OpenSSL. + + - **Encryption**: If the action is encryption, it encrypts the provided string using AES-256-CBC encryption with base64 encoding. It then copies the encrypted text to the clipboard and displays it. + + - **Decryption**: If the action is decryption, it decrypts the provided string using AES-256-CBC decryption with base64 decoding. It displays the decrypted text. + +6. **Output**: It prints out the encrypted or decrypted text, depending on the chosen action. + +7. **Skip Lines**: It adds empty lines for better readability in the terminal. + +This script provides a straightforward way to encrypt and decrypt text using OpenSSL with AES-256 encryption. It ensures that the user provides all necessary inputs and handles encryption and decryption accordingly. \ No newline at end of file