For a Crypto class we've been given a DESede ciphertext using ECB with no padding => "6t8Z5bKl5ybJL+MiFerNBmiTDS7wlTEUdWNwJJApWmQ==" which is in base64 form. We were given clues about the key and so I constructed all possible keys (where all are in an ASCII format).
String strToDecrypt="6t8Z5bKl5ybJL+MiFerNBmiTDS7wlTEUdWNwJJApWmQ==";
byte[] input = strToDecrypt.getBytes();
//Decrypt
Cipher b = Cipher.getInstance("DESede/ECB/NoPadding");
b.init(Cipher.DECRYPT_MODE, keySpec);
byte output[] = b.doFinal(input);
String out = new String(output);
System.out.println(new String(out));
When I run this code using my keys, I get an IllegalBlockSizeException as my input isn't a multiple of 8 bytes. I'm confused as to which "bases" to use. As I've said above, the ciphertext is in base64 so When running Cipher.DECRYPT should I be giving keys in a certain "base" or the string I want to decrypt in a certain base.