gnupg

How to set the GnuPG home directory within the GnuPG Python binding?

会有一股神秘感。 提交于 2019-11-30 15:41:24
问题 When trying to initialize the GnuPG binding in Python, I'm getting an error message TypeError: __init__() got an unexpected keyword argument 'gnupghome' This is the code I'm running: import gnupg gpg = gnupg.GPG(gnupghome='C:\Users\samss\AppData\Roaming\gnupg') input_data = gpg.gen_key_input(key_type="RSA", key_length=1024, passphrase='n0sm@sy0') key =gpg.gen_key(input_data) print key What am I doing wrong here? 回答1: You should refer to the gnupg documentation as it uses homedir at the place

Best way to soft brute-force your own GPG/PGP passphrase?

风流意气都作罢 提交于 2019-11-30 13:42:45
问题 I created a nice long passphrase, used it a few times, then forgot it ;) The twist is, I know the general theme and probably almost all of the characters. The perfectionist in me doesn't want to revoke the key or anything like that (and I think I need the passphrase to revoke it anyway, right?). I feel I should be able to have a good go at this by brute-forcing the likely layouts/characters that I've got wrong/mis-typed. I wrote a C program to produce such combinations. Unfortunately I don't

gpg: skipped “N”: secret key not available

前提是你 提交于 2019-11-30 13:13:13
问题 1. Summary I can not begin to use Gpg4win. 2. Expected behavior Successfully commits. 3. Actual behavior SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub $ git commit -m "[Test] gpg4win" gpg: skipped "DBA8E7A2": secret key not available gpg: signing failed: secret key not available error: gpg failed to sign the data fatal: failed to write commit object 4. Steps to reproduce 1. Set I install Gpg4win → I set Gpg4win as in this and this answers: SashaChernykh@DESKTOP-EEOT0TN D:\SashaGitHub $ gpg -

gpg: can't connect to the agent: IPC connect call failed

偶尔善良 提交于 2019-11-30 08:37:33
I am having a problem while trying to decrypt some keys using GPG. The following output is given to me: gpg: can't connect to the agent: IPC connect call failed I already edited some files, pointed in this tutorial: https://michaelheap.com/gpg-cant-connect-to-the-agent-ipc-connect-call-failed/ but with no success. Possible reasons for that? Thanks in advance There is probably already a gpg-agent running on the system, which your gpg command is unable to connect to. If you do a pkill -9 gpg-agent and then source <(gpg-agent --daemon) to restart the agent, you should be able to connect to the

PGP/GPG Signed Python code

六月ゝ 毕业季﹏ 提交于 2019-11-30 07:07:46
I'd like to (PGP/GPG) sign python code. Yes, I have read this and many other sites that talk about protecting and obfuscating python code - this all is not what I want. I DON'T want to obfuscate code. I want customers and users to see the code, they could modify code, copy it and make derivative work, I'd like to have the software under the GPLv3. But I want to have plugins that are "signed", so they can be kind of trusted during execution. Is this possible in Python? Can I import a library after checking its gpg signing? What would be easy: check the gpg signing of a file, and then load it

【转】GnuPG使用介绍

自作多情 提交于 2019-11-30 06:20:17
一、什么是 GPG 要了解什么是 GPG,就要先了解 PGP 。 1991 年,程序员 Phil Zimmermann 为了避开政府监视,开发了加密软件 PGP。这个软件非常好用,迅速流传开来,成了许多程序员的必备工具。但是,它是商业软件,不能自由使用。所以,自由软件基金会决定,开发一个 PGP 的替代品,取名为 GnuPG。这就是 GPG 的由来。 GPG 有许多用途,本文主要介绍文件加密。至于邮件的加密,不同的邮件客户端有不同的设置,请参考 Ubuntu 网站的 介绍 。 本文的使用环境为 Linux 命令行。如果掌握了命令行, Windows 或 Mac OS 客户端,就非常容易掌握。GPG 并不难学,学会了它,从此就能轻松传递加密信息。建议读者一步步跟着教程做,对每条命令都自行测试。 二、安装 GPG 有两种安装方式。可以 下载源码 ,自己编译安装。 ./configure make make install 也可以安装编译好的二进制包。 # Debian / Ubuntu 环境 sudo apt-get install gnupg # Fedora 环境 yum install gnupg 安装完成后,键入下面的命令: gpg --help 如果屏幕显示 GPG 的帮助,就表示安装成功。 三、生成密钥 安装成功后,使用 gen-ken 参数生成自己的密钥。 gpg -

Git signed commits - How to suppress “You need a passphrase to unlock the secret key…”

谁都会走 提交于 2019-11-30 05:01:15
I changed my global Git configuration to sign all commits. I also use gpg-agent so that I don't have to type my password every time. Now every time I make a new commit I see the following five lines printed to my console: [blank line] You need a passphrase to unlock the secret key for user: "John Doe <mail@gmail.com>" 2048-bit RSA key, ID ABCDEF12, created 2016-01-01 [blank line] Even worse, when I do a simple stash, this message is printed twice , needlessly filling my console (I assume for one for each of the two commit objects that are created). Is there a way to suppress this output? VonC

gpg decryption fails with no secret key error

荒凉一梦 提交于 2019-11-30 02:55:51
I have a gpg .key file that is used as passphrase for decrypting a .dat.pgp file. The encrypted .data.pgp file gets successfully decrypted on one server with same .key file using following command cat xxx_gpg.key | /usr/bin/gpg --batch --quiet -o xxx.dat --passphrase-fd O -d xxx.dat.pgp But, when I move same key to another server xxx_gpg.key and run same above command, I get following error - gpg: decryption failed: No secret key EDIT: I find that gpg --list-secret-keys returns some data on server where it works but no results are returned for other server. How can we configure secret key

How to retain commit gpg-signature after interactive rebase squashing?

好久不见. 提交于 2019-11-30 01:37:55
When I want to squash some commits by interactive rebase : git rebase -i HEAD~3 And then: pick cbd03e3 Final commit (signed) s f522f5d bla-bla-bla (signed) s 09a7b7c bla-bla (signed) # Rebase c2e142e..09a7b7c onto c2e142e ... The final commit haven't gpg-signature despite that all of those commits have same signature. Is it possible to retain commit gpg-signature after interactive rebase squash? Like Cupcake stated, you can't retain the old signature from the unsquashed commits, but you can sign the new squashed commit if you rebase like this: git rebase --interactive --gpg-sign=myemail

PGP: Not enough random bytes available. Please do some other work to give the OS a chance to collect more entropy

纵饮孤独 提交于 2019-11-29 23:26:44
Setup : Ubuntu Server on Virtual Machine with 6 cores and 3GB of RAM. when I am trying to generate a asymmetric key pair via GPG like this gpg --gen-key . I get the following error : Not enough random bytes available. Please do some other work to give the OS a chance to collect more entropy! I tried to google a little bit. This is what I realise , I need to fire up another terminal and type in cat /udev/random --> It randomly generates a series of randomly generated values to increase the entropy. I dont see any change in here watch cat /proc/sys/kernel/random/entropy_avail and it still