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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:01:00+00:00 2026-05-22T03:01:00+00:00

I would like to encrypt a file as it gets uploaded, generally what happens

  • 0

I would like to encrypt a file as it gets uploaded, generally what happens is that it gets written to disk and then you can encrypt it from there, I would like to encrypt it before that happens.
Is there any module for a http server or for an application framework that would allow me to do that, I don’t want to spend a lot of time working on writing the software for this, but if needs must I’ll do it.

The important thing is that no unencrypted record ever touches the hard disk.

The hard drive is already encrypted using aes but as the server can be accessed by a third party without my knowledge I would prefer if there was some way to prevent the actual data being /that/ easily compromised.

  • 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-22T03:01:01+00:00Added an answer on May 22, 2026 at 3:01 am

    What I ended up doing was using mod_wsgi..

    with that I’m able to take the upload as a stream and then encrypt it using PyCrypto
    works nicely

            inputLength  = int(environ.get('CONTENT_LENGTH', 0))
            input = environ['wsgi.input']
            f = open(dropDir + '/input','w')
            while 1:
                    remain = inputLength - f.tell()
                    if remain <= 0: break
                    chunk = input.read(min(chunksize, remain))
                    if  not chunk: break
                    f.write(crypt.encrypt(chunk))
            f.close()
    

    When I do that I end up encrypting the entire postdata using a stateful cipher and writing it into a file, I then save the key to another file after using GnuPG to encrypt that.

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

Sidebar

Related Questions

I have a dictionary object which i would like to encrypt, then put it
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
I would like to use OpenSSL's cms library to encrypt a file with a
I have a program that reads server information from a configuration file and would
Is it possible to encrypt a folder using AES? just like how File.Encrypt(folderName) would
I am implementing a simple license-file system, and would like to know if there
So I would like to load a set of assembly instructions from a file,
I would like to encrypt a file using a symmetric key and decrypt it
I would like to write application (as background service) which will encrypt whole file
Would like to know the best way to encrypt and decrypt an XML file

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.