Security talk 29/04/13

Discussion in 'Feed the Beast News' started by captainnana, Apr 29, 2013.

Thread Status:
Not open for further replies.
  1. Captainnana

    Captainnana New Member

    Hello everyone! I am captainnana one of the web developers here at FTB, today we have joined facebook, google and may other sites in adding two factor authentication to our site.

    Enabling two factor authentication is easy:
    1. Install Google Authenticator on your phone
    2. Hover over your username in the bar above the bar above (be sure you are signed in) and click on two factor authentication. Add a new key
    3. Enter a description for your key.
    4. Open the Google Authenticator app.
    5. Tap menu, then tap "Set up account", then tap "Scan a barcode". (Alternatively you can enter the code manually)
    6. Your phone will now be in a "scanning" mode. When you are in this mode, scan the QRCode
    7. You now have two factor authentication enabled on your account; whenever you login in future you will need to open up the app and enter the code for Feed The Beast
    If you have any issues with our site not recognising the key then click menu, settings, time correction for codes to ensure that your device is in sync.

    Why do I want this?

    Simple answer – It increases the security of your password so if your password were to be known by a third party (bad guy) then they wouldn't be able to login without the code from your phone as well.

    Long answer – There are many ways that a miscreant could get a hold of your password, they could get it from a key logger on your computer, a phishing attack or a database hack on our servers. We take every measure possible to ensure that our servers don’t get hacked however it is always best to prepare for the worst for this reason we take several measures to make sure your passwords are secure. When you signup and enter your password we hash the password using SHA256 twice using a salt:

    sha256(sha256(password) . Salt) - this is a one way hash this means that we do not know the password that you entered we can just check if your input the next time you come is the same.

    The salt is unique for each user however the issue with password based key derivation is that if a miscreant were to attempt to do this hash using the salt for the user with every dictionary word with say 0-99 at the end of it they would find out a lot of users passwords! In contrast to some other websites we use a unique salt for every single user meaning that the miscreant cant simply use the dictionary table once and check to see if anyone has that hash they have to do it for each user which is very time consuming. This process can be done incredibly quickly with modern GPU's and so increasingly this is not enough, so what can be done? Well firstly a strong password can be used, the best are randomly generated ones from a service such as keepass or lastpass this ensures that you cant fall victim to these attacks; it is still possible to crack the passwords but it will take a lot of time as the miscreant has to try each password combination, in future with the speed GPU's are advancing this could well be possible. The second way to fix this problem is to use two factor authentication, this is what I have added to the site today, simply you get a key from the server and combine it with the current linux time in an algorithm to generate a pseudo random string of numbers. Because both the server and the phone know the current time and the key (that’s what you get from the QR code) they both can generate the same string and therefore we know that you are the correct user and can allow login.

    Does FTB really need this? It's not like I am transferring national secrets on here!

    Well to put it plainly no, but with miscreants becoming more advanced every day I want to say ahead of the game, you don’t have to opt into this system but I have put it here to be future proof, in the coming months and years you will start to see a lot more sites using this system, twitter is currently developing one and google and facebook already have it. The great thing about it is that you only need one app for everything I link to google authenticator in this post but equally you could use Microsoft authenticator or a third party one if you so choose!

    Thanks for reading I'm sorry if this post was a bit technical but I found this really cool and I thought some of you might as well so I decided to share it with you.

    lavarthan, QueWhat and Ashzification like this.
  2. bored

    bored New Member

    I have resisted getting an account on this site because I feel that having a proliferation of accounts and passwords is a core reason why password security is problematic, both from a usability PoV and from a security one. (It irks me to no end that I can't see attached pics on the site without having an account).

    Having said that this sounds good.

    One thing you should probably change is that using a simple double SHA256 is not really good enough. You should consider something like which executes the hash 1000 times or more.

    Salted and hashed passwords are a good start, but sophisticated attackers can still make some headway.

    Here are a couple of good articles to look at

    Also, the argument for having secure password storage is not that I am transferring national secrets on this site (IMO), it is that (due to the proliferation of accounts I mentioned earlier) a user is probably sharing usernames and passwords across multiple sites which means that an attack on a site you might not care much about can compromise your account on a site you do care about.
  3. Captainnana

    Captainnana New Member

    To be perfectly honest PBKDF2 is only marginally better than SHA256 at this point, yes it is slower to execute but that ship sailed long ago, nowadays things that only require execution time can be computed very quickly so while it may be slower it is still doable so arguably this is better. PBKDF2 is basically about 1000 iterations of SHA-256 if I remember correctly which means it is a linear scaling system and so can easily be pipe-lined to execute at the same rate as SHA256 given the correct hardware. If I were to change the hash (Which I hope to do someday) I would use scrypt It requires vast amounts of memory to run which slows things down dramatically because you have to put it into memory then back into execution etc so this would be the best solution but lets be honest we could argue about password hashing methods all day.

    Also the national secrets thing was a comment that someone made to me while I was adding the two factor auth, I am well aware of the risks of using the same password on multiple sites and not using strong passwords but I figured that others may not be and so I would try and explain it a bit. But yes you are 100% correct sharing passwords over multiple sites is the number one way that people get hacked so be sure to use different pseudo random passwords on every site guys!

    PS. You say that you are put off from signing up to sites because of the proliferation of accounts, are you using keepass/lastpass/onepass for your passwords if not then try one of them out, nowadays I have no idea what any of may passwords are I just click and they work!
  4. Ashzification

    Ashzification New Member

    Thanks for the info :)
  5. bored

    bored New Member

    Scrypt would be good alternative. I suggested PBKDF2 since it is well known, respected and straight forward. Bcrypt is also good

    However, I don't think that Scrypt makes the kind of difference you are talking about. You can trade time for space and AFAIK Scrypt won't make things less linear. But any of those should be fine.

    You have just outlined why I don't use such things. I have a terrible memory for such things. The only way I can remember what anything is for any site is to force myself to type it. If I make my password manager remember it for me then I am screwed if it ever fails, gets corrupted or (in the case of some products) has its license run out.

    I would hope that some day we could move to a single sign-on technology that worked well. OpenID has some problems and more importantly everyone wants to be a id producer, no one wants to be an id consumer, so that may never happen. But it would be a better fix.

    That's not exactly your problem though ;)
  6. bored

    bored New Member

    Oh, one other thing I forgot to mention.

    You should always consider pass phrases. The following xkcd comic gives the simplistic argument.

    Not sure how practical that would be for you.
  7. QueWhat

    QueWhat New Member

    Great info there Captainnana, thanks for the extra work you put in so that our accounts are secure.

    Bored; if you are really that concerned with security, then why not create a separate email account with a fictitious name, different password, not associated with your other emails, and use that one exclusively with FTB registration? If someone gets into your account here and obtains your email address it would lead to a fictitious name that leads to no other websites, AKA a dead end. I know it is extra work but a one time deal (and not illegal as long as you do not use to defraud anyone). If you really want to be secure then I'd be careful with Facebook and Twitter and posting pictures taken on smart phones (metadata and such), but you sound like you know what you are doing.
    Ashzification likes this.
  8. Zjarek_S

    Zjarek_S New Member

    Now you don't use PBKDF2 with 1000 iterations, you use as many iterations as you can without making big delays. 1000 was minimum amount in 2000, taking only Moore's law into account it should be 400 000 now. Scrypt is better due to memory use (harder for GPU or specialistic systems), but PBKDF2 with sufficient number of iterations is not bad. Bcrypt also has an advantage, because it is available in PHP without need for other libraries (however native crypto library will make it faster).

    Edit: QueWhat: Well, I just use 10miniutemail for every page that require arbitrary registration, like for example this forums. I think that's why my username isn't "Zjarek" (my saved password in password manager stopped working).
    QueWhat likes this.
  9. Captainnana

    Captainnana New Member

    Xenforo are going to be adding bcrypt support in their new version so hopefully we will see that fairly soon.

    To be honest as long as you use random gen passwords and back them up (I use dropbox) then you are good because getting hacked on one site doesn't mean you are on them all.
  10. OmegaPython

    OmegaPython New Member

    Unless you are hacked on dropbox :p
  11. Zjarek_S

    Zjarek_S New Member

    You don't store passwords in plaintext on dropbox, but in format for your password manager, encrypted by it (using long password). It is specially important in dropbox, because you can't count on its security, they have access to your files and sometimes everyone
  12. Captainnana

    Captainnana New Member

    Indeed as Zjarek says you dont just leave them all on there they are protected by dropbox password/security and then if anyone got past that by the AES cipher that is used to encrypt the file which has 1.1x10^27 combinations (256 bit) so to be certain to crack it it takes something like 10 million years (?) which is why AES is used by the government to secure files up to "Top Secret" level.
    QueWhat likes this.
  13. Zjarek_S

    Zjarek_S New Member

    They are not protected by dropbox, but by your password manager. Files on dropbox aren't encrypted using your password, so it doesn't really matter what encryption they use, you can't trust it.
  14. Captainnana

    Captainnana New Member

    I mean for a bad guy to get a hold of the file in the first place they have to bypass dropbox security ;) (and the AES is on my keepass file)
Thread Status:
Not open for further replies.

Share This Page