#!/usr/bin/bash

USERNAME=`sed -n 1p $HOME/shell/.user_pass`
PASSWORD=`sed -n 2p $HOME/shell/.user_pass`

function decstr()
{
        local user=$1
        local pass=$2
        local str_key=5
        local usresult=""
        local psresult=""
        if [ "X" = "X$user" ]
        then
        return 1
        fi
        if [ "X" = "X$pass" ]
                then
                return 2
        fi
        if [ "X" = "X$str_key" ]
                then
                return 3
        fi
        usresult=`echo $user | openssl enc -aes-256-cfb -d -base64 -k $str_key`
        psresult=`echo $pass | openssl enc -aes-256-cfb -d -base64 -k $str_key`
        echo $usresult"/"$psresult
        return 0
}

result=`decstr $USERNAME $PASSWORD`
echo $result

  

posted on 2018-04-26 15:38  明星程序员  阅读(172)  评论(0)    收藏  举报