Which attacks are possible concerning my security layer concept?

前端 未结 7 1218
一个人的身影
一个人的身影 2020-12-06 05:11

Despite all the advices to use SSL/https/etc. I decided to implement my own security layer on top of http for my application... The concept works as follows:



        
相关标签:
7条回答
  • 2020-12-06 05:50

    The major problem you have is that your client crypto code is delivered as Javascript over unauthenticated HTTP.

    This gives the Man-In-The-Middle plenty of options. He can modify the code so that it still authenticates with your server, but also sends the password / private key / plaintext of the conversation to him.

    0 讨论(0)
  • 2020-12-06 05:55

    It looks like you've made more complexity than is needed, as far as "home-grown" is concerned. Specifically, I see no need to involve assymetric keys. If the server already knows the user's hashed password, then just have the client generate a session id rolled into a message digest (symmetrically) encrypted via the client's hashed password.

    The best an attacker might do is sniff that initial traffic, and attempt a reply attack...but the attacker would not understand the server's response.

    Keep in mind, if you don't use TLS/SSL, then you won't get hardware-accelerated encryption (it will be slower, probably noticeably so).

    You should also consider using HMAC, with the twist of simply using the user's password as the crypto key.

    0 讨论(0)
  • 2020-12-06 05:55

    SSL/TLS provide transport layer security and what you've done does nothing but do that all over again for only the authorization process. You'd be better served to focus on authorization techniques like client certificates than to add an additional layer of line-level encryption. There's a number of things you could also introduce that you haven't mentioned such as encrypted columns in SQL Server 2008, IPSec, layer 4 & 7 hardware solutions and even setting up trusts between the server and client firewalls. My biggest concern is how you've created such a deep dependency on the username and password, both which can change over time in any system.

    I would highly recommend that you reconsider using this approach and look to rely on more standard techniques for ensuring that credentials are never stored unencrypted on the server or passed in the clear from the client.

    0 讨论(0)
  • 2020-12-06 05:58

    Javascript encryption can be enough when your adversary is an eavesdropper that can see your traffic but not modify it.

    Please note that I am not referring to your specific idea (which I did not take the time to fully understand) but to the general concept of Javascript encryption.

    0 讨论(0)
  • 2020-12-06 05:59

    While I would also advocate the use of SSL/TLS for this sort of thing, there is nothing wrong with going re-inventing the wheel; it leads to innovation, such as the stack exchange series of websites.

    I think your security model is quite sufficient and rather intelligent, although what are you using on the client-side? I'm assuming javascript since you tagged this post with 'web-development'? Or are you using this to communicate with a plug-in of sorts? How much overhead does your implementation produce?

    Some areas of concern:

    -How are you handling initial communication, such as: user login, registration?

    -What about man-in-the-middle attacks (assuring the client that it is talking to the authorized server)?

    0 讨论(0)
  • 2020-12-06 06:15

    Why does everyone have to come up with their secure transport layer? What makes you think you've got something better than SSL or TLS? I simply do not understand the motivation to re-invent the wheel, which is a particularly dangerous thing to do when it comes to cryptography. HTTPS is a complex beast and it actually does a lot of work.

    Remember, HTTPS also involves authentication (eg: being able to know you are actually talking to who you think you are talking to), which is why there exists a PKI and browsers are shipped with Root CA's. This is simply extremely difficult (if not impossible) to re-invent and prone to security holes. To answer you question, how are you defending against MITM attacks?

    TLDR: Don't do it. SSL/TLS work just fine.

    /endrant.

    0 讨论(0)
提交回复
热议问题