SafeStorage

SafeStorage

Electron-like encryption/decryption API for Node and browsers

The encryption/decryption API was designed with reference to Electron's safeStorage API and chromium implementation. The encryption algorithm used is PBEWithHmacSHA512AndAES_256, which was inspired by Jasypt.

Methods

(async) decryptString(encrypted) → {Promise.<string>}

Description:
  • Decrypt encrypted text with the password passed in the constructor
Source:
Since:
  • 0.1.0
Parameters:
Name Type Description
encrypted string Encrypted text to decrypt
Returns:
Promise that resolves with the decrypted text
Type
Promise.<string>

(async) encryptString(plainText) → {Promise.<string>}

Description:
  • Encrypt plain text with the password passed in the constructor
Source:
Since:
  • 0.1.0
Parameters:
Name Type Description
plainText string Plain text to encrypt
Returns:
Promise that resolves with the encrypted text
Type
Promise.<string>