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

Method actionPerformed

AESApplet.java:45–60  ·  view source on GitHub ↗
(ActionEvent e)

Source from the content-addressed store, hash-verified

43 }
44
45 public void actionPerformed(ActionEvent e) {
46 String key = keyField.getText();
47 String input = inputField.getText();
48
49 try {
50 if (e.getSource() == encryptButton) {
51 String encryptedText = encrypt(key, input);
52 outputArea.setText("Encrypted Text:\n" + encryptedText);
53 } else if (e.getSource() == decryptButton) {
54 String decryptedText = decrypt(key, input);
55 outputArea.setText("Decrypted Text:\n" + decryptedText);
56 }
57 } catch (Exception ex) {
58 outputArea.setText("Error: " + ex.getMessage());
59 }
60 }
61
62 private String encrypt(String key, String input) throws Exception {
63 Cipher cipher = Cipher.getInstance(TRANSFORMATION);

Callers

nothing calls this directly

Calls 2

encryptMethod · 0.95
decryptMethod · 0.95

Tested by

no test coverage detected