Computer scienceBackendNode.jsCore ConceptsInternal modulesOther modulesHashing: overviewHash function

Intro to crypto module

Message from Mars

Report a typo

You have access to a Martian database. It seems the Martians use messaging apps too. Try to decode their messages using the given key, iv, algorithm, and encrypted messages. Their encrypted texts are hidden inside the encryptedMessages array. Map through it and push the result of each iteration into the decryptedMessages array.

key, iv, and algorithm are also hidden and are stored in corresponding constants like this:

const iv = /* some iv */;

const key = /* some key */;

const algorithm = /* some algo */;

When using these constants, just specify the constant name. The crypto module is imported too and you can access it by writing "crypto".

Sample Input 1:


Sample Output 1:

- Next time NASA comes here, let's talk to them.
 - I got a better idea! Let's travel to them directly, to Earth, next summer. I'm afraid we'll get cold if we go during winter.
Write a program in JavaScript
const decryptedMessages = [];
encryptedMessages.map(message => {
/* write your code here */
decryptedMessages.push(/* write your code here */);
});
___

Create a free account to access the full topic