<div dir="ltr">Sorry for the lame tracking links; that's apparently a setting automatically enabled by SendGrid which I'm using to send out on my custom email domain. Hopefully they're disabled now and below are showing the original URLs as I had pasted them, else I give up, lol.<div><br></div><div>Demo:</div><div><div><ul><li><a href="https://gist.github.com/mattborja/475fa600604073780bd47ada019f98f3#file-demo-pgp-progmem-ino">https://gist.github.com/mattborja/475fa600604073780bd47ada019f98f3#file-demo-pgp-progmem-ino</a></li></ul></div><div>See also:</div><div><ul><li><a href="https://www.arduino.cc/reference/en/language/variables/utilities/progmem/">https://www.arduino.cc/reference/en/language/variables/utilities/progmem/</a></li><li><a href="https://forum.arduino.cc/t/maximum-progmem-data-size-arduino-mega/373448">https://forum.arduino.cc/t/maximum-progmem-data-size-arduino-mega/373448</a></li><li><a href="https://www.arduino.cc/reference/en/language/functions/communication/wire/">https://www.arduino.cc/reference/en/language/functions/communication/wire/</a></li></ul><div>Sorry about that :/</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 5, 2022 at 5:30 PM Matt Borja <<a href="mailto:me@mattborja.dev">me@mattborja.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The EEPROM notes are intriguing to me, and if that's an option you're considering, I went ahead and tossed up some old code onto a gist if you're interested. It's a crude example of storing PGP private key in flash (vs. SRAM) using a little PROGMEM hack for the Arduino Uno:<div><br></div><div><div><a href="https://u25119845.ct.sendgrid.net/ls/click?upn=AWAj65NY2UMz4TnmUvFN9IGbt1wm4vdbS70yUSppRsMQ5onvQAvzfk4AuG3VBsPrYrmXvCsmH2gOu2hhCVW-2FozFc-2BAJFdnKEEvcyDaqRDNxw2t1swznhe-2Byz9n3cIPh4W-2BYBrk-2BpyHiZIKYIQmoMug-3D-3DV0Ta_RtEKULAgbs8GArutgsfJQJI1lr9pAjJUwpaVhpathDIPfe3Pjl-2BQZwS7yBZWMJnI8TTLxk-2ByGe4pgfFJvX4Bou5C1fI0D7YgUtxldOLGY2VAvmD-2BhNd5ZjVBI84zy0W6wYBQUW2egN3ZvTWqkVgr5Ki25FFuLtzJmFdhajt43EDNI9gvI1fPREu8rqww-2BAuc2ZiZpqBvtHDnygI3FFiPIA-3D-3D" target="_blank">https://gist.github.com/mattborja/475fa600604073780bd47ada019f98f3#file-demo-pgp-progmem-ino</a></div><div><br></div><div>See also:</div><div><ul><li><a href="https://u25119845.ct.sendgrid.net/ls/click?upn=AWAj65NY2UMz4TnmUvFN9AQx4M1sn44MZVITLdjuhzbIZb0aXoHDzv0QZtQTVn5G6QeOWF0rMBkEnPOq-2Fj-2F-2Ff7zu1OGBDd7QcTgBhRzyDH4q1Qa4hKC1pW-2B5shivQuz2-pNK_RtEKULAgbs8GArutgsfJQJI1lr9pAjJUwpaVhpathDIPfe3Pjl-2BQZwS7yBZWMJnIs0eLUh8X8mkQXRXN0qL-2BBI-2FP4WUNAdH68KatJpGY4XnBJc1O9Z-2Fp8uJZzHoJh8CO0VAx7LKYRpllB2X8hoINRB8LODQA9wxUxsUo3vaInLMOtnn1bG-2BPfHIe9vmiIIj8fYGCPCauytMO3gkg1bzIvg-3D-3D" target="_blank">https://www.arduino.cc/reference/en/language/variables/utilities/progmem/</a><br></li><li><a href="https://u25119845.ct.sendgrid.net/ls/click?upn=AWAj65NY2UMz4TnmUvFN9D9Ta4eWZgsvBZTPHn95mwzOn9PJbOBmsTVroNkfZhHrDU5DGuJrYEOd2BgJLlbEzuoN-2BAHGFNFVmOtv5a8BCVv77dVdCk1P2ur7j9Lk4-2BlxudYJ_RtEKULAgbs8GArutgsfJQJI1lr9pAjJUwpaVhpathDIPfe3Pjl-2BQZwS7yBZWMJnIOKWoTGe4DPfo8uZNGCmg5Fk1rcQH7bAWfFiVo2b79KBuCgeDyruSwox0wOeeujmNXVfuszbFsPmorLH3NH7EuqPFfGZ2lg7CAr-2B7afdkAYj6tFLteNf1Se9JcpxX7vfp8bl7nO58zU2vmWBMHg4ciw-3D-3D" target="_blank">https://forum.arduino.cc/t/maximum-progmem-data-size-arduino-mega/373448</a></li></ul></div><div><div><div><div><div><br></div><div>I actually have another slightly more refined project sort of tabled until I have more time freed up (maybe next couple weeks or so). It involves allocating and managing zones on a much larger EEPROM space--available on a single AT24C256C (32 KB up from 1 KB) which is also I2c, meaning you can daisy chain about 8 of these out, if you want to get crazy. Latest estimates I came up with suggested I could fit close to 2-3 4096-bit PGP private keys on one of these things. And the implementation is much simpler using the <a href="https://u25119845.ct.sendgrid.net/ls/click?upn=AWAj65NY2UMz4TnmUvFN9AQx4M1sn44MZVITLdjuhzbIZb0aXoHDzv0QZtQTVn5Ge1KfTz6F6zMS-2FfP04-2Fjjt7iLi-2B-2BsXVWXxIkyqKKiRLAwROh2Z2sTwxGYJLPdBVaYSGU1_RtEKULAgbs8GArutgsfJQJI1lr9pAjJUwpaVhpathDIPfe3Pjl-2BQZwS7yBZWMJnIfjLNgZ7IsVl1oWy83Y8SM8BK9HL-2FneeITNQy9izOirkQE-2BUYita4NN3ZMjmmmGw6yACC-2Fh8McICKg-2FYGQ9n3T131vam4C5Dz0CJQ9zu3V8-2BAEvt-2Ba2XFUtRLE0ggOEd6jWmzE3kdWH4gCZ0AEt8j-2BQ-3D-3D" target="_blank">Wire.h interface</a> because it actually has the room to store larger amounts of data without messing around with PROGMEM. And it's all offline writing too :)</div></div></div></div></div></div><div><br></div><div>Ping me if you're interested. Otherwise, I'ma go back to what I was doing ;)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 5, 2022 at 4:58 PM Jacob Bachmeyer via Gnupg-users <<a href="mailto:gnupg-users@gnupg.org" target="_blank">gnupg-users@gnupg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Lars Noodén via Gnupg-users wrote:<br>
> On 5/5/22 01:11, Jacob Bachmeyer wrote:<br>
> > Lars Noodén via Gnupg-users wrote:<br>
> >> A removable hard drive might be an option, if the storage time<br>
> >> is less than a decade and there are decent storage conditions<br>
> >> in regards to chemicals, temperature, humidity, and so on.  Flash<br>
> >> memory seems to lose<br>
> >> its charge rather quickly, measured in months.<br>
> ><br>
> > Write-once optical media is my preferred means of long-term backup for<br>
> > nontrivial amounts of data,<br>
> [snip]<br>
><br>
> The number of years that the keys and the data they apply to will be<br>
> stored unpowered, offline will influence which storage medium is<br>
> acceptable for the task.<br>
><br>
> Old CD-R were short-lived garage from my experience, but certain models<br>
> of recently made CD-R should last a while even under slightly<br>
> non-optimal storage conditions before they start flipping bits.<br>
<br>
This depends on the quality of the media.  I first got a CD-R drive in <br>
the mid 2000s and have discs from back then that were still readable <br>
when I last looked at them a few years ago.  Admittedly, these have been <br>
stored under ordinary room conditions and protected in a disc binder or <br>
jewel cases and were not the "bargain basement" media that was also <br>
available at the time.  A friend once lamented having something like 3 <br>
to 5 discs out of a 100-pack of "Great Quality" branded CD-R media that <br>
were actually usable; the rest were either rejected during burning or <br>
failed immediately upon readback.  It is doubtful that those "Great <br>
Quality" discs are still readable today.  There was a significant <br>
difference in price:  the discs I used (Maxell/Memorex/Verbatim name <br>
brands stand out thinking back) typically cost about $20 for a 50-pack <br>
or similar for a 100-pack if on sale, while "Great Quality" was $5 for <br>
100.  You really did get what you paid for, however.<br>
<br>
There were also direct-write DVD-R camcorders fairly popular in the mid <br>
to late 2000s.  I remember news stories about most of Barack Obama's <br>
earlier speeches having been lost before his first term as US President <br>
had ended because the only recordings had been made by his supporters <br>
using those camcorders and cheap DVD-R media that did not last.<br>
<br>
<br>
Note that "nontrivial amounts of data" excludes PGP keys; even a <br>
mini-CD-R holds several megabytes.  I will admit that lack of a <br>
reasonable backup strategy is one of the reasons I do not presently use <br>
PGP for encryption.<br>
<br>
> [...]<br>
><br>
> Whether that bit flip hits anything important is another matter, but<br>
> they do add up over time and with enough of them they will eventually<br>
> hit something, worse if it hit something compressed.  [...]<br>
<br>
CD-ROM format has considerable data expansion.  If I remember correctly, <br>
a 650MB data CD actually stores something like 2.1GB after applying the <br>
various ECC layers.  There are quite a few bits to flip before anything <br>
is affected.<br>
<br>
> Air pollution, temperature, light, and humidity are some of the factors<br>
> affecting the lifespan of the physical storage medium.<br>
<br>
One of the advantages of optical media generally is that the discs are <br>
(supposed to be) sealed against their environment.  Absent extremes, <br>
(polycarbonate has a melting point, the data is written using very <br>
intense light that locally heats the dye layer) environmental effects <br>
should be minimal.  Along these lines, while fire will obviously destroy <br>
optical media, discs should remain readable after being in a flood, for <br>
example.  (Some mold removal may be needed, and the data should be <br>
copied to new media in case mold or the chemicals used to remove it <br>
adversely affect the integrity of the environmental seal.)<br>
<br>
> > I have SD cards and USB sticks with data blocks last written<br>
> > many years ago and still readable.  Granted, I have never used<br>
> > low-end no-name<br>
> [snip]<br>
><br>
> And by reading them, they have powered up and refreshed the charge.  The<br>
> problem applies to such flash storage devices which have been left<br>
> unpowered for longer periods of time.<br>
<br>
No, it does not.  That is not how flash memory works.  Some flash <br>
translation layers might do such things in some devices, but I strongly <br>
doubt that flash-based microcontrollers have undocumented hardware <br>
functions to periodically rewrite the program storage, for example.  In <br>
any case, I have both USB sticks and SD cards that have been left <br>
entirely unpowered for years and found the data to still be there, <br>
certainly much longer than the "few months" you mentioned earlier.<br>
<br>
Theoretically, the stored charge does eventually leak off of the <br>
floating gate, but EEPROMs (and flash, which is essentially the same <br>
technology) are generally considered to hold data indefinitely.  The <br>
data retention specifications are based on "accelerated aging" tests, <br>
which generally involve elevated temperature.  The processes involved <br>
are highly nonlinear with respect to temperature and may very easily <br>
require centuries at room temperature or not occur at all without <br>
elevated temperatures; we do not know because flash storage is only now <br>
reaching the milestone of having existed long enough for even the oldest <br>
imprints to be reaching even the "accelerated aging" estimated <br>
lifespan.  So far, we are not seeing catastrophic losses of data stored <br>
in flash.<br>
<br>
<br>
-- Jacob<br>
<br>
_______________________________________________<br>
Gnupg-users mailing list<br>
<a href="mailto:Gnupg-users@gnupg.org" target="_blank">Gnupg-users@gnupg.org</a><br>
<a href="https://u25119845.ct.sendgrid.net/ls/click?upn=AWAj65NY2UMz4TnmUvFN9EYEqtNOGKM5EVTRJHzYauGZHQfmaLnBrHl5qgXgVVD7vBRgqcz2jUvGsIaK0YTgxw-3D-3DNawK_RtEKULAgbs8GArutgsfJQJI1lr9pAjJUwpaVhpathDIPfe3Pjl-2BQZwS7yBZWMJnI-2B0b8Q1mfwSefwiyj7U-2BBPFeSplVvSG98ApCuOMsEsulcQx-2B5zXMOh0SEa36HFdc4Dew4WvXJeCtXoTM2GpcCXXP8UP61mE-2FZr73O-2BMQzW2VePklc6-2FuEpTJBgZ6fU0pkoxJB91K-2FYORZOt0-2FYijcYg-3D-3D" rel="noreferrer" target="_blank">https://lists.gnupg.org/mailman/listinfo/gnupg-users</a><br>
</blockquote></div>
<img alt="" width="1" height="1" border="0" style="height: 1px; width: 1px; border-width: 0px; margin: 0px; padding: 0px;">_______________________________________________<br>
Gnupg-users mailing list<br>
<a href="mailto:Gnupg-users@gnupg.org" target="_blank">Gnupg-users@gnupg.org</a><br>
<a href="https://lists.gnupg.org/mailman/listinfo/gnupg-users" rel="noreferrer" target="_blank">https://lists.gnupg.org/mailman/listinfo/gnupg-users</a><br>
</blockquote></div>