fork(12) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Base64;
  7.  
  8. import javax.crypto.Cipher;
  9. import javax.crypto.spec.SecretKeySpec;
  10. import java.security.GeneralSecurityException;
  11.  
  12. /* Name of the class has to be "Main" only if the class is public. */
  13. class Ideone
  14. {
  15. public static void main (String[] args) throws java.lang.Exception
  16. {
  17. byte[] buf = Base64.getDecoder().decode("AutMdzthDvPlE+UnhcHa2h4UZGPdme7t");
  18. System.out.println(buf.length);
  19. String key = "" + 2270457870L;
  20. byte[] keyBytes = key.getBytes("UTF8");
  21. System.out.println(keyBytes.length);
  22.  
  23. Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding");
  24. cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(keyBytes, "Blowfish"));
  25.  
  26. byte[] newBytes = cipher.doFinal(buf);
  27. System.out.println(newBytes.length);
  28. System.out.println(Arrays.toString(newBytes));
  29. }
  30. }
Success #stdin #stdout 0.22s 321856KB
stdin
Standard input is empty
stdout
24
10
16
[-42, 63, 55, -39, -53, -94, -65, 76, -89, 64, -4, -74, 63, -110, -36, -29]