secretStash := NewSecretStash()
pString := secretStash.NewString()
....
....
secretStash.Thrash()
yes, you now have to deal in pointers, but that's not too ugly, and everything is stored in secretStash so can iterate over all the types it supports and thrash them to make them unusable, even without the gc running.If you had to prompt a user for a password, you’d read it in, use it, then thrash the value.
read -p “Password: “ PASSWD
# do something with $PASSWD
PASSWD=“XXXXXXXXXXXXXXXXXX”
It’s not pretty, but a similar concept. (I also don't know how helpful it actually is, but that's another question...)
I have only seen iButton's "in the wild" in one use case - for tracking the nightly rounds of security guards in commercial buildings/industrial complexes. You've probably seem small round discs on the wall in office buildings (normally a round disc with a concentric ring); those are iButton terminals. The guards each have a keychain with an iButton, and as they do their rounds they press it on the terminal to record proof that they went to each terminal at the proper time. Obviously this is a use-case for NFC or a variety of other technologies but for some reason I've seen the iButton-based systems used in a half dozen buildings.
I remember thinking that some of the tracking features (temperature) of the button would be helpful in some situations. But the ring was the crazy model. Between these and smart cards, authentication was starting to look futuristic. I even remember getting a smart card reader from my credit card company. They thought it would make for more secure web transactions.
I’ve still seen some iButtons in the wild in odd places. Most recently, I saw them tracking car keys at dealerships. The last car I test drove had a key attached to a fob with an iButton. I was more excited by the iButton tracker than the car.
But I thought of it as an example of how long lasting some design decisions can really be. I’m sure someone designed this system 20-25 years ago and it is still in service today. I’m sure today it would be NFC. But now I’m thinking about what the iButton of 2050 will look like.