Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to detect pgp encrypted file #45

Open
BrendanBall opened this issue Sep 19, 2018 · 3 comments
Open

Add support to detect pgp encrypted file #45

BrendanBall opened this issue Sep 19, 2018 · 3 comments

Comments

@BrendanBall
Copy link

It would be awesome if this package can detect if a file is pgp encrypted.

@h2non
Copy link
Owner

h2non commented Sep 19, 2018

If there is a file signature bytes header that we can recognize consistently, it can be done. Can you provide it? E.g: file magic numbers header.

@BrendanBall
Copy link
Author

Not sure, I know that the file app on linux/mac can detect it. e.g.

file test.pgp
test.pgp: PGP RSA encrypted session key - keyid:<keyid> RSA (Encrypt or Sign) 2048b .

It's not listed in https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files but I'll investigate a bit further.

@FerdieBerfle
Copy link

PGP files will always start with the ASCII text "----- Begin PGP"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants