PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Quick & Easy Old Usful Encrypt & Decrypt Methods for linux

Go down

Quick & Easy Old Usful Encrypt & Decrypt Methods for linux Empty Quick & Easy Old Usful Encrypt & Decrypt Methods for linux

Post by jamied_uk 28th May 2018, 15:09



load files as described after making them executable

Code:
sudo chmod +x *.sh




Code:
#!/bin/bash
#
#
#
# Usage: ./quick_enc_function.sh file.ext
#
#
#
myvar="$1"
#
#
encrypt(){
    gpg -c -o- $1 # encrypts data to stdout

}

encrypt "$myvar" > private.dat


Decryption


Code:
#!/bin/bash
#
# Usage: ./quick_dec_function.sh private.dat
#
#
#
myvar="$1"
gpg "$1" > errors.txt
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum