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

Method decrypt

AESApplet.java:70–77  ·  view source on GitHub ↗
(String key, String encryptedText)

Source from the content-addressed store, hash-verified

68 }
69
70 private String decrypt(String key, String encryptedText) throws Exception {
71 Cipher cipher = Cipher.getInstance(TRANSFORMATION);
72 SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(), ALGORITHM);
73 cipher.init(Cipher.DECRYPT_MODE, secretKey);
74 byte[] encryptedBytes = Base64.getDecoder().decode(encryptedText);
75 byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
76 return new String(decryptedBytes);
77 }
78}
79/*<applet code = "AESApplet.class" width = "1000" height = "1000">
80</applet>

Callers 1

actionPerformedMethod · 0.95

Calls 1

initMethod · 0.80

Tested by

no test coverage detected