GithubHelp home page GithubHelp logo

fileprotector's Introduction

FileProtector

A file protector for Asp.net website to secure confidential files.

File Protector project is to secure confidential files in encrypted format to keep these files safe from downloading/surfing. We can secure any type of file using executable available in this repository. This works with asp.net web applications. This is under development for asp.net core website and not working for this version. To use this project to secure files a database connection is required as attached executable encrypts specified files and saves in database to protect.

How to Use:

1: Create a sql server database with any name. We can use our application database to keep encrypted files.

2: Extract FileEncryptor.zip and open FilePathGenerator.exe as below:
file path generator

3: Browse the folder within website/webapplicaiton folder whose files need to be encrypted.

select folder

4: In extensions field, enter comma seperated file extensions to encrypt.

5: Enter database connection string in connection string text box.

6: Press generate button.

After pressing generate button, executable will encrypt all files for given extensions in specified folder. after encrypting files, application will display a message as given below:

handlers

7: copy message and add handler values in web.config file as given below:

<system.webServer>
    <handlers>
      <add verb="*" path="*.htm" type="FileServer.Server, FileServer" name="htmHandler" />
      <add verb="*" path="*.html" type="FileServer.Server, FileServer" name="htmlHandler" />
      <add verb="*" path="*.css" type="FileServer.Server, FileServer" name="cssHandler" />
      <add verb="*" path="*.js" type="FileServer.Server, FileServer" name="jsHandler" />
    </handlers>
  </system.webServer>
 
8: Add following settings in app settings section of web.config file.
<appSettings>
    <add key="FileServerConnectionString" value="ConnectionString for your database"/>
    <add key="FileServerHeader" value="a secure header for your confidiential files"/>
   
  </appSettings>
 
9: After making these changes in your web application, Add reference to FileServer.dll available in repository. 
 
10: Open global.aspx file and in application begin request add following code.
 
  internal protected void Application_BeginRequest(object sender, EventArgs e)
        {
            // Get objects.
            HttpContext context = base.Context;
//header name is static, we can modify header value in both web.config and in begin request.
            context.Request.Headers.Add("FileServerHeader", "a secure header for your confidiential files");
            // Complete.
          
        }
 
That's all.
 
Web application will work as usual but now you can validate if request is coming from valid user. 

fileprotector's People

Contributors

ravisinghunnao avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.