Developing a Secure File Vault Application

01

Recurring CSRF Token Errors During Form Submissions

Solution: Implemented Flask-WTF’s CSRFProtect and added token generation to each form.

02

Encryption Key Management

  1. Initially used hardcoded keys (insecure practice)
  2. Moved to environment variables for key storage
  3. Finally, implemented key_generator.py for user-generated keys

Lesson: Proper key management is fundamental to security. Never hardcode or commit encryption keys to version control.

03

GitHub and Version Control

  1. Accidentally pushed sensitive data (encryption keys) to GitHub
  2. Exposed upload folder contents

Solutions:

  1. Implemented .gitignore to exclude sensitive files
  2. Reconfigured repository to exclude the uploads folder
  3. Used environment variables for sensitive information

Lessons:

  • Always set up .gitignore before initial commit
  • Regularly review committed files for sensitive information