Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3693404
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:22:24+00:00 2026-05-19T04:22:24+00:00

Let’s say I have a server listening on port 1234. I have some client

  • 0

Let’s say I have a server listening on port 1234. I have some client software that needs to be able to connect to this port. But I want to prevent malicious users from bypassing the client software and connecting to the port by some other means (such as in a console or another piece of software).

The trusted client software and the server may share a secret key, if necessary. I’d prefer not to send such a key in plaintext, but data after the authentication can be in plaintext. Specifically, I’m trying to figure out how to defeat a man-in-the-middle attack where the malicious user is using the trusted client software to calculate correct responses to server challenges.

Can I get there from here?

I could have the server’s listening port bind only to localhost and require that clients first gain access to the machine via ssh. Then the client software could use an ssh library to run a command on the server that connects to the local port (in this scenario, the malicious user would be unable to use ssh to access the machine because he would not have the password). But then all my traffic is encrypted, which is additional overhead. Perhaps there is a program similar to ssh that only does the authentication but then leaves the channel in plaintext after that?

Update:

I ran a test to determine the overhead associated with encrypting all traffic.

spew.rb outputs 10 million 100-character lines.

CONTROL:

fantius@machine> time /home/fantius/spew.rb > /dev/null

real    0m35.015s
user    0m34.934s
sys     0m0.084s

top shows 25% cpu usage (one full core, of four cores)

TEST:

fantius@machine> time ssh localhost /home/fantius/spew.rb > /dev/null

real    0m40.704s
user    0m19.981s
sys     0m1.400s

top shows 45% cpu usage (almost two full cores)

So I’m having trouble buying the argument that the cost of encrypting everything is minimal. Granted, this is a very data-heavy test.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:22:25+00:00Added an answer on May 19, 2026 at 4:22 am

    Anything you do to secure the link can/will be subverted. You can go with SSL to prevent the link being sniffed, you can embed keys in the app. But then those keys are in the hands of the user and can be extracted (no matter how hard you work to hide them). At most you can make it “hard” for a malicious user to emulate/replace/bypass your remote app. You can never make it impossible.

    SSL overhead is minimal – there’s generally higher overhead in the initial handshake than there is to actually transmit the data later on. If you keep the link open, the handshake overhead becomes a one-time thing and on a long session, irrelevant. There’s occasional bursts of overhead if keys get renegotiated, but again, on a long-term link, it’s minimal.

    As for man-in-the-middle, there’s very little you can do. Banks already have enough trouble as is with trojans draining peoples’ accounts dry. If someone’s in the middle, they can do pretty much whatever they want. With enough monitoring, they could replicate the entirety of your communications protocol and replicate your app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me explain best with an example. Say you have node class that can
Let's say that I have a SQLite database that I create in a separate
Let's say for a moment that I have the following module in python: class
Let's say I have a posts table that has many comments (and a comment
Let's say you have a class library project that has any number of supplemental
Let's say I have an abstract parent class called shape, and that there are
Let me frame it this way.. Say I have an application server running on
Let's say if the user is able to select some directories to search. And
Let say I have my view that I use it as a toggle button.
Let's say, I have an application that access(read/write) the file system(files inside application), Active

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.