gpg

GPG: How does key signing work and how is it done?

I've been reading various tutorials about GPG, and many of them mention that keys may be signed by other people to verify their authenticity. Unfortunately, I have been unable to find information regarding exactly how this process works. How does one sign a key, and how is the signed key used (different from the previous key)? Thank you...

How to run gpg from a script run by cron?

I have a script that has a part that looks like that: for file in `ls *.tar.gz`; do echo encrypting $file gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \ --simple-sk-checksum -c $file done For some reason if I run this script manually, works perfectly fine and all files are encrypted. If I run this as cron job, e...

PGP signatures from Python?

What is the easiest way to create and verify PGP/GPG signatures from within a Python application? I can call pgp or gpg using subprocess and parse the output, but I was looking for a way that didn't require an external program to be installed (my application is cross-platform mac/windows/unix). ...

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

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 n...

GnuPG: "decryption failed: secret key not available" error from gpg on Windows

Environment: HP laptop with Windows XP SP2 I had created some encrypted files using GnuPG (gpg) for Windows. Yesterday, my hard disk failed so I had reimage the hard disk. I have now reinstalled gpg and regenerated my keys using the same passphrase as earlier. But, I am now unable to decrypt the files. I get the following error: ...

Batch file script to remove special characters from filenames (Windows)

I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g. Störung%20.doc would be renamed ...

Splitting GPG encrypted messages into packets?

As an example, let's say that Alice signs a message with her secret key and encrypts the message and signature with Trent's public key. Trent decrypts the message and signature with his secret key, verifies Alice's signature using her public key, and then re-encrypts the message and Alice's signature using Bob, Carol and Zoe's public key...

Recommendations for Java + OpenPGP?

Hi! 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... Greetings, guerda ...

C# Stream text/data to zip/gpg instead of passing app a filename?

I currently have an app written in C# that can take a file and encrypt it using gpg.exe What I'm trying to do is, instead of 1. Creating a file (from database queries usually) 2. encrypting the file 3. deleting the non-encrypted file I want to Gather info into memory (into a dictionary or a list or whatever) stream the text/d...

Recommended key size and type for GnuPG?

A Practical Introduction to GNU Privacy Guard in Windows recommends DSA and ElGamal, but I would like to know if RSA is good enough to use these days, and if so, what minimum key size should I use? Is it ok to use SHA-256 for signing (for compatibility with e-mail clients)? Also, beside e-ignite: Key Types, can you point to other source...

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

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 ...

How can I keep a file in memory during editing?

Short version : echo "testing" | vim - | grep "good" This doesn't work as vim won't output to a pipe. It says : "Vim: Warning: Output is not to a terminal". Any way to do this? Cross-editor support would be nice too. I've tried named pipes, but vim won't open them. Long version : echo $passw | gpg -q -d --passphrase-fd 0 $filename | v...

How to do PGP in Python (generate keys, encrypt/decrypt)

I'm making a program in Python to be distributed to windows users via an installer. The program needs to be able to download a file every day encrypted with the user's public key and then decrypt it. So I need to find a Python library that will let me generate public and private PGP keys, and also decrypt files encrypted with the publi...

Python Encryption: Encrypting password using PGP public key

I have the key pair generated by the GPG. Now I want to use the public key for encrypting the password. I need to make a function in Python. Can somebody guide me on how to do this? I studied the Crypto package but was unable to find out how to encrypt the password using the public key. I also read about the chilkat Python encryption l...

Adding a GPG signature to an already signed document?

We'd like to implement a workflow that requires multiple people to digitallly sign a document. If I have multiple secret keys in my own keychain, I can do something as simple as: gpg --sign -u userid1 -u userid2 filename But what do I do if I've got an already signed document and I want to add a signature? One solution would be to h...

Python Pyme: Simple decryption without user interaction

I am using Pyme to interface with GPGME and have had no problems signing / encrypting. When I try to decrypt, however, it always brings up the prompt for the passphrase despite having set it via a c.set_passphrase_cb callback. Am I doing something wrong? ...

Is there a good GnuPG encryption library for Java/Scala?

I would like to be able to encrypt files on disk and/or data in memory using GnuPG from a Java application. If possible I'd like to avoid having to make system calls out to the GPG command line tools. Is there a recommended library, or can you recommend the best approach to GPG encrypting from Java (or Scala)? I'm developing and inten...

GnuPG - How to edit the file without decrypt and save to local disk first?

Hi, I'm using GNUPG to encrypt my ascii files. I learnt to generate a key, also how to use the it to encrypt and decrypt a file. There are two ways I used: gpg -d foo.txt.gpg & gpg --output foo.txt --decrypt foo.txt.gpg I realized the first method will display the decrypted file on the screen, for example when I executed ...

how do I sign data with pyme?

I just installed pyme on my ubuntu system. it was easy (thanks apt-get) and I can reproduce the example code (encrypting using a public key in my keyring). now I would like to sign some data and I didn't manage to find any example code nor much documentation. this is what I've been doing: >>> plain = pyme.core.Data('this is just some...

Python CGI script IOError Broken Pipe

I have an old Python based web form that I am updating to use a GPG for encyption instead of a no longer supported python package. When call the script via the command line it works just fine, but via the web brower and CGI there is a error: IOError: [Errno 32] Broken pipe. This error occurs if I use the gnupg package or if I try to talk...