Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kruptos is an minimalist password manager
function kruptos
{
if [[ $# -eq 1 ]]; then
DOWHAT="$1"
else
DOWHAT="d"
fi
FOLDER="~/.kruptos"
FROYO="/.phrazein"
if [[ $DOWHAT == "d" ]]; then
#Decrypt
# openssl aes-256-cbc -d -in $FOLDER.tar.gz.aes | tar -xz -f - && rm $FOLDER.tar.gz.aes
pushd . &>/dev/null
cd ~/
openssl aes-256-cbc -d -in .kruptos.tar.gz.aes | tar -xz -f - --strip-components=2 && rm ~/.kruptos.tar.gz.aes
popd &>/dev/null
elif [[ $DOWHAT == "e" ]]; then
#Encrypt
# tar -zcf - $FOLDER | openssl aes-256-cbc -out $FOLDER.tar.gz.aes -kfile $FOLDER$FROYO && rm -r $FOLDER
tar -zcf - ~/.kruptos | openssl aes-256-cbc -out ~/.kruptos.tar.gz.aes -kfile ~/.kruptos/.phrazein && rm -r ~/.kruptos
elif [[ $DOWHAT == "i" ]]; then
#Initialize
# mkdir $FOLDER
# cat barium $FOLDER/$FROYO
mkdir ~/.kruptos
echo pswd > ~/.kruptos/.phrazein
else
echo "$DOWHAT is not an acceptable flag"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment