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 9154979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:30:56+00:00 2026-06-17T12:30:56+00:00

I have a python application that creates a subprocess, opens a socket to communicate

  • 0

I have a python application that creates a subprocess, opens a socket to communicate with it, then creates a multiprocessing.connection object over the socket. The connection object uses a shared key (randomly generated) and hmac to ensure that no other process will be allowed to communicate over the connection.

On Linux, this works perfectly. On windows, I get the error:

multiprocessing.AuthenticationError: digest received was wrong

The key is a string of randomly generated bits which is pickled before being sent to the subprocess by its stdin:

authkey = ''.join([chr(random.getrandbits(7)) for i in range(20)])

And I have checked carefully that the key matches on both ends of the connection this-a-way:

 print "key:", ' '.join([str(ord(x)) for x in authkey])

The server is started with:

 l = multiprocessing.connection.Listener(
         ('localhost', int(port)), authkey=authkey)

..and the client is started with:

 c = multiprocessing.connection.Client(
         ('localhost', int(port)), authkey=authkey)

Both processes are running on the same machine, with the same version of python.

Stranger yet, I have found that if I fix the key (say, authkey=’test’), then I still get the AuthenticationError the first time I run the program, but not on subsequent runs.

  • 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-06-17T12:30:57+00:00Added an answer on June 17, 2026 at 12:30 pm

    The solution appears to be to use os.urandom to generate the key rather than the method shown above. I do not know why this has any effect–in either case we’re passing random byte strings. The solution is also more correct from a security standpoint because getrandbits is not intended for cryptographic use.

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

Sidebar

Related Questions

I have a Python application in the bottle web-server that accesses a C shared-object
I have an application that uses Django 1.3 installed in python's site-packages. I want
I have a Python application that uses ConfigParser.ConfigParser() to access a configuration file. I
I want to run javascript/Python/Ruby inside my application. I have an application that creates
I have designed a small application in Python under Windows, that uses opencv. I
I have a small GTK python application that imports a package (Twisted) that may
I have a multi-process python application (processes are spawned by uwsgi) that needs to
I have a web application build in Django + Python that interact with web
I have this code in a C application that's embedding Python (2.7.1): { PyObject
I have a problem with an application that uses the GD PHP library, it

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.