From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Transparent encrypt and decrypt token file with gpg2 in Emacs. Date: Thu, 10 Jun 2021 10:19:49 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19208"; mail-complaints-to="usenet@ciao.gmane.io" To: Hongyi Zhao , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 10 04:20:27 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1lrAJ1-0004mZ-Dq for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 04:20:27 +0200 Original-Received: from localhost ([::1]:53358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrAIz-0000oH-Jr for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 09 Jun 2021 22:20:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrAIe-0000o6-OH for help-gnu-emacs@gnu.org; Wed, 09 Jun 2021 22:20:04 -0400 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:34597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrAIc-0005do-QF for help-gnu-emacs@gnu.org; Wed, 09 Jun 2021 22:20:04 -0400 Original-Received: by mail-lj1-x236.google.com with SMTP id bn21so2557309ljb.1 for ; Wed, 09 Jun 2021 19:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=CKHKUpdVl199mzTmcSgB6NP2RLZjZQkdUphjgyKXYiI=; b=EjVCaKfwhLrgpz4z1a8/yvLAhrvkaT68ofGL8FSJMoxOSO/7C/XVgJB5W4ndwQcs7m YxcrVWdncNIOjKvjubp2bfg9f7RIfTTPRkE277WV0OJTAtSGGXgcw0o5i0WoXVnhryNd Dnpu6Zze92mB7rfeExYafbZ8ZkyXYCC5j7cZ4R7mTYved+l4bIxbvGfUW95iNxsq5nVm ZwVbUNMLsEBuxGOogrduXrg9sekkxM+heBeKXbUAF9xqvtZr5eG2rv9KCwBPyaFMZ7AW ynNkHEgUnRAmeQr/YzDLT20PEJ3acenVwSSgNkZu/OEOXMuqT35ZBTLC9ZmvmeLj+beb 0ybQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=CKHKUpdVl199mzTmcSgB6NP2RLZjZQkdUphjgyKXYiI=; b=AgppU1vNbwAN3EuqnBAfeA7xn0pjDv3Gj/c+sP3lLSwsA0unV8ZtonByKfYUvFWqBu dq5+NNcULqBFx5g7ZIKeMLdVtmR+OkZH8wk+IPIDjoR3d53H/HRYxmqRQ/zQ2wz7S3Ud JcmjZqpnnftEF33FLc1RvzUvFVvn8zMIm9w9Ha9NotuhSv/o4fzIOvcZ/fEYaZuYGgod INWsO++Jq7jr3PrfN5unZuEuGU9Yl5hSRpyXwYL4Wl0HaXnVCLRuOC1BWYKTEWrshSNC L7a5++L8G3Z0txpB2Z+1ntU2U8kXz8GRELSjjF4JjnBEVErwkXwpnfQCy2/WFxChM7+D /NgQ== X-Gm-Message-State: AOAM532dFFJlhZaIMpoWPTHsafQAaXBlnnlke8bOsXKhD6ZMuwHPnqu1 PuB+QYPTnwHIzSwKIa/bazjyEs9O23CWwXTmHjg= X-Google-Smtp-Source: ABdhPJy/Puue1Op0qZeuWpxm6fI8JZHNiL0LOFuaqd/L/s7WeJg29lX6JWgHnnC53dzUe2+x9/mzcftXvezOKdBXuLY= X-Received: by 2002:a2e:5c83:: with SMTP id q125mr392939ljb.447.1623291600756; Wed, 09 Jun 2021 19:20:00 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130691 Archived-At: On Thu, Jun 10, 2021 at 12:06 AM Jean Louis wrote: > > * Hongyi Zhao [2021-06-09 18:28]: > > Loading /home/werner/DvdMgr/screen2latex.el.git/auth.el.gpg... > > Decrypting /home/werner/DvdMgr/screen2latex.el.git/auth.el.gpg...done > > epa-file-insert-file-contents: Opening input file: Can't decrypt, No > > data (no armored data); No data (expected a packet but did not find > > one); Exit > > Mark set [4 times] > > Send the file for review. > > If it is encrypted, there should be nothing much to worry... ^=E2=80=BF^ If I first store the plain/unencrypted token info into a file, say, named as auth.el, and then encrypt it outside of Emacs with gpg(2) as below, the problem will disappear: $ gpg2 -o auth.el.gpg -e -r hongyi.zhao@gmail.com auth.el # Then remove the plain version of the token info. $ rm auth.el But I still can't figure out how to let Emacs do the above job for me automatically when the token file is read by Emacs in an unencrypted format for the first time. Regards --=20 Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China