Skip to content

Instantly share code, notes, and snippets.

@NonlinearFruit
Last active July 22, 2016 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NonlinearFruit/7b6f72f97f0d70086f3f229fbf23850f to your computer and use it in GitHub Desktop.
Save NonlinearFruit/7b6f72f97f0d70086f3f229fbf23850f to your computer and use it in GitHub Desktop.
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