gnupg

How can I force GPG to accept input from STDIN instead of trying to open a file?

此生再无相见时 提交于 2019-12-05 19:34:16
I am trying to incorporate GPG clear-signing of text in a string in a PHP script. I can cause GPG to encrypt text in a string like this: $encrypted = shell_exec("echo '$text' | gpg -e -a -r foo@bar.com --trust-model always"); and that works perfectly, with the encrypted text being sent to the $encrypted variable. This proves GNUPGHOME and GNUPG are set up correctly. However, when I try to produce a clear-signed message in the same way with this: $text = "googar"; $signature = exec("echo $passphrase | gpg -v --clearsign --no-tty --passphrase-fd 0 '$text' 2>&1 1> /dev/null", $output); I am

How to use GnuPG inside Docker containers, as it is missing entropy?

纵饮孤独 提交于 2019-12-05 17:59:57
问题 I need to dockerize an apt repository. The packages in it need to be signed, which is currently done by aptly publish snapshot -distribution="stable" -gpg-key="<key id>" my-snapshot Before that a key needs to be created using gpg --gen-key . But this way the private key will be crated inside the docker image, which doesn't seem to be a good practice. Besides, id doesn't even work; running gpg --gen-key --batch <gpg.in gets stuck: Not enough random bytes available. Please do some other work to

Go - Golang openpg - Create Key pair and create signature

…衆ロ難τιáo~ 提交于 2019-12-05 15:56:01
I'm currently working on openpgp in combination with golang. I use the following code to generate a new keypair and create a self-signature on the resulting public key: package main import ( "bytes" "crypto" "time" "golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp/armor" "golang.org/x/crypto/openpgp/packet" "fmt" ) //Create ASscii Armor from openpgp.Entity func PubEntToAsciiArmor(pubEnt *openpgp.Entity) (asciiEntity string) { gotWriter := bytes.NewBuffer(nil) wr, errEncode := armor.Encode(gotWriter, openpgp.PublicKeyType, nil) if errEncode != nil { fmt.Println("Encoding Armor ",

OpenPGP/X.509 bridge: how to verify public key?

岁酱吖の 提交于 2019-12-05 14:06:59
I'd like to use OpenPGP authentication over TLS , but lack of implementations made me use a temporary solution: an OpenPGP/X.509 bridge certificate. The approach is very similar to the approach used in Foaf: https://svn.java.net/svn/sommer~svn/trunk/misc/FoafServer/pgpx509/src/net/java/dev/sommer/foafserver/utils/PgpX509Bridge.java Basically, you create a certificate request starting from a converted PGP private key, including your converted PGP public key into the certificate request. Then you sign the request with your converted PGP private key. I'm using the word " converted " because

gpg no default secret key error using maven

我的梦境 提交于 2019-12-05 13:12:17
问题 I am trying to publish my maven project in the Central Repository and I need to sign my artifacts. I have downloaded and installed gpg and created my keyring. When I run a "maven clean deploy" in Eclipse, I get the following error: gpg: no default secret key: No secret key gpg: signing failed: No secret key I have searched online and I am not sure what to do. The only reference about gpg in my pom.xml file is <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin<

Maven 'deploy' cause code repackaging after the signing operation (BAD signature)

扶醉桌前 提交于 2019-12-05 12:44:41
I want to deploy an artifact to Sonatype OSS repository. When I deploy with the following command, the signatures are invalid. mvn clean source:jar javadoc:jar install gpg:sign deploy > gpg --verify target/security-versions-1.0.1.jar.asc gpg: assuming signed data in 'target/security-versions-1.0.1.jar' gpg: Signature made 10/20/15 11:45:50 Eastern Daylight Time using RSA key ID 63E38ACF gpg: BAD signature from "Philippe Arteau <philippe.arteau@gmail.com>" [ultimate] If I remove the deploy goal, the signatures are GOOD. mvn clean source:jar javadoc:jar install gpg:sign > gpg --verify target

Inter-convertability of asymmetric key containers (eg: X.509, PGP, OpenSSH)

ⅰ亾dé卋堺 提交于 2019-12-05 11:47:12
Are asymmetrical cryptographic keys fundamentally inter-convertible between the major key container formats? For example, can I convert an X.509 key file into a PGP or OpenGPG key file? And--assuming the answer is yes--is it "security neutral" to keep one key pair in whatever format and convert into whichever container file format is needed for the occasion? I'm getting a little tired of maintaining so many key pairs for X.509, OpenGPG, and SSH, when they're all RSA at the heart. Yes and no: yes, the RSA keys embedded into certificates and privkeys are just numbers. You can extract them from

Choose which secret key to use when doing a gpg --encrypt --sign

痴心易碎 提交于 2019-12-05 10:52:40
问题 I have multiple secret keys in my GPG keyring. I'd like to do a gpg -e -s -a to encrypt, sign, and ascii armor the output. However, I also need to specify which secret key to use for the signature, by key id. 回答1: I needed the --local-user option. gpg -e -s -a --local-user 0xDEADBEEF -r 0x01234567 来源: https://stackoverflow.com/questions/9624384/choose-which-secret-key-to-use-when-doing-a-gpg-encrypt-sign

We encrypt a file for a client using BouncyCastle API. He gets a “For your eyes only” message from PGP when trying to decrypt it. Why?

こ雲淡風輕ζ 提交于 2019-12-05 10:09:43
We use the Bouncy.Castle C# API to do PGP encryption. I am by no means an expert on PGP encryption and the various options available. The encryption seems to run fine, however, when the client tries to decrypt it, he says that PGP won't output to file but only output to screen because it is marked "For your eyes only." This is the --verbose message: pgp --decrypt Client_FileExport_20110510_020011.zip.pgp Client_FileExport_20110511_132203.zip.pgp --info verbose McAfee E-Business Server v8.5 - Full License (c) 1991-2006 McAfee, Inc. All Rights Reserved. Setting temporary directory to C:\DOCUME~1

Recommendations for Java + OpenPGP?

ⅰ亾dé卋堺 提交于 2019-12-05 07:55:41
I want to develop a small OpenPGP client and I'm searching for a Java library for OpenPGP. Are there any (open source) recommendations for this approach? Cryptix.org does not seem alive anymore... guerda I found the BouncyCastle library, for Java and C#. I haven't any experiences with it. I will try it and report here. It provides: A lightweight cryptography API for Java and C#. A provider for the Java Cryptography Extension and the Java Cryptography Architecture. A clean room implementation of the JCE 1.2.1. A library for reading and writing encoded ASN.1 objects. A light weight client-side