⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 Advanced Encrypt Algorithm (AES) is a symetric method to crypt message or document
💻 JAVA
字号:

package aes;
import java.util.*;
public class Main {

    public static void main(String[] args) {
          String cle_String="000102030405060708090a0b0c0d0e0f";
          AES aes=new AES(cle_String);
          String plaintext="Je suis Salem Mathlouthi. Ceci est un test de la m閠hode AES-128";
          int plaintext_length=plaintext.length();
          for(int i=0;i<(AES.Nb4-plaintext_length%AES.Nb4);i++)plaintext+=" ";
          byte[]plaintext_bytes=plaintext.getBytes();
          
          byte[]ciphertext_bytes=new byte[plaintext_bytes.length];
          byte[]ciphertext2plaintext_bytes=new byte[plaintext_bytes.length];
          byte []b=new byte[AES.Nb4];
          
          for(int i=0;i<plaintext_bytes.length;i+=AES.Nb4){
              System.arraycopy(plaintext_bytes,i,b,0,AES.Nb4);
              aes.chiffre(b);
              System.arraycopy(b,0,ciphertext_bytes,i,AES.Nb4);
          }

          System.out.println(new String(ciphertext_bytes));
          for(int i=0;i<ciphertext_bytes.length;i+=AES.Nb4){
              System.arraycopy(ciphertext_bytes,i,b,0,AES.Nb4);
              aes.dechiffre(b);
              System.arraycopy(b,0,ciphertext2plaintext_bytes,i,AES.Nb4);
          }
          System.out.println(new String(ciphertext2plaintext_bytes));
    }
   
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -