staticrypt icon indicating copy to clipboard operation
staticrypt copied to clipboard

Save encrypted data in HTML file as Base64

Open jimhark opened this issue 5 months ago • 0 comments

Summary

Store encrypted data, which is as large as the source html file, as Base64. Reduces size by 1/3 and improves performance.

Store the encrypted data as Base64. A data URL is a great way to store data in an HTML file, and it supports Base64 encoding.

Fixes

Fixes #228

Details

  • password_template.html: div added to hold data URL
  • cryptoEngine.js provides Base64Encoder
  • cli/index.js: encryptedMatch now matches the data URL, and is parsed using Base64Encoder
  • staticryptJs.js: getEncrypted() reads encrypted data from DOM and returns Uint8Array

Testing

I manually tested node encrypt, node decrypt, and HTML wrapper decrypt.

Notes for Reviewers

Pay attention to how fast a large web page is encrypted and decrypted. Also note file size.

jimhark avatar Jul 21 '25 04:07 jimhark