67.jpg

function gen_code(){
    local enc_code=`echo $mac | openssl aes-128-cbc -k etherlinks -base64 -pbkdf2 -iter 100`
    log_suss "\n您的机器码为: $enc_code"
}

解码:

function detect_status(){
    if [ ! -f /opt/etherlinks ];then
        status=`echo -e "\033[31m未激活\033[0m"`
    else
        local enc_code=`sudo cat /opt/etherlinks`
        local dec_code=`echo $enc_code | openssl des3 -d -k "etherlinks" -base64 -pbkdf2 -iter 100`
        if [ $dec_code == $mac ];then
            status=`echo -e "\033[32m已激活\033[0m"`
        else 
            status=`echo -e "\033[31m未激活\033[0m"`
            log_err_pause "激活失败!\n请检查激活码!"
        fi
    fi
}

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code