MCPcopy Create free account
hub / github.com/Firebasky/Java / AESencode

Class AESencode

Shiro/shiro550/src/main/java/com/firebasky/exp/AESencode.java:11–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected