AEX-3
AEX: 3
Title: Secret storage format
Author: Sascha Hanse <[email protected]>, Shubhendu Shekhar (@shekhar-shubhendu)
License: BSD-3-Clause
Discussions-To: https://forum.aeternity.com/t/aex-3-secure-storage-format/3220
Status: Active
Type: Informational
Created: 2019-04-03Simple Summary
The document describes and defines the secret storage approach used by æternity.
Motivation
The motivation for the AEX is to describe a standard way that is being used by æternity for secret storage.
The secret storage specification, although is being currently used for secret-key storage, should not be limited to it and should be used as a standard way of storing secret text/plain text (esp. user related or user-owned) in an encrypted format.
Having a standard way for encryption and storage of data enables
Interoperability, not only between æternity and æpps but also between the æpps.
Easy migration from an aeternity-supported
walletto another.
Specification
The data should always be stored in a
.jsonfile.Each file should have a minimum of 1 JSON object with the following
requiredfieldssecret_typespecifies the type of the encrypted data.(optional)
secret_formatspecifies the format of the encrypted data, if not specified then a consumer should assume raw bytessymmetric_algspecifies the algorithm used for symmetric encryption of the secret. This should be authenticated encryption and the only option isxsalsa20-poly1305currently.The
ciphertextis the output ofsymmectric_alg, i.e. the output of libsodiumscrypto_secretbox_easy, which isMAC + CIPHERwith an upper-limit of512 bytes.cipher_paramsparams used for successful decryption of the ciphertextkdfspecifies the methods used for key derivation.kdf_paramsare the params used by thekdfidis a Version 4 UUIDversioncurrently1. Defines the version of secret storage format.
Each JSON Object can also have an optional
namefield, which can be a human-readable name for the secret.
Secret types
Specifying an appropriate secret_type helps consumers to decide the proper way
of handling the decrypted data without having to store additional metadata.
The following secret_type values have been proposed:
ed25519-bip39-mnemoniced25519-slip0010-masterkey
This list should be expanded with adoption.
It is not advised to use this format as a store for arbitrary binary data.
Example
Reference
https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition
Last updated
Was this helpful?