A command line tool to encrypt JSON files, preserving their schema and types
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | shWith Cargo from crates.io :
cargo install speadWith Cargo from git:
cargo install --git https://github.com/johanyim/spead.gitBuilding from source:
# Clone the repository
git clone https://github.com/johanyim/spead.git
cd spead.git
cargo build --release
cargo install --path .-
Encryption: Values are obfuscated post encryption, and can be decrypted with the original key.
-
Schema Preservation: Ensures the original JSON structure and data types remain intact after encryption.
-
Secure Key Derivation: Utilizes Argon2 for robust, password-based cryptographic key derivation.
-
CLI Integration: Designed for shell scripts, supporting stdin and stdout for input and output.
-
Granular Control: Fine-grained behavioral configuration through command-line flags.
Consider the file, file.json:
{
"_id": 10,
"username": "jdoe",
"display_name": "John Doe",
"email": "[email protected]",
"bio": "Rust developer and open-source contributor.",
"address": {
"street": "123 Main Street",
"city": "Sampleville",
"state": "CA",
"postal_code": "90001",
"country": "USA"
},
"hobbies": [
"Rust",
"Swimming",
"Terraria"
],
"relationships": [
{
"_id": 12,
"username": "jdoe",
"relation": "wife"
},
{
"_id": 4,
"username": "jsmith",
"relation": "friend"
}
],
"followers": 120,
"following": 120,
"verified": true
}Encrypted with the password SECRET_PASSWORD using the command:
spead -p SECRET_PASSWORD file.json{
"_id": 6844942821675,
"username": "ꍔ眮얚",
"display_name": "벭牆腓롁⍗絔قથ",
"email": "瓁晀崓讅驴ࢫቦỖ흱ꁤ䁶홀飬磌迕",
"bio": "춾撲㫄솓ඊ⯘繢词䴐唇Ʇ᥌檎읗쏮懣笘ቍ딲穄梷㣈룬輡跺ꉈꃿ솤噝ᆗ繐匍荞쬫e䉈"꺓䅾",
"address": {
"street": "縁ꐎ䄽㚚鏚诃ᗙ▆啼⩯空薕睇ꊐ鵐",
"city": "⍞蓭⠥䚷䟍䝀쨏த셗걉",
"state": "읠",
"postal_code": "嵜暜攓㓸搯",
"country": "풵嵐褎"
},
"hobbies": [
"뺊祅栐탑",
"짌闣鷗䊤ᔴ",
"稔»㺯頯쬴巡ᣲṇ"
],
"relationships": [
{
"_id": 2687991330582,
"username": "ꓒ鯭鋄㸖",
"relation": "̞⧗瑍%"
},
{
"_id": 4908835464068,
"username": "㸱ᢁ➺珊棔ᘝ",
"relation": "䑱ত懽墚馂곯"
}
],
"followers": 8552593308590,
"following": 7161085169679,
"verified": true
}