As part of a project for school I've been tasked with designing a secure application that should be able to upload and download files from a database. I have very little experience in the area of security so I'm unsure of where to start so I decided to start with the user-database interaction.

My rough idea of what I want made:

  1. The user logs in to the desktop application with a username and password.

I've searched around on google for quite a while but I can not find anything on how to do this securely. An idea I had was to authenticate the user somehow against a database server containing user logins, but from my understanding, this is not safe because of re-routing. What is the safest way to implement this?

  1. The user then has the ability to upload or download files via the application to a database server over LAN.

Is this even possible to do? I was planning on using a three-tier architecture design with an application server in the middle essentially making sure the user is authorized to receive or upload the information from/to the database, with the added security of needing to be logged in to the desktop application to be able to do anything. The communication between the client-app server-database would also all be encrypted to further security.

My questions are essentially; is this system even possible to make? Is there a better, more secure, implementation that is recommended here that I could use? Is my proposed system even physically possible? If not, what can I do to make it so? What parts are missing in between?

  • welcome, from practical perspectives solutions exist, eg. see ownCloud or NextCloud client-side apps among others.. but either way i propose you consider your threat model, identify your constraints, break down your requirements - (don't forget to keep a consolidated list of assumptions) - all this will inform your design and cut the solution-space down - you'll know your deployment environments, which controls/ keys apply, users and value of the information, applicable legislation, lifeycle/ processes/ workflows, tech and protocols, external dependencies, etc. enjoy learning and have fun!
    – brynk
    Commented Dec 10, 2022 at 1:33
  • Is the database per-user, or shared across multiple users? How are user accounts created (e.g. are they student/faculty/employee accounts where there's some centrally managed directory, or is there a central account list but individuals can freely sign themselves up, or is the user account creation and authentication only local to the client with no central user directory at all?) These questions are important to determine how to secure a system like this. For example, with a centrally managed directory, it's pretty easy; with a shared DB but client-only users, it's basically impossible.
    – CBHacking
    Commented Jan 13, 2023 at 9:42

1 Answer 1


The "three tier architecture" is how almost every single online application works. Users don't have direct access to the database, and the database credentials are used by the application. The user interacts with the application, and the application interacts with the database.

The user logs in to the desktop application with a username and password.

Look into "secure password hashing" and you will get some ideas. The main point is to concatenate the user's password with a random string (the salt), hash it several times, and store the salt and result. When the user tries to log in, you re-hash the password with the salt and compare the result with the one stored on the database.

The user then has the ability to upload or download files via the application to a database server over LAN.

It's possible. A file is just a string, maybe a very large string, but it's a string. The application validates if the user have permission to upload the file, reads the file from the user, and inserts into the database (maybe encode it, or compress it).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .