f 怎麼加密你寫的perl script ~ 迪貝之家

怎麼加密你寫的perl script

這是怎麼把你的perl script 在RH 7.6 打包成執行檔, port 到其他主機上執行延伸
因為打包出來的執行檔可以透過壓縮軟體打開來,看到你的原始碼,我是透過 Filter-Crypto-2.08

首先呢!! 你得安裝openssl 開發套件

yum install openssl openssl-devel

然後下載Filter-Crypto-2.08
wget https://cpan.metacpan.org/authors/id/S/SH/SHAY/Filter-Crypto-2.08.tar.gz

解壓縮後,進到該目錄
執行perl  Makefile.PL
它會問一堆問題,就照預設回應就可以了
接著 make;make install
我的環境會安裝到/usr/local/lib64/perl5
所以再把它tar起來,傳到要執行的環境解開蓋過就好了
當然你的執行環境也得安裝openssl 開發套件
最後當然就是打包你的perl script
pp  -f Crypto -M Filter::Crypto::Decrypt -g -B -I /usr/local/lib64/perl5 -I /usr/local/share/perl5 -o ./log3 ./log3.pl

log3.pl在打包裡的內容改變了,如下
use Filter::Crypto::Decrypt;

9dc0f69825167b4fa369ce0915fcc44edf96f17c206c7bdbfd6a653a64836daf699301072759fa2bf7887f7beb9d3485d690c308c17c5cfff28d88c77f456a73ffcfad267a349e89942a644e8b463e6ce880111a29fab960bdea999920cb37acf2a1578ef5a791dd8d536a968fb1446609cb31297399c1391c8918b5f287a8139e6a44e15aaef516729c25f2f0e0a155be7ca4f6bad0dcaa9d75fa73823584b390b30ad61e314d6b79fc12b3833d7e3481a4f02fe81fb13427dad5d0b867c3945a3dd70ed71f8aa2de27c8c9f27a5466f5e16b9ffdd648a757940a34da3da85bb2504895e2b817f7471bd408f671d5dc21ea2a8c2182344d876b5b13d5beae79f3af16e23c6a5715b6bdd1ddcc1a93921d57b87c866ca06276ba212f36cd3971bbcb9c3c124a7ab0510ed01cf997458a0ebcb0dcdac4531f9239d35871a608e46042e2076f0627881f4d460854228a5e9c213d331c994e45b17ac428972b9e5a42c0de1ca34e307a6d27cc6387efce696285ee510ed6dd1618b037d3dca4a84f69f9c48178370f00ee5c307b12d85b6d19dbad71148cbb30fa87c861c7a9cf5306c739a610521005b738a85e3f6569b81da4d7346a48785080677da06d1d81694ecc37203d5a488ea8f068ce8410f51a50357702131c4e13f6f3dfa88954b6ca2b21a5d10f027e60fae5962bd9bb58479326dc3d74173a6cd5fbe8abd669c121a6c3291db310546a0abb34c080e3d2982e02405fec8615fd23bff3a301645008754029590a5399009e1f71b61ee097e7b71cc5feb68bc9400e60b0958d6cee1d7336fd7a0281ea8cffbcbae718544237c5a501e3d3ef6a11656e20d9802cf9936936752ee8c4f950a3feadfc6bdbaa3d6394a1430581f87fa610e48588cfd885e1b4f4ec11cca19a7496e2be1cad4c8553936d395bffd7b40c7c521938ced781b7856684feadc517e4d588a5a7d5feafb5530063cd803c79fe57e9c507e5d3040d60077e2215650c75d99f9db0caef2fdabec48fddaac277f18e76adf9c1b51628607cae3957eed0423840bf42f7d2374ecf1749a6298b60d2620a198655ffc33dc94e5add083c3b86d0002662931bfa061546c9b01e0d64adf56f1135a362b65e8cdc73aa1664fa3bcdf8d91ab35332dda432c13a99cc416d98b45231ee91e925b8439a0c907bfab6995befe1be55d87a0eb515b84e85e9ef3ac3123be519049726112b777072d6c86b2752b81da347a08d38acb9866506c28b39efab71f499970ae2b22f433dfdf1a50a8d4208327f95ec7cdbb0ee2c7ff82508a33e6d84e924861630af5838e891bdc0bf68de826cf2249185bdc3e873bf2f184e64df0380ed43704982e71faadafe2ac3d052bfbe6d0e2aa76e4bad78f36c2c7300b3abfd391d3f0a62b3ba522d88cb5aa523ecf2d07dddb939176800407f1fa5146b2255fea9610fac2139e3b33d3087ab9ee54918337d130ca829d8341cdb373131da5dbd88ab03798da3104b5c83655c073aef25402217aa0deb6c3187907d44e3cbd0d073b71ba12d11a3e146ff8b9464fc717ef477ff9ba82bc429b89a12fc62e436e9fedda97cc671906819e007e20e936fe530e4ae4fbf2baa3e8500b9f3231799e8e86be1ac675b228c377247f7df542181c0f14623bde44e22fc949340f88fcd51516dde8a0907538f2dc31dac6bbb2cf82af5e924b396c0a4ef1d450f7d8c0a8a0d2973f73fe0e045c85fe1baea9dd062e63df8263a2dd18fcaf4238f8f248b6dad15b673d4f585e2f1a0f09b54e0044f88dc10010d39d6fba4749f9815dc7cf9d01424cc4efb48b7dab663268eed0e0b447dcd247ea1d21cfac2d032181695fab2763030d8a04f6b97bf1484f76c8545581ec239b401430fdb969bd15a31d2f7c0a843a4b7e0483adda2ab5a2d9597c4a4ef6534a0ce938e9491c2ab4248a3830c3c8c886d41904232fb4fdd536baf428f4a2637a29a98685e880342c965388f7933ac4e217825bdc0e3b126e75af79eedaae79aa26186485fb41c9ad4516136f0437e5adfc24c8d832b29cc8450c39273dcc19d4c8a7dacbe3c5ddebe89f47d4b507bff8433e466a0f61c100a440a5abe759f01beffdc9889fd96eef17704f4713cfe022dbc3199a6e37f442861214f01ea262bae3451e32e1d5c7bb183be32fa193d91f4d9e9