filetype icon indicating copy to clipboard operation
filetype copied to clipboard

Add support to detect pgp encrypted file

Open BrendanBall opened this issue 7 years ago • 3 comments

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

BrendanBall avatar Sep 19 '18 05:09 BrendanBall

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.

h2non avatar Sep 19 '18 08:09 h2non

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.

BrendanBall avatar Sep 19 '18 08:09 BrendanBall

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

FerdieBerfle avatar Apr 11 '19 17:04 FerdieBerfle