#!/usr/bin/perl use strict; use warnings; use Crypt::CBC; use MIME::Base64; use File::Slurp; # 配置加密参数 my $key = '*********'; # 选择一个合适的密钥 my $cipher = Crypt::CBC->new( -key => $key, -cipher => 'Crypt::AES', ); # 读取原始脚本 my $script = read_file('task_manager.pl'); # 加密脚本 my $ciphertext = $cipher->encrypt_hex($script); write_file('hello_encrypted.pl', $ciphertext);
print "Script encrypted and saved to hello_encrypted.pl\n";
[mnt-rw] comment = Read-Write Mount Point browseable = yes path = /mnt force user = root create mask = 0775 directory mask = 0775 guest ok = Yes read only = No
[onecloud-share] comment = Read-Only OneCloud Share browseable = yes path = /mnt guest ok = Yes read only = yes
$ openssl genrsa -des3 -out root.key 2048 Generating RSA private key, 2048 bit long modulus ..............................................................+++ ................+++ e is 65537 (0x010001) Enter pass phrase for root.key:
Verifying - Enter pass phrase for root.key:
生成 ca 证书,自签 20 年有效期,并将此 ca 证书导入需要访问的 PC 的“受信任的根证书颁发机构”中,后续用此 ca 签署的证书均可正常使用:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
$ openssl req -x509 -new -nodes -key root.key -sha256 -days 7300 -out root.crt Enter pass phrase for root.key:
You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:CN # 国家 State or Province Name (full name) [Some-State]:SiChuan # 省份 Locality Name (eg, city) []:ChengDu # 城市 Organization Name (eg, company) [Internet Widgits Pty Ltd]:Sichuan Lingyun Technology Co., LTD # 组织 Organizational Unit Name (eg, section) []: # 部门 Common Name (e.g. server FQDN or YOUR name) []:Sichuan Lingyun Technology Co., LTD # 公司 Email Address []: # 邮箱
完成上述步骤后,创建 ssl 证书私钥:
1 2 3 4 5
$ openssl genrsa -out server.key 2048 Generating RSA private key, 2048 bit long modulus ...................................................................................+++ ..........+++ e is 65537 (0x010001)
$ openssl req -new -key server.key -out server.csr You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:CN State or Province Name (full name) [Some-State]:SiChuan Locality Name (eg, city) []:ChengDu Organization Name (eg, company) [Internet Widgits Pty Ltd]:Sichuan Lingyun Technology Co., LTD Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []:Sichuan Lingyun Technology Co., LTD Email Address []:
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
# Local Search # Dependencies: https://github.com/theme-next/hexo-generator-searchdb local_search: enable: true # If auto, trigger search by changing input. # If manual, trigger search by pressing enter key or search button. trigger: auto # Show top n results per article, show all results by setting to -1 top_n_per_article: 1 # Unescape html strings to the readable one. unescape: false # Preload the search data when the page loads. preload: false