Encryption Utility for Satoshi Showdown. Provides functionality for encrypting and decrypting private keys, focusing on securing sensitive data. It uses AES-256-GCM encryption, which includes an authentication tag for additional security.
- Source:
Requires
- module:crypto
Methods
(inner) decryptPrivateKey(encryptedPrivateKey) → {string}
Decrypts an encrypted private key using AES-256-GCM. Uses the provided IV and authentication tag for decryption. Throws an error if the decryption process fails.
Parameters:
Name | Type | Description |
---|---|---|
encryptedPrivateKey |
Object | The encrypted private key object containing the IV, content, and tag. |
- Source:
Throws:
-
If the decryption process fails or the secret key is not set.
- Type
- Error
Returns:
The decrypted private key.
- Type
- string
(inner) encryptPrivateKey(privateKey) → {Object}
Encrypts a private key using AES-256-GCM. Generates an IV for each encryption and includes an authentication tag. Throws an error if the secret key is not set in environment variables.
Parameters:
Name | Type | Description |
---|---|---|
privateKey |
string | The private key to encrypt. |
- Source:
Throws:
-
If the encryption secret key is not set.
- Type
- Error
Returns:
An object containing the IV, encrypted content, and authentication tag.
- Type
- Object