| 8 | |
| 9 | |
| 10 | public class AESencode { |
| 11 | public static void main(String[] args) throws Exception { |
| 12 | String path = "/Users/xxxx/Desktop/java/ShiroTool/cc11"; |
| 13 | byte[] key = Base64.decode("kPH+bIxk5D2deZiIxcaaaA=="); |
| 14 | AesCipherService aes = new AesCipherService(); |
| 15 | ByteSource ciphertext = aes.encrypt(getBytes(detectpath), key); |
| 16 | System.out.printf(ciphertext.toString()); |
| 17 | } |
| 18 | |
| 19 | |
| 20 | public static byte[] getBytes(String path) throws Exception{ |
| 21 | InputStream inputStream = new FileInputStream(path); |
| 22 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| 23 | int n = 0; |
| 24 | while ((n=inputStream.read())!=-1){ |
| 25 | byteArrayOutputStream.write(n); |
| 26 | } |
| 27 | byte[] bytes = byteArrayOutputStream.toByteArray(); |
| 28 | return bytes; |
| 29 | |
| 30 | } |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected