From: Pavel Machek Subject: Re: [RFC V4 PATCH 00/15] Signature verification of hibernate snapshot Date: Thu, 26 Sep 2013 14:06:21 +0200 Message-ID: <20130926120621.GA7537@amd.pavel.ucw.cz> References: <1380161957.32302.42.camel@linux-s257.site> <1380192218.32302.69.camel@linux-s257.site> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alan Stern , David Howells , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org, linux-pm@vger.kernel.org, linux-crypto@vger.kernel.org, opensuse-kernel@opensuse.org, "Rafael J. Wysocki" , Matthew Garrett , Len Brown , Josh Boyer , Vojtech Pavlik , Matt Fleming , James Bottomley , Greg KH , JKosina@suse.com, Rusty Russell , Herbert Xu , "David S. Miller" , "H. Peter Anvin" , Michal Marek , Gary Lin , Vivek Goyal To: joeyli Return-path: Content-Disposition: inline In-Reply-To: <1380192218.32302.69.camel@linux-s257.site> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org Hi! > For the symmetric key solution, I will try HMAC (Hash Message > Authentication Code). It's already used in networking, hope the > performance is not too bad to a big image. Kernel already supports crc32 of the hibernation image, you may want to take a look how that is done. Maybe you want to replace crc32 with cryptographics hash (sha1?) and then use only hash for more crypto? That way speed of whatever crypto you do should not be an issue. Actually... Is not it as simple as storing hash of hibernation image into NVRAM and then verifying the hash matches the value in NVRAM on next startup? No encryption needed. And that may even be useful for non-secure-boot people, as it ensures you boot right image after resume, boot it just once, etc... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html