Replace spaces for dots (create & edit entry)

This commit is contained in:
q3aql 2022-06-30 20:20:23 +02:00
parent 17b48c392a
commit 7c02c46acc
3 changed files with 72 additions and 39 deletions

View File

@ -5,7 +5,7 @@
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
# License: GPL v2.0 # # License: GPL v2.0 #
# Last-Change: 24-06-20222 # # Last-Change: 30-06-20222 #
# ########################################################### # ###########################################################
VERSION="0.1" VERSION="0.1"
@ -54,6 +54,17 @@ function removeSpacesURL() {
echo ${wordToConvert} echo ${wordToConvert}
} }
function spaceForDot() {
wordToConvert=${1}
sedtmpfile="${file_code_sec}"
echo "${wordToConvert}" > ${sedtmpfile}
# Remove spaces
sed -i 's/ /·/g' "${sedtmpfile}" &> /dev/null
# Show file without spaces
wordToConvert=$(cat ${sedtmpfile})
echo ${wordToConvert}
}
function restoreSpaces() { function restoreSpaces() {
wordToConvert=${1} wordToConvert=${1}
sedtmpfile="${file_code_sec}" sedtmpfile="${file_code_sec}"
@ -216,7 +227,7 @@ function create_login_vault_entry() {
while [ ${username_entry} -eq 0 ] ; do while [ ${username_entry} -eq 0 ] ; do
echo -n "# Enter Username: " ; read name_username echo -n "# Enter Username: " ; read name_username
if [ ! -z "${name_username}" ] ; then if [ ! -z "${name_username}" ] ; then
name_username=$(removeSpaces "${name_username}") name_username=$(spaceForDot "${name_username}")
name_username=$(vault_key_encrypt "${name_username}") name_username=$(vault_key_encrypt "${name_username}")
username_text=$(vault_key_encrypt "Username") username_text=$(vault_key_encrypt "Username")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/login" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/login"
@ -228,7 +239,7 @@ function create_login_vault_entry() {
while [ ${password_entry} -eq 0 ] ; do while [ ${password_entry} -eq 0 ] ; do
echo -n "# Enter Password: " ; read name_password echo -n "# Enter Password: " ; read name_password
if [ ! -z "${name_password}" ] ; then if [ ! -z "${name_password}" ] ; then
name_password=$(removeSpaces "${name_password}") name_password=$(spaceForDot "${name_password}")
name_password=$(vault_key_encrypt "${name_password}") name_password=$(vault_key_encrypt "${name_password}")
password_text=$(vault_key_encrypt "Password") password_text=$(vault_key_encrypt "Password")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/password" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/password"
@ -252,7 +263,7 @@ function create_login_vault_entry() {
while [ ${otp_entry} -eq 0 ] ; do while [ ${otp_entry} -eq 0 ] ; do
echo -n "# Enter OTP (Default: None): " ; read name_otp echo -n "# Enter OTP (Default: None): " ; read name_otp
if [ ! -z "${name_otp}" ] ; then if [ ! -z "${name_otp}" ] ; then
name_otp=$(removeSpaces "${name_otp}") name_otp=$(spaceForDot "${name_otp}")
name_otp=$(vault_key_encrypt "${name_otp}") name_otp=$(vault_key_encrypt "${name_otp}")
otp_text=$(vault_key_encrypt "OTP") otp_text=$(vault_key_encrypt "OTP")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/otp" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/otp"
@ -315,7 +326,7 @@ function create_bcard_vault_entry() {
while [ ${card_entry} -eq 0 ] ; do while [ ${card_entry} -eq 0 ] ; do
echo -n "# Enter Card Number (XXXX-XXXX-XXXX-XXXX): " ; read name_card echo -n "# Enter Card Number (XXXX-XXXX-XXXX-XXXX): " ; read name_card
if [ ! -z "${name_card}" ] ; then if [ ! -z "${name_card}" ] ; then
name_card=$(removeSpaces "${name_card}") name_card=$(spaceForDot "${name_card}")
name_card=$(vault_key_encrypt "${name_card}") name_card=$(vault_key_encrypt "${name_card}")
card_text=$(vault_key_encrypt "Card") card_text=$(vault_key_encrypt "Card")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/card" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/card"
@ -327,7 +338,7 @@ function create_bcard_vault_entry() {
while [ ${expiry_entry} -eq 0 ] ; do while [ ${expiry_entry} -eq 0 ] ; do
echo -n "# Enter Expiry Date (MM/YY): " ; read name_expiry echo -n "# Enter Expiry Date (MM/YY): " ; read name_expiry
if [ ! -z "${name_expiry}" ] ; then if [ ! -z "${name_expiry}" ] ; then
name_expiry=$(removeSpaces "${name_expiry}") name_expiry=$(spaceForDot "${name_expiry}")
name_expiry=$(vault_key_encrypt "${name_expiry}") name_expiry=$(vault_key_encrypt "${name_expiry}")
expiry_text=$(vault_key_encrypt "Expiry") expiry_text=$(vault_key_encrypt "Expiry")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/expiry" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/expiry"
@ -339,7 +350,7 @@ function create_bcard_vault_entry() {
while [ ${cvv_entry} -eq 0 ] ; do while [ ${cvv_entry} -eq 0 ] ; do
echo -n "# Enter CVV: " ; read name_cvv echo -n "# Enter CVV: " ; read name_cvv
if [ ! -z "${name_cvv}" ] ; then if [ ! -z "${name_cvv}" ] ; then
name_cvv=$(removeSpaces "${name_cvv}") name_cvv=$(spaceForDot "${name_cvv}")
name_cvv=$(vault_key_encrypt "${name_cvv}") name_cvv=$(vault_key_encrypt "${name_cvv}")
cvv_text=$(vault_key_encrypt "CVV") cvv_text=$(vault_key_encrypt "CVV")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/cvv" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/cvv"
@ -874,7 +885,7 @@ function edit_entry_vault() {
read_userame_dc=$(vault_key_decrypt "${read_username}") read_userame_dc=$(vault_key_decrypt "${read_username}")
echo -n "# Enter Username (Default: ${read_userame_dc}): " ; read name_username echo -n "# Enter Username (Default: ${read_userame_dc}): " ; read name_username
if [ ! -z "${name_username}" ] ; then if [ ! -z "${name_username}" ] ; then
name_username=$(removeSpaces "${name_username}") name_username=$(spaceForDot "${name_username}")
name_username=$(vault_key_encrypt "${name_username}") name_username=$(vault_key_encrypt "${name_username}")
username_text=$(vault_key_encrypt "Username") username_text=$(vault_key_encrypt "Username")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/login" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/login"
@ -886,7 +897,7 @@ function edit_entry_vault() {
read_password_dc=$(vault_key_decrypt "${read_password}") read_password_dc=$(vault_key_decrypt "${read_password}")
echo -n "# Enter Password (Default: ${read_password_dc}): " ; read name_password echo -n "# Enter Password (Default: ${read_password_dc}): " ; read name_password
if [ ! -z "${name_password}" ] ; then if [ ! -z "${name_password}" ] ; then
name_password=$(removeSpaces "${name_password}") name_password=$(spaceForDot "${name_password}")
name_password=$(vault_key_encrypt "${name_password}") name_password=$(vault_key_encrypt "${name_password}")
password_text=$(vault_key_encrypt "Password") password_text=$(vault_key_encrypt "Password")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/password" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/password"
@ -910,7 +921,7 @@ function edit_entry_vault() {
read_otp_dc=$(vault_key_decrypt "${read_otp}") read_otp_dc=$(vault_key_decrypt "${read_otp}")
echo -n "# Enter OTP (Default: ${read_otp_dc}): " ; read name_otp echo -n "# Enter OTP (Default: ${read_otp_dc}): " ; read name_otp
if [ ! -z "${name_otp}" ] ; then if [ ! -z "${name_otp}" ] ; then
name_otp=$(removeSpaces "${name_otp}") name_otp=$(spaceForDot "${name_otp}")
name_otp=$(vault_key_encrypt "${name_otp}") name_otp=$(vault_key_encrypt "${name_otp}")
otp_text=$(vault_key_encrypt "OTP") otp_text=$(vault_key_encrypt "OTP")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/otp" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/otp"
@ -935,7 +946,7 @@ function edit_entry_vault() {
read_card_dc=$(vault_key_decrypt "${read_card}") read_card_dc=$(vault_key_decrypt "${read_card}")
echo -n "# Enter Card Number (Default: ${read_card_dc}): " ; read name_card echo -n "# Enter Card Number (Default: ${read_card_dc}): " ; read name_card
if [ ! -z "${name_card}" ] ; then if [ ! -z "${name_card}" ] ; then
name_card=$(removeSpaces "${name_card}") name_card=$(spaceForDot "${name_card}")
name_card=$(vault_key_encrypt "${name_card}") name_card=$(vault_key_encrypt "${name_card}")
card_text=$(vault_key_encrypt "Card") card_text=$(vault_key_encrypt "Card")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/card" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/card"
@ -947,7 +958,7 @@ function edit_entry_vault() {
read_expiry_dc=$(vault_key_decrypt "${read_expiry}") read_expiry_dc=$(vault_key_decrypt "${read_expiry}")
echo -n "# Enter Expiry Date (Default: ${read_expiry_dc}): " ; read name_expiry echo -n "# Enter Expiry Date (Default: ${read_expiry_dc}): " ; read name_expiry
if [ ! -z "${name_expiry}" ] ; then if [ ! -z "${name_expiry}" ] ; then
name_expiry=$(removeSpaces "${name_expiry}") name_expiry=$(spaceForDot "${name_expiry}")
name_expiry=$(vault_key_encrypt "${name_expiry}") name_expiry=$(vault_key_encrypt "${name_expiry}")
expiry_text=$(vault_key_encrypt "Expiry") expiry_text=$(vault_key_encrypt "Expiry")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/expiry" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/expiry"
@ -959,7 +970,7 @@ function edit_entry_vault() {
read_cvv_dc=$(vault_key_decrypt "${read_cvv}") read_cvv_dc=$(vault_key_decrypt "${read_cvv}")
echo -n "# Enter CVV (Default: ${read_cvv_dc}): " ; read name_cvv echo -n "# Enter CVV (Default: ${read_cvv_dc}): " ; read name_cvv
if [ ! -z "${name_cvv}" ] ; then if [ ! -z "${name_cvv}" ] ; then
name_cvv=$(removeSpaces "${name_cvv}") name_cvv=$(spaceForDot "${name_cvv}")
name_cvv=$(vault_key_encrypt "${name_cvv}") name_cvv=$(vault_key_encrypt "${name_cvv}")
cvv_text=$(vault_key_encrypt "cvv") cvv_text=$(vault_key_encrypt "cvv")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/cvv" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/cvv"

View File

@ -5,7 +5,7 @@
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
# License: GPL v2.0 # # License: GPL v2.0 #
# Last-Change: 27-06-20222 # # Last-Change: 30-06-20222 #
# ############################################################# # #############################################################
VERSION="0.1" VERSION="0.1"
@ -65,6 +65,17 @@ function removeSpacesURL() {
echo ${wordToConvert} echo ${wordToConvert}
} }
function spaceForDot() {
wordToConvert=${1}
sedtmpfile="${file_code_sec}"
echo "${wordToConvert}" > ${sedtmpfile}
# Remove spaces
sed -i 's/ /·/g' "${sedtmpfile}" &> /dev/null
# Show file without spaces
wordToConvert=$(cat ${sedtmpfile})
echo ${wordToConvert}
}
function restoreSpaces() { function restoreSpaces() {
wordToConvert=${1} wordToConvert=${1}
sedtmpfile="${file_code_sec}" sedtmpfile="${file_code_sec}"
@ -251,7 +262,7 @@ function create_login_vault_entry() {
while [ ${username_entry} -eq 0 ] ; do while [ ${username_entry} -eq 0 ] ; do
name_username=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter Username:" 0 0) name_username=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter Username:" 0 0)
if [ ! -z "${name_username}" ] ; then if [ ! -z "${name_username}" ] ; then
name_username=$(removeSpaces "${name_username}") name_username=$(spaceForDot "${name_username}")
name_username=$(vault_key_encrypt "${name_username}") name_username=$(vault_key_encrypt "${name_username}")
username_text=$(vault_key_encrypt "Username") username_text=$(vault_key_encrypt "Username")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/login" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/login"
@ -263,7 +274,7 @@ function create_login_vault_entry() {
while [ ${password_entry} -eq 0 ] ; do while [ ${password_entry} -eq 0 ] ; do
name_password=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter Password:" 0 0) name_password=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter Password:" 0 0)
if [ ! -z "${name_password}" ] ; then if [ ! -z "${name_password}" ] ; then
name_password=$(removeSpaces "${name_password}") name_password=$(spaceForDot "${name_password}")
name_password=$(vault_key_encrypt "${name_password}") name_password=$(vault_key_encrypt "${name_password}")
password_text=$(vault_key_encrypt "Password") password_text=$(vault_key_encrypt "Password")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/password" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/password"
@ -287,7 +298,7 @@ function create_login_vault_entry() {
while [ ${otp_entry} -eq 0 ] ; do while [ ${otp_entry} -eq 0 ] ; do
name_otp=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 40)" --inputbox "# Enter OTP (Default: None):" 0 0) name_otp=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 40)" --inputbox "# Enter OTP (Default: None):" 0 0)
if [ ! -z "${name_otp}" ] ; then if [ ! -z "${name_otp}" ] ; then
name_otp=$(removeSpaces "${name_otp}") name_otp=$(spaceForDot "${name_otp}")
name_otp=$(vault_key_encrypt "${name_otp}") name_otp=$(vault_key_encrypt "${name_otp}")
otp_text=$(vault_key_encrypt "OTP") otp_text=$(vault_key_encrypt "OTP")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/otp" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/otp"
@ -346,7 +357,7 @@ function create_bcard_vault_entry() {
while [ ${card_entry} -eq 0 ] ; do while [ ${card_entry} -eq 0 ] ; do
name_card=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 40)" --inputbox "# Enter Card Number (XXXX-XXXX-XXXX-XXXX):" 0 0) name_card=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 40)" --inputbox "# Enter Card Number (XXXX-XXXX-XXXX-XXXX):" 0 0)
if [ ! -z "${name_card}" ] ; then if [ ! -z "${name_card}" ] ; then
name_card=$(removeSpaces "${name_card}") name_card=$(spaceForDot "${name_card}")
name_card=$(vault_key_encrypt "${name_card}") name_card=$(vault_key_encrypt "${name_card}")
card_text=$(vault_key_encrypt "Card") card_text=$(vault_key_encrypt "Card")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/card" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/card"
@ -358,7 +369,7 @@ function create_bcard_vault_entry() {
while [ ${expiry_entry} -eq 0 ] ; do while [ ${expiry_entry} -eq 0 ] ; do
name_expiry=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter Expiry Date (MM/YY):" 0 0) name_expiry=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter Expiry Date (MM/YY):" 0 0)
if [ ! -z "${name_expiry}" ] ; then if [ ! -z "${name_expiry}" ] ; then
name_expiry=$(removeSpaces "${name_expiry}") name_expiry=$(spaceForDot "${name_expiry}")
name_expiry=$(vault_key_encrypt "${name_expiry}") name_expiry=$(vault_key_encrypt "${name_expiry}")
expiry_text=$(vault_key_encrypt "Expiry") expiry_text=$(vault_key_encrypt "Expiry")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/expiry" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/expiry"
@ -370,7 +381,7 @@ function create_bcard_vault_entry() {
while [ ${cvv_entry} -eq 0 ] ; do while [ ${cvv_entry} -eq 0 ] ; do
name_cvv=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter CVV:" 0 0) name_cvv=$(dialog --stdout --title "# pwsh-vault-dl ${VERSION} $(generate_spaces 20)" --inputbox "# Enter CVV:" 0 0)
if [ ! -z "${name_cvv}" ] ; then if [ ! -z "${name_cvv}" ] ; then
name_cvv=$(removeSpaces "${name_cvv}") name_cvv=$(spaceForDot "${name_cvv}")
name_cvv=$(vault_key_encrypt "${name_cvv}") name_cvv=$(vault_key_encrypt "${name_cvv}")
cvv_text=$(vault_key_encrypt "CVV") cvv_text=$(vault_key_encrypt "CVV")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/cvv" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/cvv"
@ -834,7 +845,7 @@ function edit_entry_vault() {
read_userame_dc=$(vault_key_decrypt "${read_username}") read_userame_dc=$(vault_key_decrypt "${read_username}")
name_username=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter Username (Default: ${read_userame_dc}):" 0 0) name_username=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter Username (Default: ${read_userame_dc}):" 0 0)
if [ ! -z "${name_username}" ] ; then if [ ! -z "${name_username}" ] ; then
name_username=$(removeSpaces "${name_username}") name_username=$(spaceForDot "${name_username}")
name_username=$(vault_key_encrypt "${name_username}") name_username=$(vault_key_encrypt "${name_username}")
username_text=$(vault_key_encrypt "Username") username_text=$(vault_key_encrypt "Username")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/login" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/login"
@ -846,7 +857,7 @@ function edit_entry_vault() {
read_password_dc=$(vault_key_decrypt "${read_password}") read_password_dc=$(vault_key_decrypt "${read_password}")
name_password=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter Password (Default: ${read_password_dc}):" 0 0) name_password=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter Password (Default: ${read_password_dc}):" 0 0)
if [ ! -z "${name_password}" ] ; then if [ ! -z "${name_password}" ] ; then
name_password=$(removeSpaces "${name_password}") name_password=$(spaceForDot "${name_password}")
name_password=$(vault_key_encrypt "${name_password}") name_password=$(vault_key_encrypt "${name_password}")
password_text=$(vault_key_encrypt "Password") password_text=$(vault_key_encrypt "Password")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/password" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/password"
@ -870,7 +881,7 @@ function edit_entry_vault() {
read_otp_dc=$(vault_key_decrypt "${read_otp}") read_otp_dc=$(vault_key_decrypt "${read_otp}")
name_otp=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 40)" --inputbox "# Enter OTP (Default: ${read_otp_dc}):" 0 0) name_otp=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 40)" --inputbox "# Enter OTP (Default: ${read_otp_dc}):" 0 0)
if [ ! -z "${name_otp}" ] ; then if [ ! -z "${name_otp}" ] ; then
name_otp=$(removeSpaces "${name_otp}") name_otp=$(spaceForDot "${name_otp}")
name_otp=$(vault_key_encrypt "${name_otp}") name_otp=$(vault_key_encrypt "${name_otp}")
otp_text=$(vault_key_encrypt "OTP") otp_text=$(vault_key_encrypt "OTP")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/otp" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/otp"
@ -895,7 +906,7 @@ function edit_entry_vault() {
read_card_dc=$(vault_key_decrypt "${read_card}") read_card_dc=$(vault_key_decrypt "${read_card}")
name_card=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 40)" --inputbox "# Enter Card Number (Default: ${read_card_dc}):" 0 0) name_card=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 40)" --inputbox "# Enter Card Number (Default: ${read_card_dc}):" 0 0)
if [ ! -z "${name_card}" ] ; then if [ ! -z "${name_card}" ] ; then
name_card=$(removeSpaces "${name_card}") name_card=$(spaceForDot "${name_card}")
name_card=$(vault_key_encrypt "${name_card}") name_card=$(vault_key_encrypt "${name_card}")
card_text=$(vault_key_encrypt "Card") card_text=$(vault_key_encrypt "Card")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/card" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/card"
@ -907,7 +918,7 @@ function edit_entry_vault() {
read_expiry_dc=$(vault_key_decrypt "${read_expiry}") read_expiry_dc=$(vault_key_decrypt "${read_expiry}")
name_expiry=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter Expiry Date (Default: ${read_expiry_dc}):" 0 0) name_expiry=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter Expiry Date (Default: ${read_expiry_dc}):" 0 0)
if [ ! -z "${name_expiry}" ] ; then if [ ! -z "${name_expiry}" ] ; then
name_expiry=$(removeSpaces "${name_expiry}") name_expiry=$(spaceForDot "${name_expiry}")
name_expiry=$(vault_key_encrypt "${name_expiry}") name_expiry=$(vault_key_encrypt "${name_expiry}")
expiry_text=$(vault_key_encrypt "Expiry") expiry_text=$(vault_key_encrypt "Expiry")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/expiry" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/expiry"
@ -919,7 +930,7 @@ function edit_entry_vault() {
read_cvv_dc=$(vault_key_decrypt "${read_cvv}") read_cvv_dc=$(vault_key_decrypt "${read_cvv}")
name_cvv=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter CVV (Default: ${read_cvv_dc}):" 0 0) name_cvv=$(dialog --stdout --title "# Selected Entry ${vault_edit_entry} $(generate_spaces 20)" --inputbox "# Enter CVV (Default: ${read_cvv_dc}):" 0 0)
if [ ! -z "${name_cvv}" ] ; then if [ ! -z "${name_cvv}" ] ; then
name_cvv=$(removeSpaces "${name_cvv}") name_cvv=$(spaceForDot "${name_cvv}")
name_cvv=$(vault_key_encrypt "${name_cvv}") name_cvv=$(vault_key_encrypt "${name_cvv}")
cvv_text=$(vault_key_encrypt "cvv") cvv_text=$(vault_key_encrypt "cvv")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/cvv" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/cvv"

View File

@ -5,7 +5,7 @@
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
# License: GPL v2.0 # # License: GPL v2.0 #
# Last-Change: 24-06-20222 # # Last-Change: 30-06-20222 #
# ######################################################### # #########################################################
VERSION="0.1" VERSION="0.1"
@ -54,6 +54,17 @@ function removeSpaces() {
echo ${wordToConvert} echo ${wordToConvert}
} }
function spaceForDot() {
wordToConvert=${1}
sedtmpfile="${file_code_sec}"
echo "${wordToConvert}" > ${sedtmpfile}
# Remove spaces
sed -i 's/ /·/g' "${sedtmpfile}" &> /dev/null
# Show file without spaces
wordToConvert=$(cat ${sedtmpfile})
echo ${wordToConvert}
}
function removeSpacesURL() { function removeSpacesURL() {
wordToConvert=${1} wordToConvert=${1}
sedtmpfile="${file_code_sec}" sedtmpfile="${file_code_sec}"
@ -279,7 +290,7 @@ function create_login_vault_entry() {
while [ ${username_entry} -eq 0 ] ; do while [ ${username_entry} -eq 0 ] ; do
name_username=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Username:") name_username=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Username:")
if [ ! -z "${name_username}" ] ; then if [ ! -z "${name_username}" ] ; then
name_username=$(removeSpaces "${name_username}") name_username=$(spaceForDot "${name_username}")
name_username=$(vault_key_encrypt "${name_username}") name_username=$(vault_key_encrypt "${name_username}")
username_text=$(vault_key_encrypt "Username") username_text=$(vault_key_encrypt "Username")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/login" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/login"
@ -291,7 +302,7 @@ function create_login_vault_entry() {
while [ ${password_entry} -eq 0 ] ; do while [ ${password_entry} -eq 0 ] ; do
name_password=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Password:") name_password=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Password:")
if [ ! -z "${name_password}" ] ; then if [ ! -z "${name_password}" ] ; then
name_password=$(removeSpaces "${name_password}") name_password=$(spaceForDot "${name_password}")
name_password=$(vault_key_encrypt "${name_password}") name_password=$(vault_key_encrypt "${name_password}")
password_text=$(vault_key_encrypt "Password") password_text=$(vault_key_encrypt "Password")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/password" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/password"
@ -315,7 +326,7 @@ function create_login_vault_entry() {
while [ ${otp_entry} -eq 0 ] ; do while [ ${otp_entry} -eq 0 ] ; do
name_otp=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter OTP (Default: None):") name_otp=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter OTP (Default: None):")
if [ ! -z "${name_otp}" ] ; then if [ ! -z "${name_otp}" ] ; then
name_otp=$(removeSpaces "${name_otp}") name_otp=$(spaceForDot "${name_otp}")
name_otp=$(vault_key_encrypt "${name_otp}") name_otp=$(vault_key_encrypt "${name_otp}")
otp_text=$(vault_key_encrypt "OTP") otp_text=$(vault_key_encrypt "OTP")
echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/otp" echo "${masterkey_load}" > "${pwsh_vault}/logins/${name_entry}/otp"
@ -361,7 +372,7 @@ function create_bcard_vault_entry() {
while [ ${card_entry} -eq 0 ] ; do while [ ${card_entry} -eq 0 ] ; do
name_card=$(echo > /dev/null | pwsh-vaultm -p " Enter Card Number (XXXX-XXXX-XXXX-XXXX):") name_card=$(echo > /dev/null | pwsh-vaultm -p " Enter Card Number (XXXX-XXXX-XXXX-XXXX):")
if [ ! -z "${name_card}" ] ; then if [ ! -z "${name_card}" ] ; then
name_card=$(removeSpaces "${name_card}") name_card=$(spaceForDot "${name_card}")
name_card=$(vault_key_encrypt "${name_card}") name_card=$(vault_key_encrypt "${name_card}")
card_text=$(vault_key_encrypt "Card") card_text=$(vault_key_encrypt "Card")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/card" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/card"
@ -373,7 +384,7 @@ function create_bcard_vault_entry() {
while [ ${expiry_entry} -eq 0 ] ; do while [ ${expiry_entry} -eq 0 ] ; do
name_expiry=$(echo > /dev/null | pwsh-vaultm -p " Enter Expiry Date (MM/YY):") name_expiry=$(echo > /dev/null | pwsh-vaultm -p " Enter Expiry Date (MM/YY):")
if [ ! -z "${name_expiry}" ] ; then if [ ! -z "${name_expiry}" ] ; then
name_expiry=$(removeSpaces "${name_expiry}") name_expiry=$(spaceForDot "${name_expiry}")
name_expiry=$(vault_key_encrypt "${name_expiry}") name_expiry=$(vault_key_encrypt "${name_expiry}")
expiry_text=$(vault_key_encrypt "Expiry") expiry_text=$(vault_key_encrypt "Expiry")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/expiry" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/expiry"
@ -385,7 +396,7 @@ function create_bcard_vault_entry() {
while [ ${cvv_entry} -eq 0 ] ; do while [ ${cvv_entry} -eq 0 ] ; do
name_cvv=$(echo > /dev/null | pwsh-vaultm -p " Enter CVV:") name_cvv=$(echo > /dev/null | pwsh-vaultm -p " Enter CVV:")
if [ ! -z "${name_cvv}" ] ; then if [ ! -z "${name_cvv}" ] ; then
name_cvv=$(removeSpaces "${name_cvv}") name_cvv=$(spaceForDot "${name_cvv}")
name_cvv=$(vault_key_encrypt "${name_cvv}") name_cvv=$(vault_key_encrypt "${name_cvv}")
cvv_text=$(vault_key_encrypt "CVV") cvv_text=$(vault_key_encrypt "CVV")
echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/cvv" echo "${masterkey_load}" > "${pwsh_vault}/bcard/${name_entry}/cvv"
@ -873,7 +884,7 @@ function edit_entry_vault() {
read_userame_dc=$(vault_key_decrypt "${read_username}") read_userame_dc=$(vault_key_decrypt "${read_username}")
name_username=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Username (Default: ${read_userame_dc}):") name_username=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Username (Default: ${read_userame_dc}):")
if [ ! -z "${name_username}" ] ; then if [ ! -z "${name_username}" ] ; then
name_username=$(removeSpaces "${name_username}") name_username=$(spaceForDot "${name_username}")
name_username=$(vault_key_encrypt "${name_username}") name_username=$(vault_key_encrypt "${name_username}")
username_text=$(vault_key_encrypt "Username") username_text=$(vault_key_encrypt "Username")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/login" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/login"
@ -885,7 +896,7 @@ function edit_entry_vault() {
read_password_dc=$(vault_key_decrypt "${read_password}") read_password_dc=$(vault_key_decrypt "${read_password}")
name_password=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Password (Default: ${read_password_dc}):") name_password=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter Password (Default: ${read_password_dc}):")
if [ ! -z "${name_password}" ] ; then if [ ! -z "${name_password}" ] ; then
name_password=$(removeSpaces "${name_password}") name_password=$(spaceForDot "${name_password}")
name_password=$(vault_key_encrypt "${name_password}") name_password=$(vault_key_encrypt "${name_password}")
password_text=$(vault_key_encrypt "Password") password_text=$(vault_key_encrypt "Password")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/password" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/password"
@ -909,7 +920,7 @@ function edit_entry_vault() {
read_otp_dc=$(vault_key_decrypt "${read_otp}") read_otp_dc=$(vault_key_decrypt "${read_otp}")
name_otp=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter OTP (Default: None):") name_otp=$(echo > /dev/null | pwsh-vaultm -p "爵 Enter OTP (Default: None):")
if [ ! -z "${name_otp}" ] ; then if [ ! -z "${name_otp}" ] ; then
name_otp=$(removeSpaces "${name_otp}") name_otp=$(spaceForDot "${name_otp}")
name_otp=$(vault_key_encrypt "${name_otp}") name_otp=$(vault_key_encrypt "${name_otp}")
otp_text=$(vault_key_encrypt "OTP") otp_text=$(vault_key_encrypt "OTP")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/otp" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/otp"
@ -934,7 +945,7 @@ function edit_entry_vault() {
read_card_dc=$(vault_key_decrypt "${read_card}") read_card_dc=$(vault_key_decrypt "${read_card}")
name_card=$(echo > /dev/null | pwsh-vaultm -p " Enter Card Number (Default: ${read_card_dc}):") name_card=$(echo > /dev/null | pwsh-vaultm -p " Enter Card Number (Default: ${read_card_dc}):")
if [ ! -z "${name_card}" ] ; then if [ ! -z "${name_card}" ] ; then
name_card=$(removeSpaces "${name_card}") name_card=$(spaceForDot "${name_card}")
name_card=$(vault_key_encrypt "${name_card}") name_card=$(vault_key_encrypt "${name_card}")
card_text=$(vault_key_encrypt "Card") card_text=$(vault_key_encrypt "Card")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/card" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/card"
@ -946,7 +957,7 @@ function edit_entry_vault() {
read_expiry_dc=$(vault_key_decrypt "${read_expiry}") read_expiry_dc=$(vault_key_decrypt "${read_expiry}")
name_expiry=$(echo > /dev/null | pwsh-vaultm -p " Enter Expiry Date (Default: ${read_expiry_dc}):") name_expiry=$(echo > /dev/null | pwsh-vaultm -p " Enter Expiry Date (Default: ${read_expiry_dc}):")
if [ ! -z "${name_expiry}" ] ; then if [ ! -z "${name_expiry}" ] ; then
name_expiry=$(removeSpaces "${name_expiry}") name_expiry=$(spaceForDot "${name_expiry}")
name_expiry=$(vault_key_encrypt "${name_expiry}") name_expiry=$(vault_key_encrypt "${name_expiry}")
expiry_text=$(vault_key_encrypt "Expiry") expiry_text=$(vault_key_encrypt "Expiry")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/expiry" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/expiry"
@ -958,7 +969,7 @@ function edit_entry_vault() {
read_cvv_dc=$(vault_key_decrypt "${read_cvv}") read_cvv_dc=$(vault_key_decrypt "${read_cvv}")
name_cvv=$(echo > /dev/null | pwsh-vaultm -p " Enter CVV (Default: ${read_cvv_dc}):") name_cvv=$(echo > /dev/null | pwsh-vaultm -p " Enter CVV (Default: ${read_cvv_dc}):")
if [ ! -z "${name_cvv}" ] ; then if [ ! -z "${name_cvv}" ] ; then
name_cvv=$(removeSpaces "${name_cvv}") name_cvv=$(spaceForDot "${name_cvv}")
name_cvv=$(vault_key_encrypt "${name_cvv}") name_cvv=$(vault_key_encrypt "${name_cvv}")
cvv_text=$(vault_key_encrypt "cvv") cvv_text=$(vault_key_encrypt "cvv")
echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/cvv" echo "${masterkey_load}" > "${pwsh_vault}/${vault_edit_entry}/cvv"