Results 1 to 11 of 11

Thread: Network Security Conundrum

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    27

    Question Network Security Conundrum

    Alrite, so I'm ready to use the Capicom encryption component from microsoft to secure some messages between a client app and a server app. I plan on having them send certain messages back and forth that are often times identical, but their quantity is important. Anyways, here is the security hole i can't figure out a way to stop.

    Client connects to server.

    Client sends encrypted message to server.

    Hacker sniffs this encrypted message, and although it still looks encryped to him, he then masquerades as the client and sends the same message to the server.

    The server has no way of knowing that the message didn't come from the client, and things get all messed up!

    Any ideas on how to stop this?

    Thanks,
    WeezelDS

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Network Security Conundrum

    I assume the server and the client share a common key/password under which messages are encrypted, correct?
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    27

    Re: Network Security Conundrum

    indeed...

    i'm thinking i can't do this very securely w/o a certificate authority, cuz if i sent the password in either plain text or encrypted w/ a predetermined key, the hacker could sniff that too

  4. #4
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Network Security Conundrum

    That's more or less true. Since the Crypto API supports RSA, here what I would do:

    1. The server creates RSA public/private key pairs and assigns them to clients. These would have to be physically transported to the client via a file.
    2. The server also assigns a key pair to itself.
    3. Client connects to the server and presents its public key. If the key is valid, the server responds with its own public key, otherwise it terminates the connection.
    4. The server creates a random key for DES/Triple DES encryption, encrypts it under the clients public key and sends the encrypted random key to the client.
    5. The client decrypts the random key and then encrypts it again using the server's public key, then sends it to the server.
    6. The server decrypts the random key. If it matches the original random key it generated then all is in order and then the data conversation can continue encrypted under the new random key.

    Even if this is sniffed, the hacker won't be able to replay the conversation to the server because every time the conversation key is random. Of course, this doesn't stop the hacker from playing "man in the middle". Also, if the TCP session is hijacked after the conversation key exchange takes place, the hacker still won't know the conversation key's clear value in order to continue the conversation.

    Hope this all makes sense.
    Last edited by ntg; Apr 28th, 2005 at 04:36 PM.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    27

    Re: Network Security Conundrum

    yeah, I understand how real security works, i was hoping there was an easier way out

    for some reason i was thinking that capicom couldn't do all that...but since its just a wrapper for the CryptoAPI, i guess it should be able to....

    now to find good documentation for capicom...
    Last edited by WeezelDS; Apr 28th, 2005 at 05:14 PM.

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Network Security Conundrum

    If you decrypt the message and then encrypt it again and send it back, it will appear different, yet still be decryptable using the original key. if you do it on both sides, and it is sent back in the original form, it will be spoofed, right?

  7. #7
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Network Security Conundrum

    Quote Originally Posted by dglienna
    If you decrypt the message and then encrypt it again and send it back, it will appear different, yet still be decryptable using the original key. if you do it on both sides, and it is sent back in the original form, it will be spoofed, right?
    ? ?
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    27

    Re: Network Security Conundrum

    ack....microsoft's documentation for capicom sucks

    i had to wait half an hour for the stupid sdk to install too just to find crappy docs....

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Network Security Conundrum

    See maven's posts about it.

    Client connects to server.

    encrypted

    Client sends encrypted message to server.


    decrypt, and re-encrypt


    Hacker sniffs this encrypted message, and although it still looks encryped to him, he then masquerades as the client and sends the same message to the server.

    can't re-encrypt as he won't have the key

  10. #10
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Network Security Conundrum

    Quote Originally Posted by dglienna
    See maven's posts about it.

    Client connects to server.

    encrypted

    Client sends encrypted message to server.


    decrypt, and re-encrypt


    Hacker sniffs this encrypted message, and although it still looks encryped to him, he then masquerades as the client and sends the same message to the server.

    can't re-encrypt as he won't have the key
    He doesn't need it: the point is that he can just connect to the server and simply replay the sniffed conversation. The weak point of such a simple challenge is just that, if the encrypted conversation is recorded it can simply be replayed.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  11. #11
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Network Security Conundrum

    Quote Originally Posted by WeezelDS
    ack....microsoft's documentation for capicom sucks

    i had to wait half an hour for the stupid sdk to install too just to find crappy docs....
    Here's something I used in my VB6 days. It's a combination of article and sample code ammended by myself. This will allow you to play a bit with RSA. With .Net available, all this now seems quite a hack and it is.
    Attached Files Attached Files
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width