Wrote /root/JavaX-Caches/tmp_1008950146/main.java - 3277 bytes (written=3277, should be 3277) javac=0, ecj=1, useJarBot=0 Checking ECJ at port 4898 at 127.0.0.1 /root/jdk-17/bin/javac -source 1.8 -target 1.8 -nowarn -encoding utf8 -Xdiags:verbose -cp /root/.javax/x30.jar:/root/dexcompiler/android.jar:/root/dexcompiler/support-v4-22.2.1.jar:/root/javafx/javafx.base.jar:/root/javafx/javafx.graphics.jar:/root/javafx/javafx.swing.jar -d /root/JavaX-Caches/tmp_908555296 /root/JavaX-Caches/tmp_1008950146/main.java 2>&1
[Compilation Error]

Compiler errors. Medium transpile. Show Java sources. Show snippet. Edit.

/root/JavaX-Caches/tmp_1008950146/main.java:1: error: class, interface, or enum expected !636 ^ /root/JavaX-Caches/tmp_1008950146/main.java:9: error: class, interface, or enum expected main { ^ /root/JavaX-Caches/tmp_1008950146/main.java:12: error: class, interface, or enum expected printHex(data); ^ /root/JavaX-Caches/tmp_1008950146/main.java:14: error: class, interface, or enum expected Random ranGen = new SecureRandom(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:15: error: class, interface, or enum expected byte[] salt = new byte[8]; // 8 grains of salt ^ /root/JavaX-Caches/tmp_1008950146/main.java:16: error: class, interface, or enum expected ranGen.nextBytes(salt); ^ /root/JavaX-Caches/tmp_1008950146/main.java:18: error: class, interface, or enum expected String pw = "pw"; ^ /root/JavaX-Caches/tmp_1008950146/main.java:19: error: class, interface, or enum expected byte[] enc = encrypt(data, pw.toCharArray(), salt); ^ /root/JavaX-Caches/tmp_1008950146/main.java:20: error: class, interface, or enum expected printHex(enc); ^ /root/JavaX-Caches/tmp_1008950146/main.java:21: error: class, interface, or enum expected System.out.println("enc length: " + enc.length); ^ /root/JavaX-Caches/tmp_1008950146/main.java:23: error: class, interface, or enum expected byte[] dec = decrypt(enc, pw.toCharArray(), salt); ^ /root/JavaX-Caches/tmp_1008950146/main.java:24: error: class, interface, or enum expected System.out.println("decrypted: " + new String(dec, "UTF-8")); ^ /root/JavaX-Caches/tmp_1008950146/main.java:25: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_1008950146/main.java:29: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_1008950146/main.java:33: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_1008950146/main.java:37: error: class, interface, or enum expected for (int i = 0; i < len; i++) { ^ /root/JavaX-Caches/tmp_1008950146/main.java:37: error: class, interface, or enum expected for (int i = 0; i < len; i++) { ^ /root/JavaX-Caches/tmp_1008950146/main.java:37: error: class, interface, or enum expected for (int i = 0; i < len; i++) { ^ /root/JavaX-Caches/tmp_1008950146/main.java:39: error: class, interface, or enum expected stringBuilder.append(s.substring(s.length()-2, s.length())); ^ /root/JavaX-Caches/tmp_1008950146/main.java:40: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_1008950146/main.java:42: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_1008950146/main.java:52: error: class, interface, or enum expected KeySpec spec = new PBEKeySpec(password, salt, 65536, 128); ^ /root/JavaX-Caches/tmp_1008950146/main.java:54: error: class, interface, or enum expected SecretKey tmp = factory.generateSecret(spec); ^ /root/JavaX-Caches/tmp_1008950146/main.java:55: error: class, interface, or enum expected SecretKey secret = new SecretKeySpec(tmp.getEncoded(), "AES"); ^ /root/JavaX-Caches/tmp_1008950146/main.java:56: error: class, interface, or enum expected return secret; ^ /root/JavaX-Caches/tmp_1008950146/main.java:57: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_1008950146/main.java:59: error: class, interface, or enum expected public static byte[] encrypt(byte[] data, char[] password, byte[] salt) { ^ /root/JavaX-Caches/tmp_1008950146/main.java:64: error: class, interface, or enum expected Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); ^ /root/JavaX-Caches/tmp_1008950146/main.java:65: error: class, interface, or enum expected cipher.init(Cipher.ENCRYPT_MODE, secret); ^ /root/JavaX-Caches/tmp_1008950146/main.java:66: error: class, interface, or enum expected AlgorithmParameters params = cipher.getParameters(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:67: error: class, interface, or enum expected byte[] iv = params.getParameterSpec(IvParameterSpec.class).getIV(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:67: error: <identifier> expected byte[] iv = params.getParameterSpec(IvParameterSpec.class).getIV(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:68: error: class, interface, or enum expected new ByteArrayOutputStream baos; ^ /root/JavaX-Caches/tmp_1008950146/main.java:69: error: class, interface, or enum expected baos.write(cipher.update(data)); ^ /root/JavaX-Caches/tmp_1008950146/main.java:70: error: class, interface, or enum expected baos.write(cipher.doFinal()); ^ /root/JavaX-Caches/tmp_1008950146/main.java:71: error: class, interface, or enum expected byte[] ciphertext = baos.toByteArray(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:72: error: class, interface, or enum expected return ciphertext; ^ /root/JavaX-Caches/tmp_1008950146/main.java:73: error: class, interface, or enum expected } catch (Exception e) { ^ /root/JavaX-Caches/tmp_1008950146/main.java:75: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_1008950146/main.java:82: error: class, interface, or enum expected Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); ^ /root/JavaX-Caches/tmp_1008950146/main.java:83: error: class, interface, or enum expected cipher.init(Cipher.ENCRYPT_MODE, secret); ^ /root/JavaX-Caches/tmp_1008950146/main.java:84: error: class, interface, or enum expected AlgorithmParameters params = cipher.getParameters(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:85: error: class, interface, or enum expected byte[] iv = params.getParameterSpec(IvParameterSpec.class).getIV(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:85: error: <identifier> expected byte[] iv = params.getParameterSpec(IvParameterSpec.class).getIV(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:88: error: class, interface, or enum expected cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); ^ /root/JavaX-Caches/tmp_1008950146/main.java:89: error: class, interface, or enum expected new ByteArrayOutputStream baos; ^ /root/JavaX-Caches/tmp_1008950146/main.java:90: error: class, interface, or enum expected cipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(iv)); ^ /root/JavaX-Caches/tmp_1008950146/main.java:91: error: class, interface, or enum expected baos.write(cipher.update(ciphertext)); ^ /root/JavaX-Caches/tmp_1008950146/main.java:92: error: class, interface, or enum expected baos.write(cipher.doFinal()); ^ /root/JavaX-Caches/tmp_1008950146/main.java:93: error: class, interface, or enum expected return baos.toByteArray(); ^ /root/JavaX-Caches/tmp_1008950146/main.java:94: error: class, interface, or enum expected } catch (Exception e) { ^ /root/JavaX-Caches/tmp_1008950146/main.java:96: error: class, interface, or enum expected } ^ 52 errors