• PublicLurker (unregistered) in reply to Scott
    Scott:
    That's not that bad. My old company stored the password unencrypted too. They also stored the CC number and all other relevant and related info. First, you aren't supposed to store that at all and then they wouldn't encrypt it. That whole company is a giant WTF.

    off-topic: Why not use re-captcha on the site?

    At a place I worked at, they tried to store the CC number, type and expiration date, in the registry in clear text, with nice descriptive key names, so the user wouldn't have to enter the information in every time. I couldn't convince them to remove the information, but I was at least able to encrypt it and obfuscate the key names.

  • Per (unregistered)

    Heh. Sounds like the company I work for;

    • Storing passwords in plaintext... check!
    • SQL-injections... check!
    • Lack of version control... check!
    • Different directory structures on developer server and sharp server... check!
    • Forum allows ALL html (and javascript)... check! ...
  • (cs) in reply to TopCod3r
    TopCod3r:
    No WTF here, as long as your database is encrypted properly. Just go to Tools - Security - Encrypt/Decode Database, and then select your MDB file and then it is secure. I don't know why more people don't take the time to do this simple measure.

    Besides if you encrypt the password itself, it becomes harder to make a password retrieval web page.

    Those are just my thoughts, from experiencing securing my company's infrastructure.

    Can I have your sarcasm generator when you get flamed to death?

  • Jay (unregistered) in reply to John
    John:
    Also, it appears (again for MySQL) that there is no performance hit when using VARCHAR in INNODB tables, couldn't comment on any engines though.

    One reason why there might be no performance difference between CHAR and VARCHAR in mySQL is because in mySQL, if any column in the table is VARCHAR, all CHAR columns are silently converted to VARCHAR.

    MySQL manual section 12.1.5.1:

    If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than three characters are changed to VARCHAR columns. This does not affect how you use the columns in any way; in MySQL, VARCHAR is just a different way to store characters. MySQL performs this conversion because it saves space and makes table operations faster. See Chapter 13, Storage Engines.

    So you're probably running a test that compares performance of a VARCHAR to performance of a VARCHAR, and discovering -- drum roll please -- they're the same!

  • (cs) in reply to vt_mruhlin
    vt_mruhlin:
    Global Warmer:
    vt_mruhlin:
    Wait, is that md5(salt + name + pass) or md5(salt) + name + pass? The first one isn't that insecure. For the second one, is the + operator addition or concatenation? Overflow's a bitch.

    Yeah, maybe you should find a new career

    Seriously, what kind of comment is that anyhow? I mean, I'm not in the security business, so finding a new career would be irrelevant (unless I accidentally mistook a complement for an insult). But put some substance in your posts instead of just saying "u r stoopid".

    So, how would you properly salt something and how would you go about attacking the first option from this one in such a way that a properly salted password wouldn't be vulnerable?

    I've been trying to figure out what mistaking the complement for an insult would mean. As far as I can tell, the complement of an insult is a compliment; which means that, if you're worried about mistaking it, you probably think that it's an insult.

    And you'd be right.

    And you'd be even more right that it's a completely gratuitous and unfounded one. I wonder what the complement of a troll would be. Is that ones complement, or twos complement? Does it take salt? Life would be so much easier if all internet trolls were slugs.

    You are grievously misrepresenting the honourable Global Warmer. It takes far more effort to figure out the correct texting for something like "u r stoopid" than it does to cut'n'paste a /. comment along the lines of "Yeah, maybe you should find a new career." Why waste that much time on the likes of us?

  • Jay (unregistered)

    I used to take it for granted that passwords should only be stored encrypted. Then I saw a post on a forum somewhere where the poster pointed out that if a hacker has gained access to your database so that he can read the passwords from your user table, why would he even bother? By knowing the passwords, he could gain access to your database. But if he's already there, why not just read the confidential information that he wants to read? i.e. if he's found a way to read the user table in your database, he can probably read any table in your database. So why get the passwords, then log in to the application and read the names and missions of your spies or whatever? Why not just read them directly from the database? If I was a thief and I broke into somebody's house, my next step wouldn't be to start searching for their spare keys. I'm already in. I'd be searching for the cash and jewels.

    Not that I'm going to abandon encryption. Just an amusing thought.

  • PublicLurker (unregistered) in reply to TopCod3r
    TopCod3r:
    No WTF here, as long as your database is encrypted properly. Just go to Tools - Security - Encrypt/Decode Database, and then select your MDB file and then it is secure. I don't know why more people don't take the time to do this simple measure.

    Besides if you encrypt the password itself, it becomes harder to make a password retrieval web page.

    Those are just my thoughts, from experiencing securing my company's infrastructure.

    Recovering the password is easy if you use a "Recoverable Obfuscation Technique" for your encryption. I prefer ROT-13.

  • (cs) in reply to ahnfelt
    ahnfelt:
    TopCod3r:
    No WTF here, as long as your database is encrypted properly. Just go to Tools - Security - Encrypt/Decode Database, and then select your MDB file and then it is secure. I don't know why more people don't take the time to do this simple measure.

    Besides if you encrypt the password itself, it becomes harder to make a password retrieval web page.

    Those are just my thoughts, from experiencing securing my company's infrastructure.

    Can I have your sarcasm generator when you get flamed to death?
    You might note that this TopCod3r is the registered TopCod3r, as advertised on this site yesterday, and therefore possibly, but not necessarily, a different TopCod3r to the unregistered TopCod3r who caught so much flak yesterday for espousing the tantric delights of OERN.

    Without the renowned power of the PHP operator ===, I am unable to discern whether TopCod3r is, in fact, TopCod3r. I think Alex needs to add some salt to the registration process.

    If, as I suspect, TopCod3r === TopCod3r, then this has to be a stroke of genius. You can troll on completely opposite sides of the same argument: one registered, the other not.

    Has TDWTF achieved an Internet First?

    Or just an Ungentlemanly Third?

  • KG (unregistered) in reply to Jay
    Jay:
    I used to take it for granted that passwords should only be stored encrypted. Then I saw a post on a forum somewhere where the poster pointed out that if a hacker has gained access to your database so that he can read the passwords from your user table, why would he even bother? By knowing the passwords, he could gain access to your database. But if he's already there, why not just read the confidential information that he wants to read? i.e. if he's found a way to read the user table in your database, he can probably read any table in your database. So why get the passwords, then log in to the application and read the names and missions of your spies or whatever? Why not just read them directly from the database? If I was a thief and I broke into somebody's house, my next step wouldn't be to start searching for their spare keys. I'm already in. I'd be searching for the cash and jewels.

    Not that I'm going to abandon encryption. Just an amusing thought.

    It has to do with preventing future attacks. You discover someone hacked your database, so you take the website down, fix the vulnerability, restore a backup of the database... then what? If passwords are clear text, you'd have to ask all of your users to pick new ones. If passwords are hashed, then it doesn't matter. Hashes are useless to the hacker, so you can just put your website back up.

  • KG (unregistered) in reply to KG

    Wait... actually I might be wrong. If he has write access to the database, then your users would need new passwords anyway because the hacker may have overwritten them.

  • Monkey Brains (unregistered) in reply to Jay
    Jay:
    I used to take it for granted that passwords should only be stored encrypted. Then I saw a post on a forum somewhere where the poster pointed out that if a hacker has gained access to your database ...

    If another DB user in my company has access to tables that I don't, like say, the payroll table, it wouldn't be useless to get that user's password.

  • Lyle (unregistered) in reply to Jay

    The idea is that somebody may intercept the password in transit. Say, if your web application has a properly designed 5-tier architecture where each tier resides on a separate cluster, a corporate spy could be intercepting the passwords between tiers, giving your rivals open access to do whatever they want. Plus, it ensures that when you backdoor in access with a specific password hash, people can't see the secret all-access password.

    captcha: inhibeo

  • (cs) in reply to real_aardvark
    real_aardvark:
    You might note that this TopCod3r is the registered TopCod3r, as advertised on this site yesterday, and therefore possibly, but not necessarily, a different TopCod3r to the unregistered TopCod3r who caught so much flak yesterday for espousing the tantric delights of OERN.

    snip

    Doesn't the unregistered original actually go by Top Cod3r (note the space)? If memory serves... sorry, not worth my time to go check.

  • (cs) in reply to Code Dependent
    Code Dependent:
    real_aardvark:
    You might note that this TopCod3r is the registered TopCod3r, as advertised on this site yesterday, and therefore possibly, but not necessarily, a different TopCod3r to the unregistered TopCod3r who caught so much flak yesterday for espousing the tantric delights of OERN.

    snip

    Doesn't the unregistered original actually go by Top Cod3r (note the space)? If memory serves... sorry, not worth my time to go check.
    Indeed -- it wasn't worth my time either. I did think about it, but trawling through a coupla hunnert comments along the lines of "Betcha dint thinka this!!!" (BBCode mine) hardly appealed.

    Anyway, we both have better things to do. Uma Thurman? I'll toss you for her.

  • (cs) in reply to real_aardvark
    real_aardvark:
    Anyway, we both have better things to do. Uma Thurman? I'll toss you for her.
    Well, she certainly falls in the "to do" list... how about we both toss her?
  • (cs) in reply to real_aardvark
    real_aardvark:
    ahnfelt:
    TopCod3r:
    No WTF here, as long as your database is encrypted properly. Just go to Tools - Security - Encrypt/Decode Database, and then select your MDB file and then it is secure. I don't know why more people don't take the time to do this simple measure.

    Besides if you encrypt the password itself, it becomes harder to make a password retrieval web page.

    Those are just my thoughts, from experiencing securing my company's infrastructure.

    Can I have your sarcasm generator when you get flamed to death?
    You might note that this TopCod3r is the registered TopCod3r, as advertised on this site yesterday, and therefore possibly, but not necessarily, a different TopCod3r to the unregistered TopCod3r who caught so much flak yesterday for espousing the tantric delights of OERN.

    Without the renowned power of the PHP operator ===, I am unable to discern whether TopCod3r is, in fact, TopCod3r. I think Alex needs to add some salt to the registration process.

    If, as I suspect, TopCod3r === TopCod3r, then this has to be a stroke of genius. You can troll on completely opposite sides of the same argument: one registered, the other not.

    Has TDWTF achieved an Internet First?

    Or just an Ungentlemanly Third?

    I am the real Top Cod3r, the un-registered one, but somebody registered that name yesterday to spite me I guess. So I decided to register this one, without the space.

    I am just trying to add my opinion to the forum. I like the DailyWTF and if Alex wants me to stop posting my opinion comments, I will abide. I'm just trying to share my wealth of knowledge with some of the more junior developers who may be reading.

  • (cs) in reply to Jay
    Jay:
    John:
    Also, it appears (again for MySQL) that there is no performance hit when using VARCHAR in INNODB tables, couldn't comment on any engines though.

    One reason why there might be no performance difference between CHAR and VARCHAR in mySQL is because in mySQL, if any column in the table is VARCHAR, all CHAR columns are silently converted to VARCHAR.

    MySQL manual section 12.1.5.1:

    <snip>

    So you're probably running a test that compares performance of a VARCHAR to performance of a VARCHAR, and discovering -- drum roll please -- they're the same!

    As I've already mentioned, that's no longer true. It's about time you stop reading the 4.1 manual:

    http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html:
    Before MySQL 5.0.3, if any column in a table has a variable length, the entire row becomes variable-length as a result. <snip>
  • (cs) in reply to Code Dependent
    Code Dependent:
    real_aardvark:
    Anyway, we both have better things to do. Uma Thurman? I'll toss you for her.
    Well, she certainly falls in the "to do" list... how about we both toss her?
    Ummm ... thanks for turning that one around. It was a fairly disgusting concept as originally presented. Not that I'm not proud of it, or anything. (Taking "proud" in its metaphorical, rather than priapic, sense.)

    Maybe we can get back to those halcyon days when you, I, FredSaw (blatant advert) and the tooth fairy used to read and respond to each other's posts, rather than the current round of trolling?

    Me, I've got little hope of this. TDWTF has done exceptionally well, so far, partly because of the genius of the people who put it out. Unmoderated media do, unfortunately, degenerate to this point, which is essentially Omphalos.

    Meanwhile.

    If we can arrange it, let's have a bet on tossing Uma Thurman.

    You can bet on how loud you make her scream, and I can make a counter-bet on how much the municipal waste man will charge me to take her away.

    It'll probably depend upon how loudly she snores afterwards.

  • (cs) in reply to TopCod3r
    TopCod3r:
    I am the real Top Cod3r, the un-registered one, but somebody registered that name yesterday to spite me I guess. So I decided to register this one, without the space.

    I am just trying to add my opinion to the forum. I like the DailyWTF and if Alex wants me to stop posting my opinion comments, I will abide. I'm just trying to share my wealth of knowledge with some of the more junior developers who may be reading.

    Sorry, TopCod3r -- it just seemed highly amusing to me. I'd like to think (given how irrelevant internet postings are to anything) that you share the amusement. If not, sorry. No offence.

    And you know how this is going to go. I'm going to be the schoolmarm.

    Don't share your wealth of knowledge. Do comment in a way that conceals your wealth of knowledge, but still passes it on.

    Me, I prefer being abusive and offensive and I don't really care about the pitiful morons that I offend ... and that's God's Honest Truth (as revealed in the Fifth Platinum Gospel, which I wrote yesterday in a mescaline haze) ...

    You, I sense, have a more serious purpose in life.

    Which is good. Follow your purpose.

  • Boo (unregistered) in reply to Survey User 2338
    In Texas, they typically spell it with two because everything is bigger in TX which is the RW the F!

    So in Alaska we spell it CANCELLLLLLLLED_AK, since we're nearly 4x the size of TX. Some days we debate whether we should split AK in two just to make TX the third largest state in the Union.

  • The Fake WTF (unregistered)

    Heh, I love how they salt it, but do it wrong.

    The entire point of a salt is that all the passwords do NOT share the same salt. This is what makes them more resistant to dictionary attacks: the fact that you need to generate hashes with every possible salt for each password in your dictionary.

    But what can you expect from a place that stores the plaintext right next to the hash?

  • (cs) in reply to KenW
    KenW:
    There's no difference in performance in any DB. The difference is in the amount of storage required.

    Not true.

    Smaller rowsize means more rows per page which speeds up retrieval of many consecutive rows.

    Varying character fields may require a deferred update, which is slower than a direct update (this depends on the database engine, of course). Lots of other things can also lead to deferred updates (unique indexes, replication to name two) so I wouldn't get too obsessive over varchar/char choice.

    B

  • more randomer than you (unregistered) in reply to John
    John:
    I don't tend to take in the image in an article, but from looking at it, I can only see him using VARCHAR for text & a date. userid is an INT. An INT is a number isn't it Watson?

    don't get pissy with other people because you are unable to see the date row. The rest of us can and it is a varchar.

  • (cs) in reply to gigafied
    gigafied:
    The point is consistency. Programmers should be the most consistent people when it comes to syntax, spelling and which caps they use.

    It really depends upon two things:

    • The programmer's stance on eternal vigilance
    • The programmer's skill

    A highly skilled programmer who is firmly committed to eternal vigilance should be highly consistent. Any programmer who lacks one of these two characteristics will most likely not be as consistent.

    FWIW, few programmers give a rat's butt about eternal vigilance.

  • Noobot (unregistered) in reply to Survey User 2338

    OED says no.

  • jorge_sur (unregistered) in reply to Bombe
    Bombe:
    Walleye:
    Code Dependent:
    dkf:
    I'm pleased to see that Texas is getting it right for a change!
    Texas doesn't "get it right". Texas decides what is right. Chuck Norris is a Texas Ranger.
    Ummm, actually Chuck Norris is someone who PRETENDS to be a Texas Ranger.
    Actually, Chuck Norris PRETENDS to be somebody who actually IS a Texas Ranger.

    By the way Chuck Norris is behind you and starting a roundhouse kick

  • (cs) in reply to Jay
    Jay:
    I used to take it for granted that passwords should only be stored encrypted. Then I saw a post on a forum somewhere where the poster pointed out that if a hacker has gained access to your database so that he can read the passwords from your user table, why would he even bother? By knowing the passwords, he could gain access to your database. But if he's already there, why not just read the confidential information that he wants to read? i.e. if he's found a way to read the user table in your database, he can probably read any table in your database. So why get the passwords, then log in to the application and read the names and missions of your spies or whatever? Why not just read them directly from the database? If I was a thief and I broke into somebody's house, my next step wouldn't be to start searching for their spare keys. I'm already in. I'd be searching for the cash and jewels.

    Not that I'm going to abandon encryption. Just an amusing thought.

    There are situations where a "bad person" can see your tables without having access to your database. Perhaps someone lost one of your backup tapes. Perhaps a developer with a copy of the production database lost his/her laptop. These situations are bad, but with sensitive columns encrypted, you're not completely screwed (just partially).
  • (cs) in reply to Scott
    Scott:
    That's not that bad. My old company stored the password unencrypted too. They also stored the CC number and all other relevant and related info.

    ...

    I can top that. At a previous firm, I've seen at least 2 projects where the user data, including CC information for the 100s of users was stored in an unencrypted MDB (Access 2003, I think - not that password protection would have made that much of a difference)!

    The 'security' (ha ha) was that the file was not downloadable.

    Oh, btw, the website was open to SQL Injection.

    :|

    </lyle>

    P.S. I reported this to management, but I'm pretty sure nothing was done.

    One of these days I'm gonna have to write about a couple of WTFs from that job.

  • (cs) in reply to Jay
    Jay:
    I used to take it for granted that passwords should only be stored encrypted. Then I saw a post on a forum somewhere where the poster pointed out that if a hacker has gained access to your database so that he can read the passwords from your user table, why would he even bother? By knowing the passwords, he could gain access to your database. But if he's already there, why not just read the confidential information that he wants to read? i.e. if he's found a way to read the user table in your database, he can probably read any table in your database. So why get the passwords, then log in to the application and read the names and missions of your spies or whatever? Why not just read them directly from the database? If I was a thief and I broke into somebody's house, my next step wouldn't be to start searching for their spare keys. I'm already in. I'd be searching for the cash and jewels.

    Not that I'm going to abandon encryption. Just an amusing thought.

    In addition to the point KG and Monkey Brains made, if you know a user's password, there's a good chance they've used that password in other websites, like for their email.

  • (cs) in reply to Isuwen
    Isuwen:
    I don't tend to take in the image in an article, but from looking at it, I can only see him using VARCHAR for text & a date. userid is an INT.

    Alex put that image there. It's not part of the story.

    Hence his mentioning that he "doesn't tend to take in the image in an article...".

    He was responding to somebody else pointing out the varchar for dates in the image.

  • lokey (unregistered) in reply to PublicLurker
    PublicLurker:
    TopCod3r:
    No WTF here, as long as your database is encrypted properly. Just go to Tools - Security - Encrypt/Decode Database, and then select your MDB file and then it is secure. I don't know why more people don't take the time to do this simple measure.

    Besides if you encrypt the password itself, it becomes harder to make a password retrieval web page.

    Those are just my thoughts, from experiencing securing my company's infrastructure.

    Recovering the password is easy if you use a "Recoverable Obfuscation Technique" for your encryption. I prefer ROT-13.

    That's OK, but only if you use it twice on each piece of data to make it doubly secure. It also makes it easier to checksome.

  • EPE (unregistered) in reply to Pidgeot
    Pidgeot:
    KenW:
    John:
    Also, it appears (again for MySQL) that there is no performance hit when using VARCHAR in INNODB tables, couldn't comment on any engines though. I do however use CHAR for storing HASHES etc.

    There's no difference in performance in any DB.

    Almost, but not entirely true. When a table contains no variable length fields, searching on a non-indexed field will be slightly faster, since the DBMS always knows exactly where in a record a given field will be - it doesn't have to spend time looking at each individual record to determine the variable field sizes.

    Not entirely true: some DBMS compress rows before storing them on disk; no matter which datatypes you use, each row will have a different length.
    Pidgeot:
    Of course, given that strict requirement for the added performance, it's not a very frequent scenario - and as a matter of fact, MySQL versions prior to 5.0.3 would silently convert CHAR columns (of 4 or more characters) to VARCHAR once you had any variable-length columns.
    On the other hand, the larger a table is, the longer it takes to perform a full scan on it; size matters, even for performance.
  • Matt (unregistered)

    I once inherited a project that had a "dafaut" field... was supposed to be "default" but had 2 spelling mistakes in a 7 letter word!

  • Hans (unregistered) in reply to dkf
    dkf:
    My dictionary says that the two "L" variant is correct on this side of the Pond. Hence, I'm pleased to see that Texas is getting it right for a change!

    Ah, the dreaded dictionary attack!

  • Hans (unregistered) in reply to Pidgeot
    Pidgeot:
    As I've already mentioned, that's no longer true. It's about time you stop reading the 4.1 manual:

    The Real WTF is still using MySQL, even though vastly superior alternatives are available...

  • jethrotull (unregistered)

    TRWTF is that this 5 paragraph text contains 5 open " characters and just two close " characters. Good thing that this is not code, cuz it wouldn't compile.

    WTF is pecus?

  • (cs) in reply to Pidgeot
    Pidgeot:
    Almost, but not entirely true. When a table contains no variable length fields, searching on a non-indexed field will be slightly faster, since the DBMS always knows exactly where in a record a given field will be - it doesn't have to spend time looking at each individual record to determine the variable field sizes.

    Of course, given that strict requirement for the added performance, it's not a very frequent scenario - and as a matter of fact, MySQL versions prior to 5.0.3 would silently convert CHAR columns (of 4 or more characters) to VARCHAR once you had any variable-length columns.

    Point taken. I'm just not in the habit of searching in non-indexed VARCHAR columns too often; typically, if it's something that's searched on any sort of a regular basis, either the column would be indexed or I'd be searching a subset of the data, and it wouldn't matter a lot.

  • (cs) in reply to real_aardvark
    real_aardvark:
    Maybe we can get back to those halcyon days when you, I, FredSaw (blatant advert) and the tooth fairy used to read and respond to each other's posts, rather than the current round of trolling?
    Alas, poor FredSaw! I knew him, real_aardvark. A fellow of infinite jest, of most excellent fancy. He hath borne me on his back a thousand times... Where be his gibes now? His gambols? His songs? His flashes of merriment, that were wont to set the forum on a roar?
    real_aardvark:
    Me, I prefer being abusive and offensive and I don't really care about the pitiful morons that I offend ... and that's God's Honest Truth (as revealed in the Fifth Platinum Gospel, which I wrote yesterday in a mescaline haze) ...
    Halcyon days, indeed!

    ...no, wait, more like... hallucination daze. Wandering bootheels; jingle jangle memories.

  • (cs)

    Well, that seems to be the end for this OP, then.

    Bye folks!

  • (cs) in reply to John
    John:
    @Dominic Pettifer

    Hmm, I read "all fields are varchar for simplicity..." as using VARCHAR for text fields only, not for other data types

    If that's the case, it does induce a sick feeling.

    ALL fields (except the INTEGER PRIMARY KEY id field every table holds).

    Dates. Timestamps. References to the ID fields of other tables. Flags. Statuses. Dollar values.

    Every. Last. Field.

    so...

    CREATE TABLE x ( id INTEGER PRIMARY KEY; ... ); CREATE TABLE x_to_y ( id INTEGER PRIMARY KEY; x_id VARCHAR; y_id VARCHAR; );

    Spelling counts. Be sure to remember which tables use "SALE" and which use "SOLD", because all the code has to check against the string explicitly.

  • (cs) in reply to Licky Lindsay
    Licky Lindsay:
    Holy shit, is this "seebs" from http://www.seebs.net ?

    If so, dude, you were one of my inspirations as a programmer. What are you doing working on WTF projects?

    Yes, that's me.

    Long story. I do some freelance consulting, I've been working with this guy for most of a decade, and when the consultant he hired to do something out of my fields botched, I was the guy who got called in to do emergency repairs. I would not have picked this project, and if I'd been more involved sooner, it would probably have gone very differently. :)

  • drobnox (unregistered) in reply to Dave

    PICK-based databases store everything as varchar, in effect. However, there is a very comprehensive library of input and output converters built in, for dates and number formats and such.

  • Grue (unregistered)

    What's the point? Well, first... consistency. Technically 'color' and 'colour' are both acceptable in English, but the day you see constants named "color_blue" and "colour_red" next to one another, someone needs a visit from the clue fairy.

    Second, what's the point of two transaction states that are variations on canceled? What's the difference between them? Which one really means "canceled"?

  • Francisco (unregistered) in reply to Jay
    Jay:
    I used to take it for granted that passwords should only be stored encrypted. Then I saw a post on a forum somewhere where the poster pointed out that if a hacker has gained access to your database so that he can read the passwords from your user table, why would he even bother? By knowing the passwords, he could gain access to your database. But if he's already there, why not just read the confidential information that he wants to read? i.e. if he's found a way to read the user table in your database, he can probably read any table in your database. So why get the passwords, then log in to the application and read the names and missions of your spies or whatever? Why not just read them directly from the database? If I was a thief and I broke into somebody's house, my next step wouldn't be to start searching for their spare keys. I'm already in. I'd be searching for the cash and jewels.

    Not that I'm going to abandon encryption. Just an amusing thought.

    I recently heard[1] that the hackers who stole personal information from TKMaxx were using sniffers to grab unencrypted data that was being transmitted over an unencrypted/weakly encrypted[2] wireless network.

    [1] On the PRI Technology Podcast. [2] My memory isn't perfect and I can't get an upgrade.

  • Francisco (unregistered) in reply to Flash
    Flash:
    Jay:
    I used to take it for granted that passwords should only be stored encrypted. Then I saw a post on a forum somewhere where the poster pointed out that if a hacker has gained access to your database so that he can read the passwords from your user table, why would he even bother?

    [...]

    There are situations where a "bad person" can see your tables without having access to your database. Perhaps someone lost one of your backup tapes. Perhaps a developer with a copy of the production database lost his/her laptop. These situations are bad, but with sensitive columns encrypted, you're not completely screwed (just partially).

    That goes twice if you're working on a project for the British Government.

    http://news.bbc.co.uk/1/hi/uk_politics/7570611.stm

  • Wijnand Kroes (unregistered)

    It always strikes me how smart people can make such stupid mistakes. They figured out the MD5 thing and then bypassed its use completely. How come? Anybody?

  • Christian Decker (unregistered)

    It's not really true that all fields are varchar for simplicity: the userid seems to be int ^^

  • Tom (unregistered)

    Storing password in clear text is not bad.

    If you use a network, then you don't want the password to be send across the network, so you calculate a hash based on several fields including the password (e.g. webbrowser's DIGEST authentication).

    The server must be able to do calculate the same hash in order to verify the password, so the password must be available in clear text.

  • (cs) in reply to Wijnand Kroes
    Wijnand Kroes:
    It always strikes me how smart people can make such stupid mistakes. They figured out the MD5 thing and then bypassed its use completely. How come? Anybody?

    The MD5 thing wasn't hard at all in any of the languages in use.

    My guess is that it's just cargo cult; most of the rest of the code was. Full of huge chunks of code cut and pasted, adjacent cases which turn out to be identical but are written in wildly different ways, and so on.

  • (cs) in reply to Tom
    Tom:
    Storing password in clear text is not bad.

    If you use a network, then you don't want the password to be send across the network, so you calculate a hash based on several fields including the password (e.g. webbrowser's DIGEST authentication).

    The server must be able to do calculate the same hash in order to verify the password, so the password must be available in clear text.

    You can do this with an already-hashed password as easily as with a cleartext password. You could then argue that the already-hashed value you store becomes the "real" password, but it's not what the user would type, at least; so, for instance, it gives some protection against getting all of a given person's other passwords too.

Leave a comment on “Encrypted For Your Security”

Log In or post as a guest

Replying to comment #:

« Return to Article