Linux generates chain password key shell script

Source: Internet
Author: User
Tags base64


I wrote one of these posts before, but because Ecvps went bankrupt, so I lost two months of data, that article was lost, but I also updated the script method, there will be content generation key chain and no content automatically randomly generated key chain two, the control method is a and B two. A is a random

#!/bin/bash

Random () {
Index=0
Str= ""
T= ' grep ' ((? =[\x21-\x7e]+) [^a-za-z0-9]) '
For I in {A.. Z}; Do arr[index]= $i; index= ' expr ${index} + 1 '; Done
For i in {A.. Z}; Do arr[index]= $i; index= ' expr ${index} + 1 '; Done
For i in {$t}; Do arr[index]= $i; index= ' expr ${index} + 1 '; Done
For i in {0..9}; Do arr[index]= $i; index= ' expr ${index} + 1 '; Done
For i in {1..42}; Do str= "$str ${arr[$RANDOM% $index]}"; Done
#echo $str
S= ' echo $str |cut-c1-42 '
Echo ${s:0:6}-${s:12:6}-${s:18:6}-${s:24:6}-${s:30:6}-${s:36:6}
}
###########################################################################################################
Create () (
ip= ' Ifconfig | Awk-f ' []+|: '/inet addr/{if ($4!~/^192.168|^172.16|^10|^127|^0/) print $} '
Read name
A= ' echo $name |wc-l '
If [$a-lt 6];then
Site= $name. $ip
Else
Site= $name
Fi
Md= ' echo $site |base64-i '
B= ' echo $md |wc-l '
If [$b-lt];then
Stin= ' echo $MD | Md5sum |base64-i '
Else
stin= $MD
Fi
S= ' echo $stin |cut-c1-42 '
Echo ${s:0:6}-${s:12:6}-${s:18:6}-${s:24:6}-${s:30:6}-${s:36:6}
)
###########################################################################################################
echo "# This are to get the character channeling encryption scripting tool"
echo "# Autor:ruclinux"
Echo-e "# \033[31m Please select a channel A=random | B=create \033[0m "
Read AB
If ["$ab" = = "A"]; Then
echo ' Random '
Fi
If ["$ab" = = "B"]; Then
Echo-e "\033[31m Please enter Need to encrypt a string: \033[0m"
Echo ' Create '
Fi
###########################################################################################################

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.