crypto-data
v0.0.19
Published
crypto mechanisum for encrypt and decrypt data in NBFC Data Security eco-system
Downloads
278
Maintainers
Keywords
Readme
Installation
const encNdesc = require('crypto-data');
Usage
FI DATA ENC N DESC
Note: all functions promised based functions so either you can use await or then to handle the response.
FIU Generate ECDH keys
let ECDHkeypair= await encNdesc.enc.generateKeyMaterial(eccUrl);
/**
* eccUrl = ECC base Url [default is http://localhost:8111]
*/
FIP Encryption
let encryptedData=await encNdesc.FIPEncryption(id, Data, fiuKeyMaterialData, eccUrl);
/**
* id= fip ID
* Data= FI Data
* fiuKeyMaterialData= his KeyMaterial
* eccUrl = ECC base Url
*/
Note : we can use all Encryption functions calling by encNdesc.enc
FIU Decryption
let decryptedFIUData=await encNdesc.dataDecrypt(cipher,hisKeyMaterial, myScrtKey,fiuNonce, eccUrl);
/**
* cipher= encrypted Data
* fiuKeyMaterialData= his KeyMaterial
* myScrtKey= my ECDH privateKey
* fiuNonce = my random 32-byte BASE64 string
* opts = optional parameters Object
*/
Note : iv id depricated. need not pass iv as params inrenally it will took from cipher.
Version release summary
0.0.1
- this is extracted from finpro-crypto v0.0.14
0.0.2
- now onwards random nonce are integers only
0.0.3
- in FIPEncryption return object the params key is changed from object to empty string.
0.0.4
- revereted number nonce to Base64 encoded.
- Introduced ECC API Services for ECDH Key Pair, FI Data Encryption and Decryption. Deprecated the curve25519-n library.
- need to pass eccUrl as extra param for encryption , generate ecdh functions.
0.0.5
- ECC docker version changed.
0.0.6
- FI DB Data getting OoB now changed to AoB before doing Asnyc operations.
0.0.7
- unused libraries are removed from .json file.
0.0.8
- getting extra spaces after decryption for Encrypted FI. now its resolved. now it will work for both JSON and XML. .... ....
0.0.13
- upgrading ECC service from v1 to v1.2. made changes in functions as per new ecc API's request and responses.
0.0.16
- in encryption previously we are passing base64 FI data now plain text with stringified is enough.
0.0.17
- in above encryption technique XMl string is stringfiying twice so implemented logic based typeof method stringifying.
0.0.18
- DHPublickey expiry time formate currently accepting Z only now we made changes to accept both Z and +0000 as suffix.
0.0.19
- keymaterials sequence