Gentoo Archives: gentoo-user

From: Ashley Dixon <ash@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] zip file encrypt from file manager context menu
Date: Thu, 16 Jul 2020 21:41:25
Message-Id: 20200716214012.22gqzyb4y6bzm7jm@ad-gentoo-main
In Reply to: [gentoo-user] zip file encrypt from file manager context menu by thelma@sys-concept.com
1 On Thu, Jul 16, 2020 at 02:32:49PM -0600, thelma@×××××××××××.com wrote:
2 > zip - has a switch "-e" encrypt
3 >
4 > It works from command line but I'm not sure how to enter it in XFCE in
5 > in custom action that will appear in file manager context menu.
6 >
7 > I have 7za that works:
8 > 7za a file.zip %N -tzip -mem=AES256 -mx9 -pxxxxxx
9 >
10 > but zip:
11 > zip file %N -exxxxx
12
13 7za accepts the password as part of the command-line invocation, and zip does
14 not. It's actually quite appalling, from a security perspective, that 7za
15 allowing the echoing and saving (in the history) of the password. From the
16 manual page of zip(1):
17
18 -e
19 --encrypt
20 Encrypt the contents of the zip archive using a password which
21 is entered on the terminal in response to a prompt (this will
22 not be echoed; if standard error is not a tty, zip will exit
23 with an error). The password prompt is repeated to save the user
24 from typing errors.
25
26 Since it requires stderr (although I think this should be "stdin") on the
27 terminal, you probably won't be able to set this up to use be a context menu
28 option, unless you want to make the context menu button invoke a terminal
29 window; that's probably the only plausible solution.
30
31 > And I have no clue where did I get in 7za parameter: -mem=AES256 -mx9
32
33 Again, this can be explained by reading the manual page of 7za(1), although it
34 does require a bit of extra digging, and probably requires p7zip to be emerged
35 with the `doc` USE-flag. The "-mx[=]9" option is explained in the "EXAMPLE 1"
36 section of the man page:
37
38 -mx=9 level of compression = 9 (Ultra)
39
40 I also think you made a slight error when typing "-mem=AES256". The "-mem"
41 option does exist, but it is used to specify the amount of memory used by PPMd,
42 not any sort of encryption algorithm:
43
44 mem={Size}[b|k|m|g]
45 Sets the size of memory used for PPMd. You must specify the size
46 in bytes, kilobytes, or megabytes. The maximum value is 2GB =
47 2^31 bytes. The default value is 24 (16MB). If you do not
48 specify any symbol from the set [b|k|m|g], the memory size will
49 be calculated as (2^Size) bytes. PPMd uses the same amount of
50 memory for compression and decompression.
51
52 "-em", however, makes a lot more sense, and is used to set the encryption method
53 on the "zip" module:
54
55 em={EncryptionMethodID} [default: ZipCrypto]
56 Sets a encryption method: ZipCrypto, AES128, AES192, AES256
57
58 To find the full documentation of the various switches on your system, emerge
59 p7zip with `doc` and execute `qfile method.htm` and find the relevant file
60 belonging to p7zip. The docs are really impressive and comprehensive, should you
61 want to learn more about becoming a power-user of p7zip (I am not one; I just
62 installed it now to investigate your issue).
63
64 Hope this helps,
65 Ashley.
66
67 --
68
69 Ashley Dixon
70 suugaku.co.uk
71
72 2A9A 4117
73 DA96 D18A
74 8A7B B0D2
75 A30E BF25
76 F290 A8AA

Attachments

File name MIME type
signature.asc application/pgp-signature