Linux 对文件进行加密存放

/**********************************************************************
 *                 Linux 对文件进行加密存放
 * 说明:
 *     GitHub存放一些代码是比较好的,不过对于一些需要稍微保密一下的内容,
 * 可以考虑对其进行加密存放,记得别忘了密码。
 *
 *                                2018-5-4 深圳 宝安西乡 曾剑锋
 *********************************************************************/

一、参考文档:
    1. Linux文件加密工具
        http://blog.topspeedsnail.com/archives/4777

二、gpg加密:
    zengjf@zengjf:~/zengjf/gpg$ ls
    zengjf.md
    zengjf@zengjf:~/zengjf/gpg$ gpg -c zengjf.md
    gpg: directory `/home/zengjf/.gnupg' created
    gpg: new configuration file `/home/zengjf/.gnupg/gpg.conf' created
    gpg: WARNING: options in `/home/zengjf/.gnupg/gpg.conf' are not yet active during this run
    gpg: keyring `/home/zengjf/.gnupg/pubring.gpg' created
    zengjf@zengjf:~/zengjf/gpg$ ls
    zengjf.md  zengjf.md.gpg
    zengjf@zengjf:~/zengjf/gpg$ cat zengjf.md
    zengjf
    file
    test
    zengjf@zengjf:~/zengjf/gpg$ cat zengjf.md.gpg
    ▒t▒f▒R`▒N▒焝▒F▒
    r▒▒▒mK▒$̺▒VG▒▒Z▒▒▒▒▒s▒,zengjf@zengjf:~/zengjf/gpg$
    zengjf@zengjf:~/zengjf/gpg$ rm zengjf.md
    zengjf@zengjf:~/zengjf/gpg$ gpg zengjf.md.gpg
    gpg: keyring `/home/zengjf/.gnupg/secring.gpg' created
    gpg: AES encrypted data
    gpg: gpg-agent is not available in this session
    gpg: encrypted with 1 passphrase
    zengjf@zengjf:~/zengjf/gpg$ ls
    zengjf.md  zengjf.md.gpg
    zengjf@zengjf:~/zengjf/gpg$ cat zengjf.md
    zengjf
    file
    test
    zengjf@zengjf:~/zengjf/gpg$

 

你可能感兴趣的:(Linux 对文件进行加密存放)