[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Encrypt files on Linux, decrypt on Windows



john doe writes:

On 8/21/2020 9:11 PM, David Christensen wrote:
On 2020-08-21 11:24, Linux-Fan wrote:

[...]

Encrypt on Linux:
$ 7z a -ptestwort -mhe=on secret.7z secret.txt

Decrypt on Windows: Double-Click or use commandline:
% 7z x -o. secret.7z


So, the recipient must install 7-Zip on their Windows computer?

In that example: Yes or use a 7z.exe obtained from the website without
installation.

[...]

To the OP, look at creating a self extracting archive (not sure if it
works from Linux to Windows though).

It works from Linux to Windows, but it is trickier than I had imagined:

On Linux:

* Go to https://www.7-zip.org/download.html and download 64-bit x64

* Extract file 7z1900-x64.exe with 7z.

  $ mkdir sub
  $ 7z x -osub 7z1900-x64.exe

* Copy 7z.sfx from the extracted installer

  $ cp sub/7z.sfx .

* Create SFX archive for Windows

  $ 7z a -mhe=on -ptestwort -sfx7z.sfx mysfx.exe secret.txt

* Send file `mysfx.exe` to the Windows user

On Windows:

* Run `mysfx.exe` -- it prompts for the password (`testwort`).

I nowdays prefer the portable/installed version over SFX archives because
uncommon executables are often rejected by antivirus software (especially
.exe attachments to e-mails are prone to being deleted for security
reasons...). Although most scanners seem to be fine with a generated SFX
archive at the moment:

https://www.virustotal.com/gui/file/e2dd36862c27e1551916ed3e773a55ecedf2b35e658522fa982369cc90eaf488/detection

[...]

HTH
Linux-Fan

Attachment: pgprwPYGFDuJu.pgp
Description: PGP signature


Reply to: