gpgme

Using passphrase callback in ruby gpgme

自古美人都是妖i 提交于 2019-11-30 18:13:13
问题 I am using ruby gpgme gem (1.0.8). My passphrase callback isn't called: def passfunc(*args) fd = args.last io = IO.for_fd(fd, 'w') io.puts "mypassphrase" io.flush end opts = { :passphrase_callback => method(:passfunc) } GPGME.decrypt(input,output, opts) Does someone have working example of passphrase callback? 回答1: Sample of callback you can find in the following working example. It signs a file in detached mode, i.e., the signature file is separated from the original file. It uses the

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