chaincodes/samplecc/node/chaincode_sample.js
// To make the process busy, We just Encrypt and then decrypt the value
To make the process busy, We just Encrypt and then decrypt the value
To make the process busy We just Encrypt and then decrypt the value
async encryptAndDecrypt(arg, thisClass) {
        let key = secureRandom.randomBuffer(AESKeyLength);
        let method = thisClass['encrypt'];
        let cipherText = await method(key, arg);
        method = thisClass['decrypt'];
        let plainText = await method(key, cipherText);
        return Buffer.from(plainText, 'utf8');
    }
async encryptAndDecrypt ( arg , thisClass ) { let key = secureRandom . randomBuffer ( AESKeyLength ) ; let method = thisClass [ 'encrypt' ] ; let cipherText = await method ( key , arg ) ; method = thisClass [ 'decrypt' ] ; let plainText = await method ( key , cipherText ) ; return Buffer . from ( plainText , 'utf8' ) ; }
To make the process busy, We just Encrypt and then decrypt the value
To make the process busy We just Encrypt and then decrypt the value
//Generate random AES key of length AESKeyLength