Security
django-xss-cleaner
· β˜• 2 min read
django-xss-cleaner is a bleach-based Django XSSFilter toolkit that implements whitelist XSS filtering for GET and POST request parameters. The package ships with a set of built-in whitelisted HTML tags and attribute settings, and also supports custom extensions. Project address, https://github.com/shaowenchen/django-xss-cleaner 1. Installing and Configuring settings.py Add the middleware xss_cleaner.middlewares.CleanXssMiddleware to

From Account Security to Two-Factor Authentication
· β˜• 4 min read
1. Security Problems Are Getting Worse As the internet permeates every layer of life, we depend more and more on various online IDs. These IDs make up our digital selves and are extremely important account assets. On the other hand, account information leaks and security incidents happen from time to time: CSDN, 12306, Huazhu Hotels, Facebook, Twitter, Uber… the list goes on.

SELinux and iptables
· β˜• 4 min read
While working on servers recently, I ran into a few concepts I wasn’t clear about, so I looked up some references and organized them as follows. 1. The BLP Security Model The model divides the entities in an information system into two parts: Subject: the entity performing the operations, such

Frontend-Backend Symmetric Encrypted Transmission - AES
· β˜• 4 min read
1. Basic Concepts Symmetric encryption: Symmetric encryption is an encryption method that uses a single-key cryptosystem, in which the same key is used both to encrypt and to decrypt the information. Because it is fast, it is often used to encrypt the transmission of large amounts of data. DES (Data

Django Forms Functionality
· β˜• 3 min read
1. Automatically Generating HTML Form Elements A Widget is the tool used to render an HTML element. Specifying a widget 1 2 3 4 5 6 from django import forms class CommentForm(forms.Form): name = forms.CharField() url = forms.URLField() comment = forms.CharField(widget=forms.Textarea) Output of CommentForm().as_table() 1 2 3 4 5 6