后端使用下面的 Java 代码进行 AES 加密。
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.xml.bind.DatatypeConverter;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
/**
* This example program shows how AES encryption and decryption can be done in Java.
* Please note that secret key and encrypted text is unreadable binary and hence
* in the following program we display it in hexadecimal format of the underlying bytes.
* @author Jayson
*/
public class AESEncryption { …Run Code Online (Sandbox Code Playgroud)