[JAVA] AES security algorithm related - Why do I get different result values?

[JAVA] AES security algorithm related - Why do I get different result values?

hello.

I’m trying to test the AES256 algorithm.


[1. Type of test]

  1. WEB SITE
  2. JAVA Program

[2. Test information]

  1. KEY : sdfhjiodfjisd231sdfhjiodfjisd231
  2. TEXT : ShVmYq3t6w9y$B&E

[3. Actual test results]

  1. site1: https://aesencryption.net/
    256bit /
    output: USZet7l6QkYD/A9S5oIg+PbN/I7qRpWnkwqkKwWFS40=

  2. site2: An Online Tool for AES Encryption and Decryption
    256bit/ECB
    output: Fe+8zzw4vSJJ5qxdGWZSJkTEEBrlb7/NK4Kdt+y+2IQ=

  3. JAVA: Java AES Encryption Decryption Example - HowToDoInJava
    256bit/ECB
    output: IcApWVcdC2qIB58LDtrMaEG95F6Yt7uBmpdhUrx5XuE=

  4. JAVA: Java AES-256 Encryption and Decryption Examples
    256bit/ECB
    output : K5tWglkjfdF4MZPLfPfxbV/mNt9Ugd+2wWS3SMZCH98=

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Base64;

private static String secretKey = "sdfhjiodfjisd231sdfhjiodfjisd231"; 
String originalString = "ShVmYq3t6w9y$B&E";

void setup(){
    size(500, 500);
    println("-------------------------------");
    println(originalString);
    String encryptedString = AES.encrypt(originalString, secretKey); 
    String decryptedString = AES.decrypt(encryptedString, secretKey);
    println(encryptedString);
    println(decryptedString);
    
    println("-------------------------------");
    String encryptedString2 = AES256.encrypt(originalString);
    String decryptedString2 = AES256.decrypt(encryptedString2);
    System.out.println(originalString);
    System.out.println(encryptedString2);
    System.out.println(decryptedString2);
    println("-------------------------------");    
}

I don’t know why the results are different.
Anyone know? help me.