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

Get the original filename before encryption #119

Open
llopez opened this issue Aug 9, 2018 · 2 comments
Open

Get the original filename before encryption #119

llopez opened this issue Aug 9, 2018 · 2 comments

Comments

@llopez
Copy link

llopez commented Aug 9, 2018

I am working on a project in which I have to decrypt some gpg files that do not come with the file extension explicit, just data.gpg

It would be very useful to be able to get the original filename.

@kernelsmith
Copy link

I think this is related to #62, #99 except --use-embedded-filename would have to be exposed. Although, I should point out GnuPG considers this option to be unsafe: "This can be a dangerous option as it enables overwriting files. Defaults to no." https://www.gnupg.org/documentation/manuals/gnupg/GPG-Esoteric-Options.html#index-use_002dembedded_002dfilename (search for "--use-" as this link doesn't quite take you to the right option). You can get around this by naming the outputted gpg file like the_name_i_want.zip.gpg. Most gpg clients will simply strip off the .gpg (or .asc) and use the remaining part as the filename. Some (especially GUI clients) have an option to do this that needs to be turned on first.

@adet4ever
Copy link

is there a way to set the file name or a name for encryption?
```
crypto = GPGME::Crypto.new
options = @options
data = crypto.encrypt byte_array, options
data.file_name=('sample_file_name')


Such that the output file has a name? When the encrypted string is written to a file? For example:

gpg --list-packets outt.gpg

:literal data packet:
	mode b (62), created 1547573148, name="",
	raw data: 23 bytes

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