Installation
npm i --save loopback-encryption-mixin
In your model-config.json: add "../node_modules/loopback-encryption-mixin" as a mixin
Then add the mixin to your model
Options Explained
Options | Description |
---|---|
fields | the properties of the model that need to be encrypted |
password | the password of the encryption |
salt | salt for hashing the password |
iteration | iteration of the hash |
hashBytes | the hash bytes corresponding to your hash algorithm and encryption algorithm |
hashAlgorithm | Hash algorithm |
hexIv | iv used for encryption in HEX format |
encryptionAlgorithm | Encryption Algorithm corresponding to your iv and password format |