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

  • Home
  • SEARCH
  • 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 908703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:45:32+00:00 2026-05-15T16:45:32+00:00

We have a custom built program that needs authenticated/encrypted communication between a client and

  • 0

We have a custom built program that needs authenticated/encrypted communication between a client and a server[both in Python].

We are doing an overhaul from custom written Diffie-Hellman+AES to RSA+AES in a non-orthodox way. So I would be very interested in comments about my idea.

Prequisites: Klient has a 128bit RegistrationKey which needs to remain a secret during the authentication – this key is also the only shared secret between the server and client.

  1. Client contacts the server over an insecure channel and asks the servers RSA PubKey
  2. Client then queries the server:
    [pseudocode follows]


       RegistrationKey = "1dbe665ac7a944beb67f106f779e890b"
       clientname = "foobar"
       randomkey = random(bits=128)
       rsa_cp = RSA(key=pubkey, data=randomkey+clientname)
       aes_cp = AES(key=RegistrationKey, data=RegistrationKey+rsa_cp)
       send(aes_cp)


3. Server then responds:
[pseudocode follows]


       # Server decrypts the data and sees if it has a valid RegistrationKey, if it does...
       clientuuid = random(bits=128)
       sharedkey = random(bits=128)
       rsa_cp = RSA(key=privkey, data=clientuuid+sharedkey)
       aes_cp = AES(key=randomkey[got from client], data= rsa_cp)
       send(aes_cp)


Now both sides know the "clientuuid", "sharedkey" which the client can use later to authenticate itself. The method above should be secure even when the attacker learns the regkey later since he would have to crack the RSA key AND man-in-the-middle attacks(on RSA) should stop the auth. from completing correctly.
The only possible attack method I see would be the case where the attacker knows the regkey AND can alter the traffic during the authentication. Am i correct?


I really want to hear your ides on what to add/remove from this method and If you know a much better way to do this kind of exchange.
PS! We are currently using Diffie-Hellman(my own lib, so it probably has flaws) and we have tried TLSv1.2 with PreSharedKeys(didn't work for some reason) and we are CONSTRICTED to http protocols since we need to do this in django. And because we are doing this in http we try to keep the request/answer count as low as possible(no sessions would be the best) - 1 would be the best 🙂

If you have any questions about the specifics, please ask.

So, you crypto/security geeks, please give me a helping hand 🙂

  • 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-15T16:45:33+00:00Added an answer on May 15, 2026 at 4:45 pm

    Don’t re-invent the wheal, use HTTPS.

    The server can issue certificates to the client and store them in the Database. Clients can be distributed with the server’s self-signed certificate for verification. The server can verify clients by using Apache’s HTTPS Environment Variables.

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

Sidebar

Related Questions

I have a python program that uses a custom-built DLL. This DLL crashes due
I have built a custom membership provider that I have used in a previous
I have an program that gets installed via an msi. The msi was built
I have some code that does custom drawing. Basically it is form fill program
I have a python program I wrote that I am trying to compile with
I have a custom built application framework written in PHP which I have been
I have a custom component built for a Joomla 2.5 website. It is working
I have an ASP control custom built and I need to pass a value
i have wordpress blog in my custom built website, i am displaying some posts
I have built a Custom MaskedTextBox , changing the values of BeepOnError and AsciiOnly

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.