Cipher QR Codes
This page shows the use of the encrypt()
and decrypt()
functions of the Web Crypto API. It contains a quantum-resistant encryption algorithm:
- "AES-GCM-256"
Description:
- QR code works only on short message.
- Cipher, key, IV are in Base16 for human readability.
- A text box containing a message to encrypt.
- A representation of the ciphertext.
- A box that will contain the decrypted ciphertext.
- An "Encrypt" button: this encrypts the text box content.
- A "Decrypt" button: this decrypts the "Ciphertext" and writes the result into the "Short message" box.
Try it:
- Press "Encrypt". The ciphertext should appear.
- Press "Decrypt". The decrypted text should appear, and match the original message.
- Press "New". The new key and IV should appear.
- Edit the text box contents.
- Press "Encrypt" again. A different ciphertext should appear.
- Press "Decrypt" again. The content should appear next to "Short Message:".
For real world application:
- Save complete web page to local storage of the device.
- Test to make sure this web page works offline on the device.
- Do not connect the device online ever again after the device was being used to encrypt/decrypt confidential message.
- Scan/photo/print QR codes on different devices. If transceiving via network, communicate untraceably on all endpoints.
- Do not transceive ciper and key or iv QR Codes using the same media.
AES-GCM-256
QR Codes: Cipher (blue), Key, IV, Key + IV