markdown 使用GPG算法加密和解密文件 - https://www.gnupg.org/

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 使用GPG算法加密和解密文件 - https://www.gnupg.org/相关的知识,希望对你有一定的参考价值。

# Remove existing GPG Secret Keys
gpg --delete-secret-keys "Vignesh T.V."

# Remove existing GPG Public Keys
gpg --delete-keys "Vignesh T.V."

# Generate GPG Keys
gpg --gen-key

# Export GPG Public Key
gpg --output ./mygpg.key --armor --export vigneshviswam@gmail.com

# Export GPG Private Key
gpg --list-secret-keys
(Get the ID from there and replace the ID below)

gpg --export-secret-keys 0009E10FB8CF0BD4699A72257250F6DB43FE74C2 > gpg-private.asc

# Encrypt the file using GPG
gpg --trust-model always --encrypt --armor -o ./encrypted.asc -r vigneshviswam@gmail.com ./file.txt

-------------------

Decryption

# Import Private Key
gpg --import gpg-private.asc

# Find GPGConf directories
gpgconf –list-dirs

# Create GPGConf file in any of those directories with name gpg-agent.conf and with content
allow-loopback-pinentry

# Reload GPG Agent
gpgconf --kill gpg-agent
gpg-connect-agent reloadagent /bye

# Create a .bat file with these contents (%1 is the command line argument to be passed from NiFi)
echo <PASSPHRASE>|gpg --pinentry-mode loopback --batch --passphrase-fd 0 -d %1

以上是关于markdown 使用GPG算法加密和解密文件 - https://www.gnupg.org/的主要内容,如果未能解决你的问题,请参考以下文章

安全和加密——openssl及自建CA

利用Gpg4win来打造一个安全的加密文件

小工具之gpg加密解密

Oracle PL/SQL dbms_crypto 包可以解密使用 Linux gpg 命令加密的文件吗?

加密解密:文件加密

gpg加密使用