GithubHelp home page GithubHelp logo

Comments (9)

DanielRuf avatar DanielRuf commented on August 14, 2024

Possibly related to this: http://stackoverflow.com/questions/35633351/cant-decrypt-file-encrypted-with-openpgp-php-in-gnupg

Confirmed, this does not work here. Decryption fails (no valid encrypted PGP data) and encryption also (throws exception and crashes GPA).

The encrypt/decrypt (E) capability is missing.

http://www.hauke-laging.de/sicherheit/subkeys.en.html

E: encryption / decryption

pub  1024R/86CF75F5  erzeugt: 2016-02-26  verfällt: niemals     Aufruf(usage): C
                     Vertrauen: unbekannt     Gültigkeit: unbekannt
[  unbek.] (1). TEST

from openpgp-php.

DanielRuf avatar DanielRuf commented on August 14, 2024

Any update about this problem @singpolyma?

from openpgp-php.

DanielRuf avatar DanielRuf commented on August 14, 2024

I have tracked it down to these lines

The values from here seem to not be properly added, just the first value is actually used

$sig->hashed_subpackets[] = new OpenPGP_SignaturePacket_KeyFlagsPacket(array(0x01, 0x02));

All values are processed

$bytes .= chr($f);

[1]=>
        object(OpenPGP_SignaturePacket_KeyFlagsPacket)#28 (4) {
          ["tag"]=>
          int(27)
          ["size"]=>
          NULL
          ["data"]=>
          NULL
          ["flags"]=>
          array(...) {

https://tools.ietf.org/html/rfc4880#section-5.2.3.21

Also the public key is not shown in GPA, just the private key.
The generated public key contains also the pirvate key. Possibly this is caused by $pubm = clone($m); which clones the secret key packet and replaces just the first packet. But there is still the one flags packet left (which should be different for the public key) and the public key still has the private key packets included in some places.

$pubm[0] = new OpenPGP_PublicKeyPacket($pubm[0]);

from openpgp-php.

DanielRuf avatar DanielRuf commented on August 14, 2024

@meitar importing the public key should be possible with --allow-non-selfsigned-uid see http://stackoverflow.com/questions/35633351/cant-decrypt-file-encrypted-with-openpgp-php-in-gnupg

I will take a look again at the code and the issue with the flags and provide a PR if possible.

from openpgp-php.

fabacab avatar fabacab commented on August 14, 2024

@DanielRuf Okay, but I'm not having any trouble importing the public key. It's generating a revocation certificate that I'm having trouble with (see above reference). :\

from openpgp-php.

singpolyma avatar singpolyma commented on August 14, 2024

Please test my latest version with 741fec2 and see if this helps you.

from openpgp-php.

fabacab avatar fabacab commented on August 14, 2024

@singpolyma The newest commits do create a key with the S (signing) capability and also the C (certify) capability. The previous keys generated with this library were created with only the C (certify) capability. So that's definitely a fix, if that's as intended.

However, as per @DanielRuf's question, this does not resolve the issue with manually creating a revocation certificate (described in #31). These latest commits do not affect that issue at all.

from openpgp-php.

singpolyma avatar singpolyma commented on August 14, 2024

@meitar are you using the example script to do they keygen? I specifically refer to the commit that fixes the keygen example to use the correct p/u values. This changed fixed revocation generation for me in gpg locally.

from openpgp-php.

fabacab avatar fabacab commented on August 14, 2024

I specifically refer to the commit that fixes the keygen example to use the correct p/u values.

Ah!! I'm sorry, I was looking only at commits in lib and the dependencies.

You're right, using the correct p/q values enables me to create a revocation certificate as well. Thank you!

from openpgp-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.