The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Upload.cshtml 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. @model Teknik.Areas.Help.ViewModels.UploadHelpViewModel
  2. <div class="container">
  3. <ol class="breadcrumb">
  4. <li><a href="@Url.SubRouteUrl("help", "Help.Index")">Help Index</a></li>
  5. <li class="active"><a href="#">Uploads</a></li>
  6. </ol>
  7. <div class="row">
  8. <div class="col-sm-10 col-sm-offset-1">
  9. <h2 class="text-center"><b>Uploads</b></h2>
  10. <hr>
  11. <h3>Encryption Method</h3>
  12. <br />
  13. <h4>Using the Browser (Client Side Encryption)</h4>
  14. <p>
  15. When you using the web interface for uploads, the file is loaded using the javascript <a href="https://developer.mozilla.org/en-US/docs/Web/API/FileReader">FileReader</a> API.
  16. </p>
  17. <p>
  18. Once the file is completely loaded into the buffer, a key and iv are generated by a random string generator to create a key that is <b>@Config.UploadConfig.KeySize Bits</b> and an iv (Block Size) that is <b>@Config.UploadConfig.BlockSize Bits</b>.
  19. Then the file buffer, key, and iv are passed into a Web Worker for encryption.
  20. </p>
  21. <p>
  22. The file data is passed through a progressive ciphering with a chunk size of <b>@Config.UploadConfig.ChunkSize Bytes</b>. This is to help reduce the memory usage needed by the encryption process as it only needs to process and convert each chunk instead of the entire file.
  23. </p>
  24. <p>
  25. Once all the file's data has been processed, the final buffer is then passed back to the main encryption routine and is sent to the server as a ArrayBuffer, along with the content-type, generated iv, key size, and block size.
  26. </p>
  27. <p>
  28. Once the data has been recieved by the server, a unique URL name and unique local filename are generated and saved to the database along with the passed up cipher information. The File Data is then written to the server and the resulting URL is passed back to the client.
  29. </p>
  30. <p>
  31. When the client recieves the returned URL, it then appends the generated key to the URL as an anchor tag and updates the UI to display the final URL.
  32. </p>
  33. <br />
  34. <h3>Cipher Properties</h3>
  35. <p>
  36. The encryption library being used is <a href="http://code.google.com/p/crypto-js/">Crypto-JS</a> and the cipher being used is <b>AES-@Config.UploadConfig.KeySize</b> using the mode <b>CTR</b>. The variant of AES is determined by the size of the key used (128, 192, or 256).
  37. </p>
  38. <h3>Upload Requirements</h3>
  39. <p>
  40. The maximum file size per upload is <b>@StringHelper.GetBytesReadable(Model.MaxUploadSize)</b>
  41. </p>
  42. <p>
  43. Each file is scanned for viruses at upload. If it fails, it will cancel the upload. Currently only files that are unencrypted when being sent to the server will be scanned successfully for viruses. If the file is encrypted client side, the encrypted data will be checked. This could create a false positive, but since the key is randomly generated, the next attempt should not be flagged.
  44. </p>
  45. </div>
  46. </div>
  47. </div>