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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:16:37+00:00 2026-06-10T15:16:37+00:00

My Delphi 2010 application (currently in development) encrypt users’ files and upload them to

  • 0

My Delphi 2010 application (currently in development) encrypt users’ files and upload them to EC2 and then to S3. Users can download their files using a secure website (kinda like dropbox but in a different context, market, use, etc…)

I use RSA Encryption. I give my users the ability to choose whether they want to use their own private keys (generated locally) or use the shared key (located on the cloud)

When working on file download, I ended up with 4 possibilities that I must handle properly:

  1. If a user uses his/her own private encryption key:

    a. Downloading from Delphi / Client: file is decrypted on user’s machine after download

    b. Downloading from website / PHP: impossible (directly), unless I give the user the possibility to download a small utility that
    allows him/her to locally supply his/her private key and decrypt
    the file after download.

Pros/Cons: Secure, but not straightforward / too restrictive, and impossible to do on mobiles(?)

  1. User choose to use my shared private encryption key (located on the cloud)

    a. Downloading from Delphi / Client: file is first decrypted via PHP on EC2 (then served to the user), in which case the download
    process could become very slow
    if many users are downloading files
    (unlikely) or if the files being decrypted are too large.

    b. Downloading from website / PHP: same as (a)

Pros/Cons: Straightforward/ just works, but may results in a huge CPU usage, unacceptable delay when downloading (esp. if the file size
in question is huge).

My two-part question is:

1) Is there a better strategy to handle such scenario? and

2) What would you do (in term of encryption strategy / handling downloads) if you wanted to offer your users the ability to choose between private and shared encryption keys?

PS. I’m using Delphi 2010 (client) with PHP 5.3 running on the EC2 instance is running the latest standard Amazon Linux 2012 build

EDIT Traffic is always encrypted, so HTTPS only!

EDIT 2 I’m using GPG for encryption / decryption

  • 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-10T15:16:39+00:00Added an answer on June 10, 2026 at 3:16 pm

    If you’re forced to offer server side encryption/decryption, use system()/exec() with openssl or something. I would hate to see PHP used to encryptd/encrypt anything large, simply because it’s not really designed to do so. In that case, it would be important to delete unencrypted version of files after some time.

    As with what you’re trying to do, it’s really difficult to have something secure on the server side. If you’re encrypting/decrypting small stuff, you can probably do it in javascript in your browser – perhaps see https://www.google.com/search?q=javascript+aes&sugexp=chrome,mod=16&sourceid=chrome&ie=UTF-8

    What I would do:

    1) Upload to EC2. Generate a random password, encrypt that with your public key, and store that. You don’t want to use asymmetrical encryption for large stuff. Encrypt with openssl via command line with the previously generated random password. Upload to S3 the encrypted file. Delete (perhaps shred) the unencrypted file.

    2) For downloading, fetch from S3. Have your user upload private key. Use private key to decrypt encrypted version of the previous random password. Now use that password to decrypt the file using openssl. Make the name a hash of something random so it can pass right through nginx/apache without PHP. Have cron clean that up every x minutes.

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

Sidebar

Related Questions

My yet to be released Delphi 2010 application allows users to upload their files
I'm currently working on porting an existing Delphi 5 application to Delphi 2010. It's
With the new extended RTTI in Delphi 2010, can a Delphi application (at run
My 32 bit Delphi 2010 application links to a number of C object files
I am writing a Delphi 2010 application. It has many files, two of which
Application is written in delphi 2010 and the underlying dll is a C++ dll.
I am planning to migrate a Delphi 6 BDE application to Delphi 2010... First
In Delphi 2010, I have placed 2 radio groups onto a form then added
With Delphi 2010 you can get the pixelformat of a jpg file with TJPEGImage
I'm investigating a performance issue with my application written in Delphi 2010. Does Delphi

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.