MCPcopy Create free account
hub / github.com/Card-Forge/forge / encrypt

Method encrypt

forge-core/src/main/java/forge/util/Base64Coder.java:375–381  ·  view source on GitHub ↗
(String value)

Source from the content-addressed store, hash-verified

373 };
374
375 public static String encrypt(String value) throws Exception {
376 SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
377 SecretKey key = keyFactory.generateSecret(new PBEKeySpec(PASSWORD));
378 Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
379 pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(SALT, 20));
380 return String.valueOf(encode(pbeCipher.doFinal(value.getBytes(StandardCharsets.UTF_8))));
381 }
382
383 public static String decrypt(String value) throws Exception {
384 SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");

Callers

nothing calls this directly

Calls 4

encodeMethod · 0.95
getInstanceMethod · 0.45
initMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected