• dbzh (unregistered) in reply to as
    as:
    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion [...]

    The paper that says you can't do it? People cite it to support the idea they have to do "35" passes over a disk, but it actually says it's completely impossible to recover anything after one. It doesn't have anything to do with memory wiping.

    Say, where does that paper say that you can´t do it? I think I must have missed the point of the paper somewhere. I thought it described in detail that you can do it, and how you can do it, and how you could (theoretically) prevent it (at least in 1996)...

  • No, You Suck (unregistered) in reply to JavaSucks
    JavaSucks:
    CS102 will teach you that, just because the specific INSTANCE is constant time, doesn't mean that the ALGORITHM is.
    No shit, Sherlock! What is it with this site and people spouting the deadly obvious?!

    And since no one has made the obvious joke yet, the loops really run in O(0) time.

  • mikecd (unregistered) in reply to lgrave
    lgrave:
    That is wrong. As you can see there is a 'n':
    for (int i = 0; i < 4; i++) {
    Thank you for bringing this to my attention. I'm going to spearhead a project here to change all of our iteration counters from int to short.
  • Mr SuperPicky (unregistered) in reply to Nelle
    Nelle:
    Anon:
    Quicksilver:
    they should write a HowTo for running loops in O(1)
    Ah, more WTFs related to people who don't understand O() notation. [blah blah blah O() applies to implementations, close but not cigar]
    [more blah blah blah O() applies to algorithms, correct as far as it goes]

    If your assertion was ok, then I could theoretically sort a dictionary in O(1) by unrolling the nlog2n loops, or am I wrong here ?

    Mr. SuperPicky says that the only way you can unroll the loops ahead of time is if you know the size of N ahead of time, therefore you're using a different algorithm. i.e. the previous algorithm's nlog2n = N of the current algorithm = a constant.
  • (cs) in reply to dbzh
    dbzh:
    Say, where does that paper say that you can´t do it? I think I must have missed the point of the paper somewhere. I thought it described in detail that you can do it, and how you can do it, and how you could (theoretically) prevent it (at least in 1996)...

    AIUI, the paper says that you might be able to recover data if it's just overwritten once.

    But, no one, ever, has claimed to be able to do it. Certainly data recovery companies don't claim to be able to do it.

    I suppose some secret government organisation might be able to do it, but they've never presented any of their recovered data as evidence anywhere, so we don't know.

    See http://www.nber.org/sys-admin/overwritten-data-guttman.html as an example of a 'rebuttal' of Guttman's paper. http://www.actionfront.com/ts_dataremoval.aspx#Re-Formatting is applicable as well.

  • (cs) in reply to as
    as:
    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion and recovery from magnetic memories before you accidentally make yourself look like someone shooting his mouth off about something he is fundamentally ignorant of? Most serious, professional, high-security cryptography software zeroes out its temporary memory after use.

    The paper that says you can't do it?

    You obviously haven't read it, have you? What part of
    Secure Deletion of Data from Magnetic and Solid-State Memory:
    Contrary to conventional wisdom, "volatile" semiconductor memory does not entirely lose its contents when power is removed.
    sounds like "can't do it" to you?
    as:
    People cite it to support the idea they have to do "35" passes over a disk,
    What "people" may or may not say is a strawman. I didn't say that, because - in case you haven't noticed - we're not even talking about hard disks here.
    as:
    but it actually says it's completely impossible to recover anything after one. It doesn't have anything to do with memory wiping.
    Didn't I start this by saying "read the dam' paper before you make a fool of yourself by misquoting it", or words to that effect?

    Read the damn paper.

    Before you make a fool of yourself.

    Start with section 7, why don't you?

  • Mogri (unregistered) in reply to JavaSucks
    JavaSucks:
    shadowman:
    Anon:
    Quicksilver:
    they should write a HowTo for running loops in O(1)
    Ah, more WTFs related to people who don't understand O() notation.

    Guess what, the following loop is also O(1):

    <snipped some lines from freshman CS textbook>

    I nominate this for dumbest post of the thread.

    Seconded, because it's completely wrong.

    CS102 will teach you that, just because the specific INSTANCE is constant time, doesn't mean that the ALGORITHM is.

    And it isn't. It's O(n). (Amazing! An O(n) for loop! You never see those!)

    It's also likely to be the fastest algorithm you can create for clearing memory without using assembly tricks, but that's beside the point.

    Besides, anyone who doesn't get the "O(1) == REALLY FAST" joke doesn't deserve to be posting here.

    TRWTF is in the comments, as usual. The loops... well, they don't loop. As has been stated repeatedly, check the loop condition.

    Of course, since you don't seem to have read the rest of the thread, I'm guessing you won't read this, either...

  • (cs) in reply to clively

    Your proof that data can be recovered from a formatted drive is totally irrelevant, because formatting the drive doesn't write over your data.

  • JavaSucks (unregistered) in reply to Mogri
    Mogri:
    TRWTF is in the comments, as usual. The loops... well, they don't loop. As has been stated repeatedly, check the loop condition.

    Of course, since you don't seem to have read the rest of the thread, I'm guessing you won't read this, either...

    Speaking of not reading the rest of the thread, did you read Anon's post?

    Because the loops in his post DID loop. And ARE O(n).

    And were the context for my post. Which is why it was quoted.

    Everyone knows that the loops in the original post don't actually execute. The thread had moved beyond that.

  • (cs) in reply to pscs
    pscs:
    Security conscious organisations like the NSA might well overwrite lots of times (they'd probably actually degauss, shred then burn)

    The gutmann paper also mentions that you can't degauss a modern hard drive. They passed the point of requiring more power than the total generating capacity of human civilization a while age; easier to just physically destroy them.

    Rick:
    Your proof that data can be recovered from a formatted drive is totally irrelevant, because formatting the drive doesn't write over your data.

    I suspect the idea was based around a full format, the question wouldn't make any sense otherwise.

  • (cs) in reply to Dirge
    Dirge:
    The Guttman paper is the most ridiculously overquoted "security" document in the history of electronics. It's lead to nearly everyone thinking that data on a modern hard drive which has been overwritten can be recovered. Yet, somehow, mysteriously, there are no actual factual accounts to be found anywhere of this process being used successfully.
    Dirge:
    Can anyone cite even one documented instance of an _overwritten_ drive being successfully read, other than the decrepit MFM drives that Guttman discusses?

    Can you explain WTF relevance this has to the question of zeroing data out in RAM?

    Dirge:
    No? You can only cite tinfoil hat rumours about the CIA and electron microscopes? That's what I thought.
    Can you show where I did that? No? You can only cite strawman arguments? That's what I thought.
  • (cs) in reply to DaveK
    DaveK:
    Martin Gomel:
    Dear reader:

    My name is Martin Gomel, and I am the lead developer for "Some Technology". If you are interested in purchasing "Some Technology" for elite hacking into game server code, please send a certified check for $1000 to:

    c/o Marin Gomel Some Technology Enterprises 245 Thisg'uy Wil Lbeliev Eanyt Hing PO Box 1200 Nigeria

    All softwares are garentee virusus free, or some monies back.

    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion and recovery from magnetic memories before you accidentally make yourself look like someone shooting his mouth off about something he is fundamentally ignorant of? Most serious, professional, high-security cryptography software zeroes out its temporary memory after use.

    Dear DaveK,

    You really should read the entire post before you go shooting your mouth off at some guy who's writing a fairly funny parody of a 419 scam attempt.

    Most serious, professional posters do. Apparently you zeroed out your temporary memory before starting your reply.

  • Matthew (unregistered) in reply to Matt

    Wow, this is one of those WTFs that really catches you off guard. Well, it caught me off guard, anyway. Here I was thinking that it was just a "Oh, that's just silly" kind of WTF. But then I read the comments and saw the punchline. Awesome.

    I wonder if maybe the original programmer knew exactly what he was doing. Management probably mandated this kind of "security," but the programmer knew it was stupid so he "mistyped" the > signs. I mean, really, what C programmer would mistype something like that... twice? You'd have to go out your way to use >. < is used almost exclusively in every other for loop.

    Still awesome though, if only as a subtle "FU" to stupid management.

  • kg (unregistered)

    "they encrypted the IP-address when it was passed between functions using XOR encryption."

    Does this mean they tried to "encrypt" the parameters to every function call in their code? Unless I misunderstood it, that's the most ridiculous WTF.

  • SkittlesAreYum (unregistered) in reply to DaveK
    DaveK:
    Didn't I start this by saying "read the dam' paper before you make a fool of yourself by misquoting it", or words to that effect?

    Read the damn paper.

    Before you make a fool of yourself.

    Start with section 7, why don't you?

    You know, between this post and how you jumped on the guy with the 419-scam joke, I think you and Gutmann must be lovers or something. It's the only explanation I can think of for you taking comments about the paper he wrote personally.

  • (cs) in reply to Nutmeg Programmer
    Nutmeg Programmer:
    To begin with, most people today are running in a virtual machine

    Just imagine that: neo takes the red pill and escapes the matrix just to find that it is running in a VM an he's now in the host matrix 0.o

  • Bob N Freely (unregistered) in reply to foxyshadis
    foxyshadis:
    Rick:
    Your proof that data can be recovered from a formatted drive is totally irrelevant, because formatting the drive doesn't write over your data.

    I suspect the idea was based around a full format, the question wouldn't make any sense otherwise.

    Even a "full" format doesn't overwrite any data sectors. All it does is scan for bad ones. You might be thinking of a low-level format. Back in the 80's, you could do that through the BIOS, but even then, all you were doing was writing sector numbers to the tracks. Nowadays, that is done at the factory, and the HDD has a much more limited interface.

    The process of zeroing out a drive completely is called "reinitialization." No standard formatting routine does a full reinitialization at the same time, but there are plenty of utils available from both manufacturers and third-parties that will do this.

  • Teh Optermizar (unregistered) in reply to mikecd
    mikecd:
    lgrave:
    That is wrong. As you can see there is a 'n':
    for (int i = 0; i < 4; i++) {
    Thank you for bringing this to my attention. I'm going to spearhead a project here to change all of our iteration counters from int to short.

    Tsk tsk... such typical knee-jerk reaction... think about what you are doing man, throwing away the ability to do large numbers of iterations by using short...

    Might I suggest using a float... you get the best of both worlds, neatly avoiding the O(n) issue, and also allowing for a truly massive number of iterations ;)

  • Another Interpretation (unregistered) in reply to Dr Who
    Dr Who:
    Wow, u > 18 and j > 256, shouldn't that have been < ?

    I bet this was an intelligent programmer who was doing his part to aid the resistance to idiocy inside the company. His PHB probably insisted on such foolishness, but couldn't read the code.

  • JavaSucks (unregistered) in reply to Bob N Freely
    Bob N Freely:
    Even a "full" format doesn't overwrite any data sectors. All it does is scan for bad ones.
    I probably shouldn't continue this, but some formatting utilities allow for destructive "bad block" scans where it will attempt to write and read back a pattern to every block on the disk.

    These days it's off by default because (good) modern hard drives handle bad blocks themselves, it takes forever, and in most cases isn't needed as a simple read will discover bad blocks.

    Note that AFAIK, the DOS format command doesn't provide an option for this. Ext2 does as part of its tool, and I expect other third-party utilities will as well, despite it being mostly useless.

  • (cs) in reply to GalacticCowboy
    GalacticCowboy:
    DaveK:
    Martin Gomel:
    Dear reader:

    My name is Martin Gomel, and I am the lead developer for "Some Technology". If you are interested in purchasing "Some Technology" for elite hacking into game server code, please send a certified check for $1000 to:

    c/o Marin Gomel Some Technology Enterprises 245 Thisg'uy Wil Lbeliev Eanyt Hing PO Box 1200 Nigeria

    All softwares are garentee virusus free, or some monies back.

    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion and recovery from magnetic memories before you accidentally make yourself look like someone shooting his mouth off about something he is fundamentally ignorant of? Most serious, professional, high-security cryptography software zeroes out its temporary memory after use.

    Wow... pot, kettle...

    Oh for crying out loud. Do you have the faintest idea what the phrase you're using actually means? It would be a PKB if I hadn't read the paper. I have read the paper. Therefore it's not a PKB. What /were/ you thinking of?

  • (cs) in reply to No, You Suck
    No:
    JavaSucks:
    CS102 will teach you that, just because the specific INSTANCE is constant time, doesn't mean that the ALGORITHM is.
    No shit, Sherlock! What is it with this site and people spouting the deadly obvious?!

    And since no one has made the obvious joke yet, the loops really run in O(0) time.

    That was the obvious joke in the first place, although he called it O(1) instead of O(n). The WTF is that someone actually corrected it, complete with a long lesson about O(n) complexities.

    Some people need to leave the asperger's at home before coming here...

  • Adam (unregistered) in reply to Bob N Freely

    [quote user="Bob N Freely"][quote user="foxyshadis"] The process of zeroing out a drive completely is called "reinitialization." No standard formatting routine does a full reinitialization at the same time, but there are plenty of utils available from both manufacturers and third-parties that will do this.[/quote]

    Mac's disk utility has the option. It can do a zero out, a 7-Pass erase, and a 35-Pass erase when formatting.

  • (cs) in reply to DaveK
    DaveK:
    GalacticCowboy:
    DaveK:
    Martin Gomel:
    Dear reader:

    My name is Martin Gomel, and I am the lead developer for "Some Technology". If you are interested in purchasing "Some Technology" for elite hacking into game server code, please send a certified check for $1000 to:

    c/o Marin Gomel Some Technology Enterprises 245 Thisg'uy Wil Lbeliev Eanyt Hing PO Box 1200 Nigeria

    All softwares are garentee virusus free, or some monies back.

    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion and recovery from magnetic memories before you accidentally make yourself look like someone shooting his mouth off about something he is fundamentally ignorant of? Most serious, professional, high-security cryptography software zeroes out its temporary memory after use.

    Wow... pot, kettle...

    Oh for crying out loud. Do you have the faintest idea what the phrase you're using actually means? It would be a PKB if I hadn't read the paper. I have read the paper. Therefore it's not a PKB. What /were/ you thinking of?

    OK Dave, but you haven't explained why you quoted a post that was making fun of the "some technology" line in the original article (with allusions to 419 scams) and then started ranting about something ENTIRELY UNRELATED. WTF?

  • (cs) in reply to SkittlesAreYum
    SkittlesAreYum:
    DaveK:
    Didn't I start this by saying "read the dam' paper before you make a fool of yourself by misquoting it", or words to that effect?

    Read the damn paper.

    Before you make a fool of yourself.

    Start with section 7, why don't you?

    You know, between this post and how you jumped on the guy with the 419-scam joke, I think you and Gutmann must be lovers or something.

    So, you feel that the only reason two people would ever have the same point of view on a subject is because they're lovers? Does mrprogguy know that you feel this way?

    SkittlesAreYum:
    It's the only explanation I can think of for you taking comments about the paper he wrote personally.

    That simply demonstrates your poor ability to think of explanations. Never mistake a failure of the imagination for an insight into necessity.

  • (cs) in reply to mrprogguy
    mrprogguy:
    DaveK:
    Martin Gomel:
    Dear reader:

    My name is Martin Gomel, and I am the lead developer for "Some Technology". If you are interested in purchasing "Some Technology" for elite hacking into game server code, please send a certified check for $1000 to:

    c/o Marin Gomel Some Technology Enterprises 245 Thisg'uy Wil Lbeliev Eanyt Hing PO Box 1200 Nigeria

    All softwares are garentee virusus free, or some monies back.

    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion and recovery from magnetic memories before you accidentally make yourself look like someone shooting his mouth off about something he is fundamentally ignorant of? Most serious, professional, high-security cryptography software zeroes out its temporary memory after use.

    Dear DaveK,

    You really should read the entire post before you go shooting your mouth off at some guy who's writing a fairly funny parody of a 419 scam attempt.

    Dear mrprogguy,

    You should really read not just the entire post, but the entire thread before you go attempting to correct someone. Context is everything. The parody was indeed funny, but misbegotten, because it starts from the assumption that there is no need to zero data in memory because it cannot be recovered; that is why the OP suggested that it would only be some kind of scammer or snake-oil-salesman who would say that it could be done. In the code, in the original post, the WTF that we are here to all discuss: the buggy typo in the for loop tests is indeed bad, wrong, WTFy and quite amusing; but the basic concept of zeroing your sensitive data in memory is most certainly not a WTF, and it is foolish to mock it.

    mrprogguy:
    Most serious, professional posters do. Apparently you zeroed out your temporary memory before starting your reply.

    Bwaaaaah! "Professional posters"? Is that the current euphemism for "people who spend all day on the 'net because they have no life"? Sure, I may misinterpret or misunderstand things or just be plain wrong sometimes. But I'd really rather be any/and/or/every kind of wrong forever than fall under the impression that being a "professional poster" was somehow a worthwhile way of life...

  • (cs) in reply to shadowman
    shadowman:
    DaveK:
    GalacticCowboy:
    DaveK:
    Martin Gomel:
    Dear reader:

    My name is Martin Gomel, and I am the lead developer for "Some Technology". If you are interested in purchasing "Some Technology" for elite hacking into game server code, please send a certified check for $1000 to:

    c/o Marin Gomel Some Technology Enterprises 245 Thisg'uy Wil Lbeliev Eanyt Hing PO Box 1200 Nigeria

    All softwares are garentee virusus free, or some monies back.

    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion and recovery from magnetic memories before you accidentally make yourself look like someone shooting his mouth off about something he is fundamentally ignorant of? Most serious, professional, high-security cryptography software zeroes out its temporary memory after use.

    Wow... pot, kettle...

    Oh for crying out loud. Do you have the faintest idea what the phrase you're using actually means? It would be a PKB if I hadn't read the paper. I have read the paper. Therefore it's not a PKB. What /were/ you thinking of?

    OK Dave, but you haven't explained why you quoted a post that was making fun of the "some technology" line in the original article (with allusions to 419 scams) and then started ranting about something ENTIRELY UNRELATED. WTF?

    I /was/ talking about the "some technology", because the coder's concern that data in memory is vulnerable didn't seem as daft to me as it did to the guy who wrote the parody. See the middle chunk of my reply in http://worsethanfailure.com/Comments/It-Only-Seems-Redundant-and-Stupid.aspx?pg=L#165829 starting around the words "funny but misbegotten".

  • JavaSucks (unregistered) in reply to shadowman
    shadowman:
    The WTF is that someone actually corrected it, complete with a long lesson about O(n) complexities.
    No, the WTF was that the "lesson" was COMPLETELY WRONG. I just corrected it in the hopes that someone, somewhere, might learn something.
  • Pat (unregistered) in reply to foo
    foo:
    To increase security in a password just encrypt it multiple times in a loop like this one:

    level = 3 password = "plain text"; for(i=0;i>level;i++){ password = cryptDES(password); }

    Look, now no one will be able to break my encryption because the DES is applied "level" number of times. This is super efficient because when I test this it runs blindingly fast even if I set level to something rediculalsy large like five billion. It's amazingly effecient.

    There was actually a time when governments thought multiple Caesar shifts made codes stronger. There was one guy in Spain (I think) who would "test" their codes, tell them they were unbreakable, then sell the secrets to other countries, who all thought they had unbreakable codes and that everyone else was just an idiot.

    I still can't fathom how anyone could not notice that multiple Caesar shifts only return one of the 26 shifts you could have gotten singly.

  • (cs)

    As for overwriting values in memory: it is quite useless. As long as you had the value unencrypted once during execution time -- you are screwed. And erasing it immidiately after using will not help you much. Your usual cracker won't normally search memory for interesting patterns, he will stop you program right at the point where it is about to use the data in its final form and examine memory contents at his leasure.

    No need for special hardware or anything (for PC software at least), just good debugger (SoftIce was popular last time I checked).

  • Zock (unregistered) in reply to UnFleshed One

    Bah, everybody knows that this is the way to cleanse a hard drive.

  • CSoftware (unregistered) in reply to Brian
    You have to put this in the context of a cracker that makes a living doing basically nothing but breaking copyright protections on software. He/she can probably get the hardware required to do these things.

    Dude... if a hacker has control of the physical box where the software is running, the only options are to use obfuscation techniques. Remember, if this is something that a hacker can run, he can very easily run it under full emulation, using Bochs for example. That lets him run a program stepping one instruction at a time, or put break points on memory locations, or on code locations. Running under Bochs he can have the (virtual) machine freeze when the program looks at a certain piece of memory, a register, a network port.

    The only thing that helps with that is to use a strong obfuscating compiler to make it very difficult to trace WTF the code is doing.

    In fact, this idiotic idea of writing over the memory 100 times makes the situation worse because then you can just rig Bochs to look for loops like that, and when it happens you have a) automatically detected where in memory the secret bytes are stored and b) it's trivially easy to grab them before the loop starts, because you can set a breakpoint at the top of the loop code! (Note that it's likely that the compiler would optimize away this loop, so the compiler might save these bozos from their own bozoness.)

    So this "meticulous" security is not just redundant and stupid, it's actually making it easier for an attacker to get key bytes by making it bleeding obvious where those bytes are.

    And my captcha is pointer, bleeding appropriate for this post.


    Secure Postfix with TLS to prevent relaying

  • dkf (unregistered) in reply to Zock
    Zock:
    Bah, everybody knows that this is the way to cleanse a hard drive.
    No, that just makes for a challenging jigsaw puzzle putting the bits back in order (both logically and literally!) A challenge, yes, but not impossible. If you really want the data gone, burn the drive. Really. It easily raises the magnetic surface over its Curie point, at which point the data is gone...
  • (cs)

    TRWTF is all these people saying they should have used memset or bzero instead. If they want to be secure, they should be using SecureZeroMemory instead.

  • a bunny (unregistered)
    Tei:
    Maybe crackers will check for memcpy calls and zoom there. Normal programs may have only a few memcpy calls on the code. Like 8 or 12 for 1 MB of source code. It will be easier to crack if the guy use a memcpy, because the cracker will look to small memcpy calls *before* the call run. If the cracker filter by size, may be even easier. Like filtering for a buffer enough to store a IP.
    1MB of source code? So I'd have more memcpy() calls if my code had really long function/variable names, lots of comments, and whitespace?

    The real WTF is my cat.

  • Anon (unregistered) in reply to CSoftware
    CSoftware:
    The only thing that helps with that is to use a strong obfuscating compiler to make it very difficult to trace WTF the code is doing.
    Actually, since the loop never runs, it will actually do nothing at all.
  • dkf (unregistered) in reply to CSoftware
    CSoftware:
    So this "meticulous" security is not just redundant and stupid, it's actually making it easier for an attacker to get key bytes by making it bleeding obvious where those bytes are.
    So, all people really need to do to defend against this is to zero out a great big chunk of otherwise useless data? Easy!
  • Eat It (unregistered) in reply to Teh Optermizar
    Teh Optermizar:
    mikecd:
    lgrave:
    That is wrong. As you can see there is a 'n':
    for (int i = 0; i < 4; i++) {
    Thank you for bringing this to my attention. I'm going to spearhead a project here to change all of our iteration counters from int to short.

    Tsk tsk... such typical knee-jerk reaction... think about what you are doing man, throwing away the ability to do large numbers of iterations by using short...

    Might I suggest using a float... you get the best of both worlds, neatly avoiding the O(n) issue, and also allowing for a truly massive number of iterations ;)

    May I suggest:

    #define medium int ... for (medium i = 0; i < 4; i++)

    problem solved

  • (cs) in reply to DaveK
    DaveK:
    mrprogguy:
    DaveK:
    Martin Gomel:
    Dear reader:

    My name is Martin Gomel, and I am the lead developer for "Some Technology". If you are interested in purchasing "Some Technology" for elite hacking into game server code, please send a certified check for $1000 to:

    c/o Marin Gomel Some Technology Enterprises 245 Thisg'uy Wil Lbeliev Eanyt Hing PO Box 1200 Nigeria

    All softwares are garentee virusus free, or some monies back.

    Dear Goomball,

    Why don't you go read the Gutmann paper on secure deletion and recovery from magnetic memories before you accidentally make yourself look like someone shooting his mouth off about something he is fundamentally ignorant of? Most serious, professional, high-security cryptography software zeroes out its temporary memory after use.

    Dear DaveK,

    You really should read the entire post before you go shooting your mouth off at some guy who's writing a fairly funny parody of a 419 scam attempt.

    Dear mrprogguy,

    You should really read not just the entire post, but the entire thread before you go attempting to correct someone. Context is everything. The parody was indeed funny, but misbegotten, because it starts from the assumption that there is no need to zero data in memory because it cannot be recovered; that is why the OP suggested that it would only be some kind of scammer or snake-oil-salesman who would say that it could be done. In the code, in the original post, the WTF that we are here to all discuss: the buggy typo in the for loop tests is indeed bad, wrong, WTFy and quite amusing; but the basic concept of zeroing your sensitive data in memory is most certainly not a WTF, and it is foolish to mock it.

    mrprogguy:
    Most serious, professional posters do. Apparently you zeroed out your temporary memory before starting your reply.

    Bwaaaaah! "Professional posters"? Is that the current euphemism for "people who spend all day on the 'net because they have no life"? Sure, I may misinterpret or misunderstand things or just be plain wrong sometimes. But I'd really rather be any/and/or/every kind of wrong forever than fall under the impression that being a "professional poster" was somehow a worthwhile way of life...

    Let me guess: On a recent project you touched a bit of security related code, so now you are an expert in the whole field.

    Take an aspirin and have a lie down, before making yourself look even more ridiculous.

  • BillyBob (unregistered) in reply to DaveK
    DaveK:
    Bwaaaaah! "Professional posters"? Is that the current euphemism for "people who spend all day on the 'net because they have no life"?

    I'll have you know some of us do it to avoid work

  • Patrick (unregistered) in reply to Jimmy
    Jimmy:
    Ahh so that should help to explain why games are so fast...oh wait, maybe more likely to explain why games are filled with bugs.

    I do understand that game developers wants their product to reach the shelf as quick as possible but seriously. Who here would by a table with only three legs or a car without a possibility to fill it up with gas (or whatever fule you are using).

    Thats more or less what game developers are sending to their customers, no wonder people are annoyed at them. It have happened at time that people I know buy a game and doesn't get it running but by downloading a pirate version they have no trouble what so ever.

    CAPTCHA: pirates...yeah I was just writing about that...

    Learn to spell.

  • Patrick (unregistered) in reply to shadow
    shadow:
    The REAL WTF is why anyone would think a hacker who was too stupid to use a packet sniffer would be smart enough to extract an ip address from a compiled binary. What are they going to do next? Hack the server with their l33t lack of networking skills? I doubt it.

    Alot of hacks are based on hooking function calls.

  • (cs)

    It might be interesting at this point to look up the various talks given by the people who hack modern game consoles. (I trust most readers here are intelligent enough to plug "hacking the xbox" or something similar into Google Video and take it from there)

    It really is pretty amazing what a small bunch of motivated people can do, and pretty amazing how horrible "security" some major corporations can come up with.

    It'll also tell you what sort of people those "crackers who do it for a living" really are. They don't have electron microscopes for reading overwritten data off hard drives -- and they don't need to.

  • Theodore (unregistered) in reply to lgrave
    iNt i = 0; i < 4; i++) {

    And now you see N in the code?

  • immibis (unregistered)
    for(int j = 0; j > 256; j++)
    Yes, that seems very redundant and stupid to me.
  • ~ (unregistered)

    FR1ST!!@!!`!(timesyouvebeenlaid+1)

  • Zygo (unregistered) in reply to Nutmeg Programmer
    Nutmeg Programmer:
    Most programmers have too much faith that the computer is doing what they tell it to do, when if fact, it is only guarenteed to do something with the same result. [...] Third, an optimizing compiler might move the assignments to a constant out of the loop altogether.

    Indeed. I was investigating something similar (trying to do a calculation 100,000,000 times in a loop to see how long each iteration took). I had to beat GCC with a stick to make it actually execute the calculation inside the loop--it kept trying to move the calculation outside the loop since the function was inline, its parameters never changed, I stored the return value in the same memory location, and there were no aliased pointers in scope.

  • eric76 (unregistered) in reply to Brian
    Brian:
    "RAM can be analyzed for prior content after power loss. Although as production methods become cleaner the impurities used to indicate a particular cell's charge prior to power loss are becoming less common. Data held statically in an area of RAM for long periods of time are more likely to be detectable using these methods. The likelihood of such recovery increases as the originally applied voltages, operating temperatures and duration of data storage increases. Holding unpowered RAM below − 60 °C will help preserve the residual data by an order of magnitude, thus improving the chances of successful recovery."
    It would be much easier with core memory.

    I wonder how much room 2 GB of core memory would require.

  • Zygo (unregistered) in reply to Teh Optermizar
    Teh Optermizar:
    mikecd:
    lgrave:
    That is wrong. As you can see there is a 'n':
    for (int i = 0; i < 4; i++) {
    Thank you for bringing this to my attention. I'm going to spearhead a project here to change all of our iteration counters from int to short.

    Tsk tsk... such typical knee-jerk reaction... think about what you are doing man, throwing away the ability to do large numbers of iterations by using short...

    Might I suggest using a float... you get the best of both worlds, neatly avoiding the O(n) issue, and also allowing for a truly massive number of iterations ;)

    Except that you can't stop iterating once you hit 8 million or so.

    No, it's better to do this:

    // trwtf.h
    typedef int imt;
    
    // trwtf.c
    #include "trwtf.h"
    // The "n" above doesn't count because it's in preprocessor code, not in the algorithm.
    
    for (imt i = 0; i < 4; ++i) {...}
    
  • Zygo (unregistered) in reply to Anon
    Anon:
    Quicksilver:
    they should write a HowTo for running loops in O(1)
    Ah, more WTFs related to people who don't understand O() notation.

    Guess what, the following loop is also O(1):

    for (int i = 0; i < 4; i++) {
        foo[ i ] += bar;
    }

    It's O(1) because there is no n anywhere. In order for it to be linear time, the amount of time required would have to scale linearly with some factor.

    So if instead of always incrementing four elements, it was something like:

    for (int i = 0; i < n; i++) {
        foo[ i ] += bar;
    }

    Then it would be O(n).

    Think of it this way: if you can easily unroll the loop, it's O(1). After all:

    foo[0] += bar;
    foo[1] += bar;
    foo[2] += bar;
    foo[3] += bar;

    Is clearly O(1). (Well, unless someone's been playing with operator overloading.)

    The loops, even if they worked, would be O(1) because they always operate in constant time.

    O(1) doesn't (necessarily) mean fast: it means it always take the same amount of time to run.

    So...what you're saying is...that Quicksilver used O() notation correctly?

Leave a comment on “It Only Seems Redundant and Stupid”

Log In or post as a guest

Replying to comment #:

« Return to Article