MCPcopy Create free account
hub / github.com/e2wugui/zeze / Encrypt

Method Encrypt

ZezeJava/ZezeJava/src/main/java/Zeze/Net/Encrypt.java:18–31  ·  view source on GitHub ↗
(@NotNull Codec sink, byte @NotNull [] key)

Source from the content-addressed store, hash-verified

16 private int count = 0;
17
18 public Encrypt(@NotNull Codec sink, byte @NotNull [] key) throws CodecException {
19 this.sink = sink;
20 iv = new byte[16];
21 in = new byte[16];
22 System.arraycopy(Digest.md5(key), 0, iv, 0, 16);
23 ivr = ByteBuffer.wrap(iv);
24 ivw = ByteBuffer.wrap(iv);
25 try {
26 cipher = Cipher.getInstance("AES/ECB/NoPadding");
27 cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(iv, "AES"));
28 } catch (Exception e) {
29 throw new CodecException(e);
30 }
31 }
32
33 private void succeed() {
34 try {

Callers

nothing calls this directly

Calls 4

md5Method · 0.95
wrapMethod · 0.95
initMethod · 0.65
getInstanceMethod · 0.45

Tested by

no test coverage detected