Here is the working code.

Copy to Clipboard
Copy to Clipboard






This HTML page contains two text areas and two buttons. The first text area input is used to get the input text from the user. The first button Encrypt is used to encrypt the text entered in the input text area. The second button Decrypt is used to decrypt the text entered in the input text area. The second text area output is used to display the encrypted or decrypted text. The JavaScript functions encrypt and decrypt use the btoa and atob functions respectively to perform the encryption and decryption.