Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Q5 gpg

#!/bin/bash
# The script assumes that the passwords are stored in a file called 'dict'
# Note that after gpg executes you can check the result using the return code variable $?
cat words1.txt | while read PASS; do

    #  --batch  Represents input using the command line
    res=$(gpg --batch --passphrase $PASS -d secret.txt.gpg 2>/dev/null)
    
    if [ 0 -eq $? ] # if the return value is 0, then no error
    then
        echo YAY found secet! $res
        exit
    fi
done

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.