From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Tramp and crypted files Date: Fri, 29 May 2020 11:16:32 +0200 Message-ID: <87a71ryubz.fsf@gmx.de> References: <865zd1h3ru.fsf@duenenhof-wilhelm.de> <875zd15rze.fsf@gmx.de> <87wo5gjfbr.fsf@gmx.de> <87eermkdov.fsf@gmx.de> <87r1vlipg4.fsf@gmx.de> <86lflrttxn.fsf@duenenhof-wilhelm.de> <874ksdhdmp.fsf_-_@gmx.de> <87h7wcwbn9.fsf@aia00820.aia.gr> <87lfloou9y.fsf@gmx.de> <874ksbvwn0.fsf@aia00820.aia.gr> <871rn7rgtv.fsf@gmx.de> <87367kfbwa.fsf@aia00820.aia.gr> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="106128"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Deus Max Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 29 11:19:24 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jebAh-000RVI-HS for ged-emacs-devel@m.gmane-mx.org; Fri, 29 May 2020 11:19:23 +0200 Original-Received: from localhost ([::1]:42618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jebAg-0008Ah-CF for ged-emacs-devel@m.gmane-mx.org; Fri, 29 May 2020 05:19:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeb82-0006al-AQ for emacs-devel@gnu.org; Fri, 29 May 2020 05:16:38 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:37117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeb80-0003ck-Lh for emacs-devel@gnu.org; Fri, 29 May 2020 05:16:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1590743793; bh=SgBk/azkP1+nN0fj45R8yKH1reseajic2ftlTpZY4AU=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date; b=j/h6xnyCbMVGzEi4NFyE3ZbyW+6XErjJHWEobXwR6KEp3W0pJ19gNLjtArVOIwEx5 fKUVC6ZixNWIOkg0p6U9Fcg0TnEE78cuZjeiw1mGI8VE8S3l5/AW8VTcx3BvIjyPKs +UDU4Vgzq6btZljj711RM69XGythzbJXjjj9Lcb0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.119.31]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MxDkm-1ilNyT0LdI-00xYCG; Fri, 29 May 2020 11:16:33 +0200 X-Provags-ID: V03:K1:Q59EMsLAOaGtPjSigbkZCXCYC+d7igCJUwxi19H4qL+e6RNqE4S 2EHSutOtnS1YjAhD1mZUEsGsW1gTSz0NT9S5l33w8Tz+STL1p5B3k02FSWWvXDsc/GiNtHe BwYZx2v6o3vhpmmksvZEW+/54Cna9e7nEQpIs2Dynif8c5kJzGubwl6o7zHeDYAwiWUfM1T wAjv8Q8CZ5OxCRjn6G2bA== X-UI-Out-Filterresults: notjunk:1;V03:K0:0NeFZo+EYvg=:l6AG1bJL/z4HIdEc8FjMmN lRqALiChRaDn6I8J5txlNwQURjViTQSPcm8fp9E/K6LUYTTwpJMB5f4L9t8kObNwuJ5xAblx5 qdimeegNhyqGTq8nzgyQS6UDmJmnyMuQI/Gxez7LnVG03e+MaC06/UaHhr0fOF/HvR+halA5A /octJq0fwQY49iaigAmxdrFyfy4ThMsqdBbNFjECVMGsfg117zBm6r6rR3Qcs81ebCoDgAdda T5uky6QBabYZK7ezJ1n5eFm5ZZktyBRbpYRc8b0HmGrsSJFigtv0JdEKIDMuJkcm7OvkxVgze di3aeA8rkO0JvP9R/xCsnupN2UB1UUNLaexnTK0koU7ztY/4uKo39/gQKGyCi4hlqGOcazQhZ WQHWoWeUpB/7aMzBXsIHY/hOSAhXAb+xF/sWccQTLxA26IfCBa6voUYQ0oUBpvV7czbC/6nGd qZsj4CgCNsup4B1LrRPbaTe+LWiap19eankLVwjdDMSuJIN33wqRy3YNsD0yru9t0zP3wOUKb bI8k1G4Xke6DrPPlNK2HuZoXrglSGikVp+OQZnSPEmtPTvkFaBb5mLmf1MWHIIGqR0GKeXMDg wW4sgbk01hC4NmHmWfkSshiUF1OcK/o/JJEQ2drin6dXCyRjbaEtXl7PfnwiG+cE6Rq+E6Kel u4NMzfoQAT0GCJdG3B3EqABaoFQveBVJAaHiHv55LGCA9JE+oMbEnl1F0iggkVsuPRgktD+Om 01Uf1VeAGZ3wj/GpsIMB/72TS++KTJmSxm5QvpvJKWX9OUkIwYO6NCVJP8XolDF7N/FI7hf+ Received-SPF: pass client-ip=212.227.17.22; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/29 05:16:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251612 Archived-At: Deus Max writes: Hi, > EncFs adds file name encryption and obsfucation, making in hard to guess > the encrypted file, even if you know the file name. So you have to > temporarily mount somewhere, in order to see the decrypted filenames. No. The new tramp-crypt file name handler makes this transparent to you. Given, you have declared "/nextcloud:host:/crypted/" as crypted remote directory. If you call for example (directory-file "/nextcloud:host:/crypted/subdir") this file name handler will transform "/nextcloud:host:/crypted/subdir" to "/nextcloud:host:/crypted/XXX", in case you have created a subdirectory "subdir" and it has the name "XXX" on the nextcloud server. Then the vanilla Tramp command is called as (directory-file "/nextcloud:host:/crypted/XXX") using the encrypted file name. It returns the list ("." ".." "YYY" "ZZZ"), with "YYY" and "ZZZ" being encrypted file names on the server. This result is received by the file name handler, and it transforms this list to ("." ".." "foo" "bar"), with "foo" and "bar" being the plain text file names of "YYY" and "ZZZ". So, finally you see (directory-file "/nextcloud:host:/crypted/subdir") =3D> ("." ".." "foo" "bar") without even thinking about that this is a crypted remote directory. Same scenario for all other magic primitives, which are implemented by Tramp. > Yes, the .encfs6.xml is very importantf for EncFS. > I think encfs needs a temprorary mount point, to function. This can be a > weakness in a network situation, as any interruption could leave the > files open or in a strange state, inviting the case to be compromised. No. An encfs mount point is needed only in case you create a new .encfs6.xml file. Tramp would do this transparently by calling "encfs tmpdir1 tmpdir2". Then it saves tmpdir1/.encfs6.xml, unmounts the encfs mountpoint, and removes the temporary directories. In ordinary use, if a file or file name needs to be encrypted or decrypted, just the rootdir is necessary, no mountpoint. See this: I have a root dir at /tmp/rootdir/. There is the crypted file xyswI5g6Pf3R7qOMKy1jDA8m. And I can still do =2D-8<---------------cut here---------------start------------->8--- # mount | grep encfs # ls -al /tmp/rootdir total 8 drwxrwxr-x. 2 albinus albinus 80 May 29 10:48 . drwxrwxrwt. 114 root root 5960 May 29 10:45 .. -rw-rw-r--. 1 albinus albinus 1297 May 29 10:32 .encfs6.xml -rw-r--r--. 1 albinus albinus 26 May 29 10:48 xyswI5g6Pf3R7qOMKy1jDA8m # encfsctl encode /tmp/rootdir foo EncFS Password: xyswI5g6Pf3R7qOMKy1jDA8m # encfsctl decode /tmp/rootdir xyswI5g6Pf3R7qOMKy1jDA8m EncFS Password: foo # encfsctl cat /tmp/rootdir xyswI5g6Pf3R7qOMKy1jDA8m EncFS Password: This is file foo. =2D-8<---------------cut here---------------end--------------->8--- Well, I must confess that I have trouble to make "encfsctl cat --reverse" working. Will dig what's up. >> With this, encrypted files from remote can be accessed by different >> Emacs sessions running from different host, by different users. All >> what they need to know is the remote directory name (in Tramp syntax)= , >> and the password the encryption/decryption is protected with. That's >> what "cloudy servers" are good for. >> > Correct me if I'm wrong, but I don't think the webdav protocol behaves > well for multi-user editing. It simple saves the last edit. without > comparing for merge conflicts. It is a last save takes all. > For access from different hosts, the user should take care to use strict > sequential access. Honestly, I don't care which Tramp method is used. Whether you use a remote nextcloud server, or a remote ssh server, doesn't matter. The user must decide what's best. The same problem you mention happens for all remote files handled by Tramp, also for not encrypted ones. For my internal testing, I use as crypted remote directory "/ssh::/tmp/xxx= /". That's fast, and good enough. > DeusMax Best regards, Michael.