Code Monkey home page Code Monkey logo

Comments (11)

mattosaurus avatar mattosaurus commented on May 20, 2024

Hi, it can decrypt signed and encrypted files but currently it will only decrypt the file to its signed state, it will not verify the signature on the file using the public key or output the plain text content of the signed message. #6 was in relation to not being able to decrypt the encrypted message to it's signed state.

Decrypting and verifying files is something that I've meant to add in but haven't got around to yet. Feel free to submit a PR if you like or I'll add it in when I get a chance.

from pgpcore.

mattosaurus avatar mattosaurus commented on May 20, 2024

Actually, I've just added this in now though I haven't tested the code yet, will hopefully be able to push this live soon.

from pgpcore.

WrightLiam avatar WrightLiam commented on May 20, 2024

Hi,

I figured I might be able to help on the testing front of things. This could be my specific use-case (The public key I'm using is formatted as dsa1024) but I seem to lose it while it's adding to the public key ring.

Specifically in Utilities in ReadPublicKey(Stream inputStream) when it's going through the List keys = kRing.GetPublicKeys()
.Cast()
.Where(k => k.IsEncryptionKey).ToList();

It loses the 1 key that it had in the kRing object.

from pgpcore.

mattosaurus avatar mattosaurus commented on May 20, 2024

I've added in a Verify method (as well as some better tests) in #24 but from the sound of it this won't fix your issue. If you're able to send me a dsa1024 public key and your signed file I'll have a look at it and see if I can figure out what's going wrong.

from pgpcore.

WrightLiam avatar WrightLiam commented on May 20, 2024

Sure thing, I've attached the public key and the file in question below.

from pgpcore.

mattosaurus avatar mattosaurus commented on May 20, 2024

From looking at your WrightLiamSignedFile.gpg message file it appears that it's compressed, is that correct?

The verify/decrypt methods only work with standard message blocks so this might be where it's going wrong. I tried verifying here as well using the files provided and that also threw an error.

from pgpcore.

WrightLiam avatar WrightLiam commented on May 20, 2024

I didn't think it was, I've been able to decrypt/verify it using gpg4win with the relevant public and private keys on the key chain. Does gpg4win automatically decompress files as well?

Though the compressed file IS an xls file, would that cause the same kind of problem?

from pgpcore.

mattosaurus avatar mattosaurus commented on May 20, 2024

Ah, I think you've signed and encrypted it without ASCII armor which is why it doesn't look like standard text. However PGPCore is able to decrypt and verify unarmored files so it may be down to you using GPG rather than PGP for this as they're not entirely compatible.

from pgpcore.

WrightLiam avatar WrightLiam commented on May 20, 2024

I'm not actually the one encrypting and signing the file so I can't really confirm whether or not that is the case, but basically are you saying there's a sort of a fundamental incompatibility with my file and your tool?

from pgpcore.

mattosaurus avatar mattosaurus commented on May 20, 2024

Unfortunately I think that's probably the case, though I'm not ruling out it being a bug I'm not sure how best to replicate it. There does seem to be a couple of options for calling GPG4Win directly so maybe these would be better options.

https://forums.asp.net/t/2080593.aspx?Encrypting+with+GPG4Win
https://github.com/Baggykiin/Gpg.NET

from pgpcore.

ankurDawada avatar ankurDawada commented on May 20, 2024

Does it decrypt pdf files?

from pgpcore.

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.