PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Custom Shift Cypher Generator

Go down

 Custom Shift Cypher Generator Empty Custom Shift Cypher Generator

Post by jamied_uk 19th April 2021, 15:07

Vid Link


jnet.sytes.net/rumble/cypher/index.php

https://rumble.com/vg30yj-bash-unshift-cypher-script-reup.html



Rumble("play", {"video":"vdgu3z","div":"rumble_vdgu3z"});



First setup figlet

Code:
sudo apt install -y figlet

Here is the bash script, have fun!

Code:
#!/bin/bash
# (c) J~Net 2021
# jnet.sytes.net
#
# https://jnet.forumotion.com/t1731-custom-shift-cypher-generator#2680
#
# ./custom_rotate.sh hello 5
#
# P.S you will need figlet installed for full experience!
#
red=`tput setaf 1`
green=`tput setaf 2`
bluealt=`tput setaf 3`
blue=`tput setaf 4`
reset=`tput sgr0`
echo -e "${green}Welcome To Custom Shift Cypher Generator By"
echo -e "${blue}"
echo "(c)J~Net 2021" | figlet
#
if [ -z "$1" ]
then
  read -p "Enter Phrase : " phrase
  else
  phrase=$1
fi
#
# Convert upper case to lower!
val=$(echo "$phrase" | tr '[:upper:]' '[:lower:]') # You can reverse this and make it all upper case!
phrase=$val
#
if [ -z "$2" ]
then
  read -p "Enter Number To Rotate By (Less than 26) For Example Key E=4: " rotat
else
  rotat=$2
fi
#
#rotat=$rotat-1
Frotat=$((rotat - 1))
#
dual="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
# The next two lines have been commented out but could be hardcoded!
#phrase='hello there'
#rotat=13
newphrase=$(echo $phrase | tr "${dual:0:26}" "${dual:${rotat}:26}") #Frotate also could be used!
#
echo -e "${blue}"
echo "New Cypher With Key Shift (Shift Rotation : $rotat)"
# Show key shift to reverse this generator 26- the key = the reverse shift key)
undo=$((26 - $rotat))
echo "Shift Key To Reverse Is: $undo"
echo ""
echo ${newphrase}

Make executable

Code:
sudo chmod +x *.sh

Then Run

Code:
./custom_rotate.sh hello 5

It will ask for the phrase you want to be shifted!
You also will be asked to put in the shift value, for example if you want the key of E, use the number 4.

As you can see above, you can put these values in as arguments.


Last edited by jamied_uk on 25th April 2021, 23:02; edited 9 times in total
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

 Custom Shift Cypher Generator Empty Re: Custom Shift Cypher Generator

Post by jamied_uk 19th April 2021, 20:40

Working Example:

Key of E (Shift Of 4)
Code:
 ./custom_rotate.sh OKWL 4


Output:
New Cypher With Key Shift (Shift Rotation : 4)

soap
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

 Custom Shift Cypher Generator Empty Re: Custom Shift Cypher Generator

Post by jamied_uk 25th April 2021, 22:32

Unshift Script

Code:
#!/bin/bash
# (c) J~Net 2021
# jnet.sytes.net
#
# https://jnet.forumotion.com/t1731-custom-shift-cypher-generator#2680
#
# ./custom_unrotate.sh "hello" "5"
#
# P.S you will need figlet installed for full experience!
#
red=`tput setaf 1`
green=`tput setaf 2`
bluealt=`tput setaf 3`
blue=`tput setaf 4`
reset=`tput sgr0`
echo -e "${green}Welcome To Custom UnShift Cypher By"
echo -e "${blue}"
echo "(c)J~Net 2021" | figlet
#
if [ -z "$1" ]
then
  read -p "Enter Phrase : " phrase
  else
  phrase=$1
fi
#
# Convert upper case to lower!
val=$(echo "$phrase" | tr '[:upper:]' '[:lower:]') # You can reverse this and make it all upper case!
phrase=$val
#
if [ -z "$2" ]
then
  read -p "Enter Number To Rotate By (Less than 26) For Example Key E=4: " rotat
else
  rotat=$2
fi
#
#rotat=$rotat-1
undo=$((26 - $rotat))
Frotat=$((rotat - 1))
#
dual="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
# The next two lines have been commented out but could be hardcoded!
#phrase='hello there'
#rotat=13
newphrase=$(echo $phrase | tr "${dual:0:26}" "${dual:${undo}:26}") #Frotate also could be used!
#
echo -e "${blue}"
echo "Cypher With Shift Of $rotat With (Undo Shift Rotation : $undo)"
# Show key shift to reverse this generator 26- the key = the reverse shift key)

echo ""
echo ${newphrase}

jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

 Custom Shift Cypher Generator Empty Re: Custom Shift Cypher Generator

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum