HOME | linux | openPGP壓縮

openPGP壓縮

2014/04/03/15:33 , Post in linux , 評論(0) , 引用(0) , 閱讀(2387) , Via 本站原創
先安裝兩個套件
yum install gnupg2.x86_64

接下來啟動pgp agent
gpg-agent --daemon --use-standard-socket

然後產生key,產生key之前先將修改編碼以免等等出現亂碼
export LC_ALL=C
gpg --gen-key

最後壓縮文件命令如下
tar czvpf - file file2 file3 | gpg --symmetric --cipher-algo aes256 -o filename.tar.gz.gpg

解壓縮
gpg -d filename.tar.gz.gpg | tar xzvf -

使用key加密

gpg--output <加密後的檔案> --encrypt --recipient <接收者的ID> <欲加密的原始檔案> 。

使用key解密

gpg --output <解密後的檔案> --decrypt <要解密的加密檔>

簽章同時加密

gpg--armor --output <加密後檔案> --encrypt --recipient <要加密的檔案>

匯出pubilc key

gpg --armor --output public.asc --export tszheng@twnic.net.tw

匯入public key

gpg --import public.asc

發表評論

暱稱

網址

電郵

開啟HTML 開啟UBB 開啟表情 隱藏 記住我 [登入] [註冊]