This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3|Reply: 1

[Other] Front-end security secure-ls encrypted storage protects data

[Copy link]
Posted on4 minutes ago | | | |
Requirement: The frontend usually stores tokens in plaintext in the browser's localStorage or caches some configuration caches on the frontend. Using plaintext storage can easily lead to leaks or forged modifications. How can the frontend securely store this data?

secure-ls

Uses advanced encryption and data compression technologies to protect local storage/session storage.

features

Rabbit data is protected using various types of encryption (including AES, DES, and others). RC4 (default is Base64 encoding).
Compress localStorage before storing data to save extra bytes (default is true).
Provides advanced localStorage encapsulation for APIs and provides other basic utilities.
Save data in multiple keys in localStorage, and secure-ls always remembers its creation time.

Source:The hyperlink login is visible.
Documentation:The hyperlink login is visible.
Online Demo:The hyperlink login is visible.

As shown below:



Console test

Directly use the browser console to load JS for testing. The code is as follows:
As shown below:



(End)




Previous:Use Process Monitor to monitor the registry (check for system settings changes)
 Landlord| Posted on7 seconds ago |
removeAll() and clear() are both methods used to clear stored data, but their scope and behavior differ. Here are the differences between the two:

ls.removeAll()

Scope: The removeAll() method is specifically used to remove all key-value pairs created by the secure-ls library, including meta keys.
Library-specific: This method is unique to the secure-ls library and only affects the data managed by that library.
Use case: This method can be used when you only want to clear data managed by secure-ls without affecting other data that may be stored in localStorage.

ls.clear()

Scope: The ls.clear() method clears all data stored via localStorage under the current domain, not just data created by secure-ls.
Global Erase: This method not only deletes the secure-ls data, but also all other data stored via the localStorage API.
Protocol sensitive: It should be noted that localStorage is origin-based, meaning data under HTTP and HTTPS is stored separately. Therefore, if you use HTTP on one page and HTTPS on another, their localStorage data will be different. ls.clear() will only clear data under the current protocol.

summary

If you...If you only want to clear data managed by the secure-ls library, use ls.removeAll()。
If you need to clear all localStorage data under the current domain, regardless of which library or code snippet created this data from, use ls.clear().
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com