From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: secret strings Date: Fri, 01 Apr 2011 16:34:23 -0400 Message-ID: References: <4D926EA9.5080509@gmail.com> <4D92AD2B.40502@gmail.com> <87lizwd9lt.fsf_-_@lifelogs.com> <87ei5n8ffi.fsf@lifelogs.com> <87hbaivju2.fsf@uwakimon.sk.tsukuba.ac.jp> <87ei5moa61.fsf_-_@lifelogs.com> <87hbaia58a.fsf@uwakimon.sk.tsukuba.ac.jp> <87aagansj0.fsf@lifelogs.com> <87r59mm3z7.fsf@uwakimon.sk.tsukuba.ac.jp> <87pqp657le.fsf@lifelogs.com> <87oc4qlzjb.fsf@uwakimon.sk.tsukuba.ac.jp> <87pqp5wx8s.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301690111 18233 80.91.229.12 (1 Apr 2011 20:35:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2011 20:35:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 01 22:35:06 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q5l3f-0001GU-K4 for ged-emacs-devel@m.gmane.org; Fri, 01 Apr 2011 22:35:03 +0200 Original-Received: from localhost ([127.0.0.1]:39490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5l3f-0004GR-1X for ged-emacs-devel@m.gmane.org; Fri, 01 Apr 2011 16:35:03 -0400 Original-Received: from [140.186.70.92] (port=59536 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5l34-0003qW-Cu for emacs-devel@gnu.org; Fri, 01 Apr 2011 16:34:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5l33-0007mf-CI for emacs-devel@gnu.org; Fri, 01 Apr 2011 16:34:26 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:50030 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5l33-0007mb-8Y for emacs-devel@gnu.org; Fri, 01 Apr 2011 16:34:25 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAOs1lk3O+IOK/2dsb2JhbAClX3iIebkOhWsEljQ X-IronPort-AV: E=Sophos;i="4.63,284,1299474000"; d="scan'208";a="102580434" Original-Received: from 206-248-131-138.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.138]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 01 Apr 2011 16:34:24 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D97EE58E7E; Fri, 1 Apr 2011 16:34:23 -0400 (EDT) In-Reply-To: <87pqp5wx8s.fsf@lifelogs.com> (Ted Zlatanov's message of "Fri, 01 Apr 2011 15:08:19 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138031 Archived-At: > think it's possible at least to encode the secret and decode it on the > funcall. It will, obviously, still be somewhere in memory but at least Encoding/decoding is silly: it just hides the data, without storing it securely, so it's no better than the current "hide it behind a symbol&closure". I.e. more work wasted for no benefit. There are so many ways the data gets copied in memory during evaluation that encoding one string doesn't give you much guarantee that there isn't any copy of its content still lying around somewhere (for the same reason I consider clear-string to be only for use by the deluded). > It should at least try to hide secret data and help the consumer protect > the secrets from accidental revealing (thus the secrets closure it uses > currently). Good neighbors can warn you if you leave your door open, > even if it's not strictly their business. Note that instead of a closure, it can store the data in a symbol. That provides the same kind of protection (printing just prints the symbol), but is much more lightweight. Stefan