MCPcopy Create free account
hub / github.com/FongMi/CatVodSpider / CBC

Method CBC

app/src/main/java/com/github/catvod/utils/Crypto.java:38–50  ·  view source on GitHub ↗
(String src, String KEY, String IV)

Source from the content-addressed store, hash-verified

36 }
37
38 public static String CBC(String src, String KEY, String IV) {
39 try {
40 src = src.replace("\\", "");
41 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
42 SecretKeySpec keySpec = new SecretKeySpec(KEY.getBytes(), "AES");
43 AlgorithmParameterSpec paramSpec = new IvParameterSpec(IV.getBytes());
44 cipher.init(Cipher.DECRYPT_MODE, keySpec, paramSpec);
45 byte[] decrypted = cipher.doFinal(Base64.decode(src, Base64.DEFAULT));
46 return new String(decrypted);
47 } catch (Exception ignored) {
48 return "";
49 }
50 }
51
52 public static String aesEncrypt(String data, String key, String iv) throws Exception {
53 SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");

Callers 1

playerContentMethod · 0.95

Calls 1

initMethod · 0.45

Tested by

no test coverage detected