🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4154

Re: Locking Page in Memory

#4154
From: prunesquallor
Date: Fri, 10 Mar 2006 12:28
32 lines
2019 bytes
"Jonathan Benedicto"  wrote>
> Write over the memory with 0's. Eg:
>
> AnsiString Key = "123456799";
>
> DoSomething( Key );
>
> SecureZeroMemory( Key.c_str(), Key.Length() );

The problem is that this can happen:

AnsiString Key = "123456799";
[Process ends timeslice; machine is heavily overtasked; page including key 
thrown out to disk]
.
.
.
[Process recovered and continues when gets next timeslice]
DoSomething( Key );
SecureZeroMemory( Key.c_str(), Key.Length() );

So we end up with the key out on the disk. Whilst the probability may be 
low, one factor will be the length of time DoSomething(Key) takes - the 
longer that is, the more likely it is that at some point the key will end up 
on the disk. DoSomething() could be quite long - if a user is encrypting a 
big chunk of disk they are not going to want to type in the key/passphrase 
repeatedly.

ATB

John B
Technical Details
Message-ID: <441170db@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <440eb97d@newsgroups.borland.com> <440ec0cc@newsgroups.borland.com> <440ee584$1@newsgroups.borland.com> <4410393c$1@newsgroups.borland.com> <441046ed@newsgroups.borland.com> <441075aa$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a6a321b0cbcc9b74
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "prunesquallor" <prunesquallor@proproco.co.uk>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <440eb97d@newsgroups.borland.com> <440ec0cc@newsgroups.borland.com> <440ee584$1@newsgroups.borland.com> <4410393c$1@newsgroups.borland.com> <441046ed@newsgroups.borland.com> <441075aa$1@newsgroups.borland.com>
Subject: Re: Locking Page in Memory
Date: Fri, 10 Mar 2006 12:28:29 -0000
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 213.208.127.201
Message-ID: <441170db@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1141993691 213.208.127.201 (10 Mar 2006 04:28:11 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail