Thursday, April 7, 2011

En/Decrypt Blowfish with Zenity

Usage: As you like, Your own risk.

--

Encrypt

Requires:
Openssl, Zenity
Menu Name:
Encrypt Blowfish
Description:
Encryp Blowfish CBC - base64

#!/usr/bin/env bash

function encrypt()
{
pass=`zenity --entry --title='Encrypt Blowfish CBC - base64' \
--text='Enter Encryption Password' --hide-text --width='400'`

if [ -n "$pass" ]
then
verify=`zenity --entry --title='Verifying | Encrypt Blowfish CBC - base64' \
--text='Re-Enter Encryption Password' --hide-text --width='400'`

if [ "$pass" == "$verify" ]
then
exec openssl enc -bf -salt -e -a -k $pass
else
zenity --error --title='Verify failure' --text='bad password read'
fi
fi
}

encrypt
 
--

Decrypt

Requires:
Openssl, Zenity
Menu Name:
Decrypt Blowfish
Description:
Decrypt Blowfish CBC - base64

#!/usr/bin/env bash

exec openssl enc -bf -salt -d -a -k \
`zenity --entry --title='Decrypt Blowfish CBC - base64' \
--text='Enter Decryption Password' --hide-text --width=400`
 
--

Reference URL

No comments: