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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:27:28+00:00 2026-05-31T11:27:28+00:00

I have a program that regularly appends small pieces (say 8 bytes) of sensitive

  • 0

I have a program that regularly appends small pieces (say 8 bytes) of sensitive data to a number of logfiles. I would like this data to be encrypted. I want the program to start automatically at boot time, so I don’t want to type a password at program start. I also don’t want it to store a password somewhere, since that would almost defeat the purpose of encryption.

For these reasons, it seems to me that public key encryption would be a good choice. The program knows my public key, but my private key is password protected somewhere else.

So far, so good. But when I try to use PyCrypto to RSA (or ElGamal)-encrypt a small 5-byte string, the output explodes to 128 bytes. My logfiles are large enough as it is… On the other hand, when I try a symmetric crypto, like Blowfish, the output string is just as large as the input string.

So, my question is: Is there a reasonably secure public key encryption algorithm where I can encrypt data 8 bytes at a time and don’t have it blow up? (I guess a factor of 2 would be OK). I think what I want is a public key stream cipher.

If there is not such a thing, I think I will just give up and use a symmetric crypto and give the password manually on startup.

  • 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-31T11:27:29+00:00Added an answer on May 31, 2026 at 11:27 am

    Typically this is solved in the way that the program creates some (real) random numbers which are used as a secret key to a symmetric encryption algorithm.

    In you program you have to do something like:

    1. Generate some real random data (maybe use /dev/random) as a secret key.
    2. Encrypt the secret key with the public key algorithm.
    3. Use the secret key for some other symmetric algorithm.

    To decrypt this,

    1. Use the private key to decrypt the secret key.
    2. Use the secret key and the symmetric algorithm to decrypt the data.

    You might want to get some random data (e.g. >=256bit) for a ‘good’ key.

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

Sidebar

Related Questions

I have program that runs fast enough. I want to see the number of
I have a program that uses the mt19937 random number generator from boost::random. I
I have a program that runs a large number of regular expressions (10+) on
I have a program that put logs into a .txt file, updating them regularly
I have a python program that reads floating point values using the following regular
I have program that has a variable that should never change. However, somehow, it
I have a program that spits out both standard error and standard out, and
I have a program that creates a Windows user account using the NetUserAdd() API
I have a program that spits out an Excel workbook in Excel 2003 XML
I have a program that monitors debug messages and I have tried using a

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.