SafeJSON CLI is a command-line tool for securely encrypting and decrypting JSON data files using strong encryption.
- Encrypt JSON files with AES-256 encryption.
- Decrypt previously encrypted JSON files.
- Simple command-line interface for ease of use.
- git clone https://github.com/dominickasanga/SafeJSONCLI.git
- cd safejson-cli
- npm installThis project is licensed under the MIT License.
To encrypt a JSON file:
./safejson-cli.js encrypt input.json encrypted.json your-secret-keyTo decrypt a JSON file:
./safejson-cli.js decrypt encrypted.json decrypted.json salt--key-for-encryptedJson your-secret-keynpm i safejsoncliconst safejson = require('safejsoncli');
// to encrypt json file
// Example usage:
const inputData = 'Hello, World!';
const password = 'MySecretPassword';
safejson.encrypt(inputData, password)
.then(({ encrypted, salt }) => {
console.log('Encrypted Data:', encrypted);
console.log('Salt:', salt);
})
.catch((error) => {
console.error('Encryption Error:', error);
});const safejson = require('safejsoncli');
// to decrypt json file
// Example usage:
const encryptedData = '...' // Replace with your encrypted data
const salt = '...'
const password = 'MySecretPassword';
safejson.decrypt(encryptedData, salt, password)
.then((decryptedData) => {
console.log('Decrypted Data:', decryptedData);
})
.catch((error) => {
console.error('Decryption Error:', error);
});We welcome contributions! Please read our contribution guidelines for details.
Maintained by Dominic Kasanga
Contact: dominickasanga@gmail.com