Search code examples
bashpasswordscrypt

How Decript string previously cripted in BASH?


i have a security problem on a script. I have to pass it a username and password, but i can't give it a password not crypted. This script is writed in bash.

#!/bin/bash
HOST=$1
USER=$2
PASSWORD=$3
#PASSWORD=`perl -e 'print pack "H*",$PASSWORD'`
wget -v $HOST --http-user=$USER --http-password=$PASSWORD --no-check-certificate
......

I have think to use something like this for generate cripted password:

perl -e 'print unpack "H*","yourpassword"'

and something like this for decript it

descrpt=`perl -e 'print pack "H*","encrypted password"'`

but it doesn't work. Someone could help me please?


Solution

  • Problem solved with:

    echo $password | openssl enc -base64 -d