A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.electronjs.org/docs/latest/api/safe-storage below:

safeStorage | Electron

safeStorage

Allows access to simple encryption and decryption of strings for storage on the local machine.

Process: Main

This module adds extra protection to data being stored on disk by using OS-provided cryptography systems. Current security semantics for each platform are outlined below.

Note that on Mac, access to the system Keychain is required and these calls can block the current thread to collect user input. The same is true for Linux, if a password management tool is available.

Methods​

The safeStorage module has the following methods:

safeStorage.isEncryptionAvailable()​

Returns boolean - Whether encryption is available.

On Linux, returns true if the app has emitted the ready event and the secret key is available. On MacOS, returns true if Keychain is available. On Windows, returns true once the app has emitted the ready event.

safeStorage.encryptString(plainText)​

Returns Buffer - An array of bytes representing the encrypted string.

This function will throw an error if encryption fails.

safeStorage.decryptString(encrypted)​

Returns string - the decrypted string. Decrypts the encrypted buffer obtained with safeStorage.encryptString back into a string.

This function will throw an error if decryption fails.

safeStorage.setUsePlainTextEncryption(usePlainText)​

This function on Linux will force the module to use an in memory password for creating symmetric key that is used for encrypt/decrypt functions when a valid OS password manager cannot be determined for the current active desktop environment. This function is a no-op on Windows and MacOS.

safeStorage.getSelectedStorageBackend() Linux​

Returns string - User friendly name of the password manager selected on Linux.

This function will return one of the following values:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4