MCPcopy Index your code
hub / github.com/EvaGupta02/AESEncryption / encrypt

Method encrypt

AESApplet.java:62–68  ·  view source on GitHub ↗
(String key, String input)

Source from the content-addressed store, hash-verified

60 }
61
62 private String encrypt(String key, String input) throws Exception {
63 Cipher cipher = Cipher.getInstance(TRANSFORMATION);
64 SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(), ALGORITHM);
65 cipher.init(Cipher.ENCRYPT_MODE, secretKey);
66 byte[] encryptedBytes = cipher.doFinal(input.getBytes());
67 return Base64.getEncoder().encodeToString(encryptedBytes);
68 }
69
70 private String decrypt(String key, String encryptedText) throws Exception {
71 Cipher cipher = Cipher.getInstance(TRANSFORMATION);

Callers 1

actionPerformedMethod · 0.95

Calls 1

initMethod · 0.80

Tested by

no test coverage detected