Implementation code of AES/ECB/PKCS5Padding algorithm for secret key encryption and decryption of any length consistent with JAVA, Python and PHP

Recently, I encountered an AES encryption algorithm that needs to be implemented in Java, Python, and PHP. In fact, it is not very complicated in nature, but the parameter adjustment is quite troublesome. I found some reference materials and finally got it. The actual code is as follows: Main features The three languages of JAVA, […]

Margin and padding in CSS

Table of Contents 1. margin 1. Concept and function 2. Basic grammar 3.Usage of margin 2. padding 1 Introduction 2. Basic grammar and requirements 3. Usage 4. Padding and element width Before talking about this, let’s look at a picture for easy understanding. 一、margin 1. Concept and function The CSS margin property is used to […]

Java implements national secret SM4/ECB/PKCS7Padding symmetric encryption and decryption

Java implements national secret SM4/ECB/PKCS7Padding symmetric encryption and decryption. For the convenience of demonstration, this question uses IntelliJ IDEA 2022.1 (Community Edition) to build the code. 1. Add the required jars to the pom.xml file <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>SM345</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> </properties> <dependencies> <!–sm3,sm4 encryption algorithm–> […]

Inner spacing padding and outer spacing margin

Padding Definition: Inner spacing—the space between an element and its content Attribute 1—Writing mode Attribute name: padding Common values: Attribute 2—One-way setting Scenario: Set padding separately for only a certain direction of the box Attribute name: padding – orientation noun Attribute value: number + px Example: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” […]

Encrypted padding method (pkcs5/pkcs7/ISO10126 padding/ANSIX923 padding/Zeros padding) external padding

Due to SM2 and other encrypted grouping methods, each time the request is 16byte, it needs to be filled. The filling method is as follows: pkcs5/pkcs7/ISO10126 padding/ANSIX923 padding/Zeros padding explain: pkcs5 is a subset of pkcs7, specially used to fill 8 bytes or multiples of 8, pkcs7 can fill bytes into multiple bytes Definition of […]

padding-machines-for-tor

Build a padding machine from scratch This document describes the process of building a “filler” from scratch in Tor’s new circuit filling framework. A note was taken during the porting of Adaptive Padding (APE) from basket2 to the Circuit Population framework. Our goal is just to document the whole process and provide useful guidance, not […]

[JS Utils] formatNumber number formatting (supports high precision, de-scientific notation, control size range, integer zero padding, supplementary thousandth symbol)

formatNumber (number formatting) Brief description: It is used to format numeric text or numeric-like values, supports high-precision calculations, de-scientific notation, control size range, integer zero padding, supplementary thousandth symbol, radix conversion (In development). Compatibility: The ES6 environment must be supported at least, the ES7 environment must be supported for zero padding or high-precision calculations, and […]