Symmetric Encryption Online Tool
Pure frontend page, no backend required.
Live Demo: Symmetric Encryption Tool
The webpage supports PWA and can be added as a shortcut to your desktop for offline use.
You can use the demo directly, but it’s recommended to build and deploy the service yourself for greater peace of mind.
The project is built with create-react-app using the cra-template-pwa-typescript template. The webpage theme color mimics the GitHub Dark Dimmed theme.
Local Development
- Clone this project.
npm i
or yarn
npm run start
or yarn start
- Open http://localhost:3000/
Build
npm run build
or yarn build
- The output will be in the
/build
directory at the root.
Usage
- Provide plaintext and a key, then click the Encrypt button to get the encrypted ciphertext. It will be automatically copied to your clipboard.
- Provide ciphertext and a key, then click the Decrypt button to get the original plaintext. For security reasons, it will not be automatically copied to the clipboard to prevent other software from reading sensitive plaintext from your clipboard.
- If you need to copy the original plaintext to your clipboard after decryption, please click the Copy button below.
Project Philosophy
- You should save the encrypted ciphertext and key yourself. This project does not (and should not) provide any storage functions.
- Because the algorithms used are public (principles explained below), encrypted ciphertext may still be vulnerable to brute-force attacks. Therefore, it’s best not to store ciphertext in public places.
- Keys should be memorized, not written down somewhere.
- If possible, please be sure to deploy and use your own service. For tools involving sensitive information like encryption and decryption, trust yourself, not tools provided by strangers.
How It Works
Based on crypto-js, specifically using its AES encryption algorithm.
The main code is as follows:
```typescript
import AES from ‘crypto-js/aes’;
import encUtf8 from ‘crypto-js/enc-utf8’;
// Encrypt
export const encode = (msg: string, key: string): string => AES.encrypt(msg, key).toString();
// Decrypt
export const decode = (ciphertext: string, key: string): string => AES.decrypt(ciphertext, key).toString(encUtf8)